public class MultiplexingCacheInstanceManager extends Object implements CacheInstanceManager
Cache
instances for each type of region,
with the expectation that a single multiplexed JGroups resource (i.e. a
multiplexed channel or a shared transport channel) will be shared between
the caches.Modifier and Type | Field and Description |
---|---|
static String |
CACHE_FACTORY_RESOURCE_PROP
Classpath or filesystem resource containing JBoss Cache
configurations the factory should use.
|
static String |
CHANNEL_FACTORY_RESOURCE_PROP
Classpath or filesystem resource containing JGroups protocol
stack configurations the
org.jgroups.ChannelFactory
should use. |
static String |
COLLECTION_CACHE_RESOURCE_PROP
Name of the configuration that should be used for collection caches.
|
static String |
DEF_CACHE_FACTORY_RESOURCE
Default value for
CACHE_FACTORY_RESOURCE_PROP . |
static String |
DEF_ENTITY_RESOURCE
Default value for
ENTITY_CACHE_RESOURCE_PROP . |
static String |
DEF_JGROUPS_RESOURCE
Default value for
CHANNEL_FACTORY_RESOURCE_PROP . |
static String |
DEF_QUERY_RESOURCE
Default value for
ENTITY_CACHE_RESOURCE_PROP . |
static String |
DEF_TS_RESOURCE
Default value for
TIMESTAMP_CACHE_RESOURCE_PROP . |
static String |
ENTITY_CACHE_RESOURCE_PROP
Name of the configuration that should be used for entity caches.
|
static String |
LEGACY_CACHE_FACTORY_RESOURCE_PROP
Legacy name for configuration property
CACHE_FACTORY_RESOURCE_PROP . |
static String |
LEGACY_CHANNEL_FACTORY_RESOURCE_PROP
Legacy name for configuration property
CHANNEL_FACTORY_RESOURCE_PROP . |
static String |
LEGACY_COLLECTION_CACHE_RESOURCE_PROP
Legacy name for configuration property
COLLECTION_CACHE_RESOURCE_PROP . |
static String |
LEGACY_ENTITY_CACHE_RESOURCE_PROP
Legacy name for configuration property
ENTITY_CACHE_RESOURCE_PROP . |
static String |
LEGACY_QUERY_CACHE_RESOURCE_PROP
Legacy name for configuration property
QUERY_CACHE_RESOURCE_PROP . |
static String |
LEGACY_TIMESTAMP_CACHE_RESOURCE_PROP
Legacy name for configuration property
TIMESTAMP_CACHE_RESOURCE_PROP . |
static String |
QUERY_CACHE_RESOURCE_PROP
Name of the configuration that should be used for query caches.
|
static String |
TIMESTAMP_CACHE_RESOURCE_PROP
Name of the configuration that should be used for timestamp caches.
|
Constructor and Description |
---|
MultiplexingCacheInstanceManager()
Create a new MultiplexingCacheInstanceManager.
|
MultiplexingCacheInstanceManager(org.jboss.cache.Cache jbcEntityCache,
org.jboss.cache.Cache jbcCollectionCache,
org.jboss.cache.Cache jbcTsCache,
org.jboss.cache.Cache jbcQueryCache)
Create a new MultiplexingCacheInstanceManager using the provided
Cache s. |
Modifier and Type | Method and Description |
---|---|
org.jboss.cache.CacheManager |
getCacheFactory()
Getter for property 'cacheFactory'.
|
org.jgroups.ChannelFactory |
getChannelFactory()
Getter for property 'channelFactory'.
|
org.jboss.cache.Cache |
getCollectionCacheInstance()
Retrieve a handle to the
Cache instance to be used for storing
collection data. |
org.jboss.cache.Cache |
getEntityCacheInstance()
Retrieve a handle to the
Cache instance to be used for storing
entity data. |
org.jboss.cache.Cache |
getQueryCacheInstance()
Retrieve a handle to the
Cache instance to be used for storing
query results. |
org.jboss.cache.Cache |
getTimestampsCacheInstance()
Retrieve a handle to the
Cache instance to be used for storing
timestamps. |
void |
setCacheFactory(org.jboss.cache.CacheManager factory)
Setter for property 'cacheFactory'.
|
void |
setChannelFactory(org.jgroups.ChannelFactory factory)
Setter for property 'channelFactory'.
|
void |
start(Settings settings,
Properties properties)
Lifecycle callback to perform any necessary initialization of the
CacheInstanceManager.
|
void |
stop()
Lifecycle callback to perform any necessary cleanup of the underlying
CacheInstanceManager.
|
public static final String CACHE_FACTORY_RESOURCE_PROP
public static final String LEGACY_CACHE_FACTORY_RESOURCE_PROP
CACHE_FACTORY_RESOURCE_PROP
.public static final String CHANNEL_FACTORY_RESOURCE_PROP
org.jgroups.ChannelFactory
should use.DEF_JGROUPS_RESOURCE
,
Constant Field Valuespublic static final String LEGACY_CHANNEL_FACTORY_RESOURCE_PROP
CHANNEL_FACTORY_RESOURCE_PROP
.DEF_JGROUPS_RESOURCE
,
Constant Field Valuespublic static final String ENTITY_CACHE_RESOURCE_PROP
DEF_ENTITY_RESOURCE
,
Constant Field Valuespublic static final String LEGACY_ENTITY_CACHE_RESOURCE_PROP
ENTITY_CACHE_RESOURCE_PROP
.DEF_ENTITY_RESOURCE
,
Constant Field Valuespublic static final String COLLECTION_CACHE_RESOURCE_PROP
public static final String LEGACY_COLLECTION_CACHE_RESOURCE_PROP
COLLECTION_CACHE_RESOURCE_PROP
.public static final String TIMESTAMP_CACHE_RESOURCE_PROP
DEF_TS_RESOURCE
,
Constant Field Valuespublic static final String LEGACY_TIMESTAMP_CACHE_RESOURCE_PROP
TIMESTAMP_CACHE_RESOURCE_PROP
.DEF_TS_RESOURCE
,
Constant Field Valuespublic static final String QUERY_CACHE_RESOURCE_PROP
DEF_QUERY_RESOURCE
,
Constant Field Valuespublic static final String LEGACY_QUERY_CACHE_RESOURCE_PROP
QUERY_CACHE_RESOURCE_PROP
.DEF_QUERY_RESOURCE
,
Constant Field Valuespublic static final String DEF_CACHE_FACTORY_RESOURCE
CACHE_FACTORY_RESOURCE_PROP
. Specifies
the "jbc2-configs.xml" file in this package.public static final String DEF_JGROUPS_RESOURCE
CHANNEL_FACTORY_RESOURCE_PROP
. Specifies
the "jgroups-stacks.xml" file in this package.public static final String DEF_ENTITY_RESOURCE
ENTITY_CACHE_RESOURCE_PROP
.public static final String DEF_TS_RESOURCE
TIMESTAMP_CACHE_RESOURCE_PROP
.public static final String DEF_QUERY_RESOURCE
ENTITY_CACHE_RESOURCE_PROP
.public MultiplexingCacheInstanceManager()
public MultiplexingCacheInstanceManager(org.jboss.cache.Cache jbcEntityCache, org.jboss.cache.Cache jbcCollectionCache, org.jboss.cache.Cache jbcTsCache, org.jboss.cache.Cache jbcQueryCache)
Cache
s.
If this constructor is used, the start(Settings, Properties)
method will make no attempt to create a cache factory or obtain caches
from it. Only the Cache
s passed as arguments to this
constructor will be available.jbcEntityCache
- The entity cachejbcCollectionCache
- the collection cachejbcTsCache
- The timestamps cachejbcQueryCache
- The query cachepublic org.jboss.cache.CacheManager getCacheFactory()
setCacheFactory(org.jboss.cache.CacheManager)
public void setCacheFactory(org.jboss.cache.CacheManager factory)
factory
- Value to set for property 'cacheFactory'.getCacheFactory()
public org.jgroups.ChannelFactory getChannelFactory()
setChannelFactory(org.jgroups.ChannelFactory)
public void setChannelFactory(org.jgroups.ChannelFactory factory)
factory
- Value to set for property 'channelFactory'.getChannelFactory()
public org.jboss.cache.Cache getEntityCacheInstance()
Cache
instance to be used for storing
entity data.getEntityCacheInstance
in interface CacheInstanceManager
public org.jboss.cache.Cache getCollectionCacheInstance()
Cache
instance to be used for storing
collection data.getCollectionCacheInstance
in interface CacheInstanceManager
public org.jboss.cache.Cache getQueryCacheInstance()
Cache
instance to be used for storing
query results.getQueryCacheInstance
in interface CacheInstanceManager
public org.jboss.cache.Cache getTimestampsCacheInstance()
Cache
instance to be used for storing
timestamps.getTimestampsCacheInstance
in interface CacheInstanceManager
public void start(Settings settings, Properties properties) throws CacheException
SessionFactoryImpl
.start
in interface CacheInstanceManager
settings
- The settings in effect.properties
- The defined cfg propertiesCacheException
- Indicates problems starting the L2 cache impl; considered as
a sign to stop SessionFactory
building.public void stop()
SessionFactory.close()
.stop
in interface CacheInstanceManager
Copyright © 2002-2014 Red Hat Middleware, LLC. All Rights Reserved