Methods Summary |
---|
public Cache | buildCache(java.lang.String regionName, java.util.Properties properties)Construct and configure the Cache representation of a named cache region.
return new TreeCache(cache, regionName, transactionManager);
|
public org.jboss.cache.TreeCache | getUnderlyingCache()
return cache;
|
public boolean | isMinimalPutsEnabledByDefault()
return true;
|
public long | nextTimestamp()
return System.currentTimeMillis() / 100;
|
public void | start(java.util.Properties properties)Prepare the underlying JBossCache TreeCache instance.
String resource = properties.getProperty( Environment.CACHE_PROVIDER_CONFIG );
if ( resource == null ) {
resource = properties.getProperty( CONFIG_RESOURCE );
}
if ( resource == null ) {
resource = DEFAULT_CONFIG;
}
log.debug( "Configuring TreeCache from resource [" + resource + "]" );
try {
cache = new org.jboss.cache.TreeCache();
PropertyConfigurator config = new PropertyConfigurator();
config.configure( cache, resource );
TransactionManagerLookup transactionManagerLookup = TransactionManagerLookupFactory.getTransactionManagerLookup(properties);
if (transactionManagerLookup!=null) {
cache.setTransactionManagerLookup( new TransactionManagerLookupAdaptor(transactionManagerLookup, properties) );
transactionManager = transactionManagerLookup.getTransactionManager(properties);
}
cache.start();
}
catch (Exception e) {
throw new CacheException(e);
}
|
public void | stop()
if (cache!=null) {
cache.stop();
cache.destroy();
cache=null;
}
|