|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jboss.dna.connector.jbosscache.JBossCacheSource
@ThreadSafe public class JBossCacheSource
A repository source that uses a JBoss Cache instance to manage the content. This source is capable of using an existing
Cache instance or creating a new instance. This process is controlled entirely by the JavaBean properties of the
JBossCacheSource instance.
This source first attempts to find an existing cache in JNDI. If none is found, then it attempts to
create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache configuration
name if supplied or the default configuration if not set.
Like other RepositorySource classes, instances of JBossCacheSource can be placed into JNDI and do support the creation
of JNDI referenceable objects and resolution of references into JBossCacheSource.
| Nested Class Summary | |
|---|---|
protected class |
JBossCacheSource.Capabilities
|
| Field Summary | |
|---|---|
protected static String |
CACHE_CONFIGURATION_NAME
|
protected static String |
CACHE_FACTORY_JNDI_NAME
|
protected static String |
CACHE_JNDI_NAME
|
protected static String |
DEFAULT_CACHE_POLICY
|
static int |
DEFAULT_RETRY_LIMIT
The default limit is 0 for retrying connection calls to the underlying source. |
static String |
DEFAULT_UUID_PROPERTY_NAME
|
protected static String |
RETRY_LIMIT
|
protected static String |
ROOT_NODE_UUID
|
protected static String |
SOURCE_NAME
|
protected static String |
UUID_PROPERTY_NAME
|
| Constructor Summary | |
|---|---|
JBossCacheSource()
Create a repository source instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
String |
getCacheConfigurationName()
Get the name of the configuration that should be used if a cache is to be created using the
CacheFactory found in JNDI or the DefaultCacheFactory if needed. |
String |
getCacheFactoryJndiName()
Get the name in JNDI of a CacheFactory instance that should be used to create the cache for this source. |
String |
getCacheJndiName()
Get the name in JNDI of a Cache instance that should be used by this source. |
org.jboss.dna.graph.connectors.RepositorySourceCapabilities |
getCapabilities()
|
org.jboss.dna.graph.connectors.RepositoryConnection |
getConnection()
|
protected Context |
getContext()
|
org.jboss.dna.graph.cache.CachePolicy |
getDefaultCachePolicy()
Get the default cache policy for this source, or null if the global default cache policy should be used |
String |
getName()
|
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
|
Reference |
getReference()
|
org.jboss.dna.graph.connectors.RepositoryContext |
getRepositoryContext()
|
int |
getRetryLimit()
|
String |
getRootNodeUuid()
Get the UUID of the root node for the cache. |
UUID |
getRootNodeUuidObject()
Get the UUID of the root node for the cache. |
String |
getUuidPropertyName()
Get the property name where the UUID is stored for each node. |
void |
initialize(org.jboss.dna.graph.connectors.RepositoryContext context)
|
void |
setCacheConfigurationName(String cacheConfigurationName)
Get the name of the configuration that should be used if a cache is to be created using the
CacheFactory found in JNDI or the DefaultCacheFactory if needed. |
void |
setCacheFactoryJndiName(String jndiName)
Set the name in JNDI of a CacheFactory instance that should be used to obtain the Cache instance used by
this source. |
void |
setCacheJndiName(String cacheJndiName)
Set the name in JNDI of a Cache instance that should be used by this source. |
protected void |
setContext(Context context)
|
void |
setDefaultCachePolicy(org.jboss.dna.graph.cache.CachePolicy defaultCachePolicy)
|
void |
setName(String name)
Set the name of this source |
void |
setRetryLimit(int limit)
|
void |
setRootNodeUuid(String rootNodeUuid)
Set the UUID of the root node in this repository. |
void |
setUuidPropertyName(String uuidPropertyName)
Set the property name where the UUID is stored for each node. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_RETRY_LIMIT
connection calls to the underlying source.
public static final String DEFAULT_UUID_PROPERTY_NAME
protected static final String ROOT_NODE_UUID
protected static final String SOURCE_NAME
protected static final String DEFAULT_CACHE_POLICY
protected static final String CACHE_CONFIGURATION_NAME
protected static final String CACHE_FACTORY_JNDI_NAME
protected static final String CACHE_JNDI_NAME
protected static final String UUID_PROPERTY_NAME
protected static final String RETRY_LIMIT
| Constructor Detail |
|---|
public JBossCacheSource()
| Method Detail |
|---|
public void initialize(org.jboss.dna.graph.connectors.RepositoryContext context)
throws org.jboss.dna.graph.connectors.RepositorySourceException
initialize in interface org.jboss.dna.graph.connectors.RepositorySourceorg.jboss.dna.graph.connectors.RepositorySourceExceptionRepositorySource.initialize(org.jboss.dna.graph.connectors.RepositoryContext)public org.jboss.dna.graph.connectors.RepositoryContext getRepositoryContext()
public String getName()
getName in interface org.jboss.dna.graph.connectors.RepositorySourcepublic int getRetryLimit()
getRetryLimit in interface org.jboss.dna.graph.connectors.RepositorySourceRepositorySource.getRetryLimit()public void setRetryLimit(int limit)
setRetryLimit in interface org.jboss.dna.graph.connectors.RepositorySourceRepositorySource.setRetryLimit(int)public void setName(String name)
name - the name for this sourcepublic org.jboss.dna.graph.cache.CachePolicy getDefaultCachePolicy()
public void setDefaultCachePolicy(org.jboss.dna.graph.cache.CachePolicy defaultCachePolicy)
defaultCachePolicy - Sets defaultCachePolicy to the specified value.public String getCacheJndiName()
Cache instance that should be used by this source.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
Cache instance that should be used, or null if the cache is to be created with a cache
factory found in JNDI using the specified cache configuration name.setCacheJndiName(String),
getCacheConfigurationName(),
getCacheFactoryJndiName()public void setCacheJndiName(String cacheJndiName)
Cache instance that should be used by this source.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
cacheJndiName - the JNDI name of the Cache instance that should be used, or null if the cache is to be created
with a cache factory found in JNDI using the specified
cache configuration name.getCacheJndiName(),
getCacheConfigurationName(),
getCacheFactoryJndiName()public String getCacheFactoryJndiName()
CacheFactory instance that should be used to create the cache for this source.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
CacheFactory instance that should be used, or null if the DefaultCacheFactory
should be used if a cache is to be createdsetCacheFactoryJndiName(String),
getCacheConfigurationName(),
getCacheJndiName()public void setCacheFactoryJndiName(String jndiName)
CacheFactory instance that should be used to obtain the Cache instance used by
this source.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
jndiName - the JNDI name of the CacheFactory instance that should be used, or null if the
DefaultCacheFactory should be used if a cache is to be createdsetCacheFactoryJndiName(String),
getCacheConfigurationName(),
getCacheJndiName()public String getCacheConfigurationName()
cache is to be created using the
CacheFactory found in JNDI or the DefaultCacheFactory if needed.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
CacheFactory, or null if the default
configuration should be usedsetCacheConfigurationName(String),
getCacheFactoryJndiName(),
getCacheJndiName()public void setCacheConfigurationName(String cacheConfigurationName)
cache is to be created using the
CacheFactory found in JNDI or the DefaultCacheFactory if needed.
This source first attempts to find an existing cache in JNDI. If none is found, then it
attempts to create a cache instance using the CacheFactory found in JNDI (or the
DefaultCacheFactory if no such factory is available) and the cache
configuration name if supplied or the default configuration if not set.
cacheConfigurationName - the name of the configuration that should be passed to the CacheFactory, or null if
the default configuration should be usedgetCacheConfigurationName(),
getCacheFactoryJndiName(),
getCacheJndiName()public String getRootNodeUuid()
public UUID getRootNodeUuidObject()
public void setRootNodeUuid(String rootNodeUuid)
rootNodeUuid - the UUID of the root node for the cache, or null if the UUID should be randomly generatedpublic String getUuidPropertyName()
property name where the UUID is stored for each node.
public void setUuidPropertyName(String uuidPropertyName)
property name where the UUID is stored for each node.
uuidPropertyName - the name of the UUID property, or null if the default name
should be used
public org.jboss.dna.graph.connectors.RepositoryConnection getConnection()
throws org.jboss.dna.graph.connectors.RepositorySourceException
getConnection in interface org.jboss.dna.graph.connectors.RepositorySourceorg.jboss.dna.graph.connectors.RepositorySourceExceptionRepositorySource.getConnection()protected Context getContext()
protected void setContext(Context context)
public boolean equals(Object obj)
equals in class Objectpublic Reference getReference()
getReference in interface Referenceable
public Object getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
throws Exception
getObjectInstance in interface ObjectFactoryExceptionpublic org.jboss.dna.graph.connectors.RepositorySourceCapabilities getCapabilities()
getCapabilities in interface org.jboss.dna.graph.connectors.RepositorySourceRepositorySource.getCapabilities()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||