GigaSpaces - Open Spaces

org.openspaces.core.space.cache
Class AbstractLocalCacheSpaceFactoryBean

java.lang.Object
  extended by org.openspaces.core.space.cache.AbstractLocalCacheSpaceFactoryBean
All Implemented Interfaces:
BeanNameAware, DisposableBean, FactoryBean, InitializingBean
Direct Known Subclasses:
LocalCacheSpaceFactoryBean, LocalViewSpaceFactoryBean

public abstract class AbstractLocalCacheSpaceFactoryBean
extends Object
implements InitializingBean, DisposableBean, FactoryBean, BeanNameAware

Base class for different Local cache space proxies that work with a master IJSpace. The master is set using setSpace(IJSpace). This factory represents an IJSpace that is the local cache proxy on top of the master space.

Allows to set additional properties that further configure the local cache using setProperties(Properties). Properties that control the nature of the local cache are obtained using createCacheProeprties() callback.

Author:
kimchy

Field Summary
protected  Log logger
           
 
Constructor Summary
AbstractLocalCacheSpaceFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
          Constructs a new local cache IJSpace based on the master local cache set using setSpace(IJSpace) and a set of properties driving the actual local cache type based on createCacheProeprties().
protected abstract  Properties createCacheProeprties()
          Subclasses should implement this method to return the properties relevant for the local concrete local cache implementation.
 void destroy()
          Closes the local cache space
protected  String getBeanName()
           
 Object getObject()
          Returns an IJSpace that is the local cache wrapping the master proxy set using setSpace(com.j_spaces.core.IJSpace).
 Class<? extends com.j_spaces.core.IJSpace> getObjectType()
          Returns the type of the factory object.
 boolean isSingleton()
          Returns true since this bean is a singleton.
 void setBeanName(String beanName)
          Spring callback that sets the bean name.
 void setProperties(Properties properties)
          Sets additional properties for the local cache.
 void setSpace(com.j_spaces.core.IJSpace space)
          Sets the master space that a local cache will be built on top.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Log logger
Constructor Detail

AbstractLocalCacheSpaceFactoryBean

public AbstractLocalCacheSpaceFactoryBean()
Method Detail

setSpace

public void setSpace(com.j_spaces.core.IJSpace space)
Sets the master space that a local cache will be built on top.


setProperties

public void setProperties(Properties properties)
Sets additional properties for the local cache.


setBeanName

public void setBeanName(String beanName)
Spring callback that sets the bean name.

Specified by:
setBeanName in interface BeanNameAware

getBeanName

protected String getBeanName()

afterPropertiesSet

public void afterPropertiesSet()
Constructs a new local cache IJSpace based on the master local cache set using setSpace(IJSpace) and a set of properties driving the actual local cache type based on createCacheProeprties(). Additional properties are applied based on setProperties(java.util.Properties).

Specified by:
afterPropertiesSet in interface InitializingBean
See Also:
SpaceFinder.find(com.j_spaces.core.client.SpaceURL,com.j_spaces.core.IJSpace,com.sun.jini.start.LifeCycle)

destroy

public void destroy()
Closes the local cache space

Specified by:
destroy in interface DisposableBean

createCacheProeprties

protected abstract Properties createCacheProeprties()
Subclasses should implement this method to return the properties relevant for the local concrete local cache implementation.


getObject

public Object getObject()
Returns an IJSpace that is the local cache wrapping the master proxy set using setSpace(com.j_spaces.core.IJSpace).

Specified by:
getObject in interface FactoryBean

getObjectType

public Class<? extends com.j_spaces.core.IJSpace> getObjectType()
Returns the type of the factory object.

Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Returns true since this bean is a singleton.

Specified by:
isSingleton in interface FactoryBean

GigaSpaces - Open Spaces

Copyright © GigaSpaces.