org.jboss.ha.cachemanager
Class CacheManager

java.lang.Object
  extended by org.jboss.cache.CacheManagerImpl
      extended by org.jboss.ha.cachemanager.CacheManager
All Implemented Interfaces:
MBeanRegistration, org.jboss.cache.CacheManager, CacheManagerMBean, org.jboss.ha.framework.server.PojoCacheManager

public class CacheManager
extends org.jboss.cache.CacheManagerImpl
implements org.jboss.cache.CacheManager, org.jboss.ha.framework.server.PojoCacheManager, MBeanRegistration, CacheManagerMBean

JBoss AS specific CacheManager. Extends the core JBoss Cache cache manager by also handling, PojoCache, by registering created caches in JMX, and by registering itself in JNDI.

Version:
$Revision: 1.1 $
Author:
Brian Stansberry

Nested Class Summary
static class CacheManager.StartStopListener
           
 
Field Summary
static String DEFAULT_CORE_CACHE_JMX_ATTRIBUTES
           
static String DEFAULT_POJO_CACHE_JMX_ATTRIBUTES
           
 
Constructor Summary
CacheManager()
          Create a new CacheManagerImpl.
CacheManager(org.jboss.cache.config.ConfigurationRegistry configRegistry, org.jgroups.ChannelFactory factory)
          Create a new CacheManagerImpl.
CacheManager(String configFileName, org.jgroups.ChannelFactory factory)
          Create a new CacheManagerImpl.
 
Method Summary
protected  org.jboss.cache.pojo.PojoCache createPojoCache(org.jboss.cache.config.Configuration config)
          Extension point for subclasses, where we actually use a PojoCacheFactory to create a PojoCache.
 org.jboss.cache.Cache<Object,Object> getCache(String configName, boolean create)
           
 Map<String,String> getConfigAliases()
           
 Set<String> getConfigurationNames()
           
 String getCoreCacheJmxAttributes()
           
 String getJmxDomain()
           
 String getJndiName()
           
 org.jboss.cache.pojo.PojoCache getPojoCache(String configName, boolean create)
           
 String getPojoCacheJmxAttributes()
           
 Set<String> getPojoCacheNames()
           
 boolean getRegisterCachesInJmx()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
 void registerCache(org.jboss.cache.Cache<Object,Object> cache, String configName)
           
 void registerPojoCache(org.jboss.cache.pojo.PojoCache cache, String configName)
           
 void releaseCache(String configName)
           
 void setConfigAliases(Map<String,String> aliases)
           
 void setCoreCacheJmxAttributes(String coreCacheJmxAttributes)
           
 void setEagerStartCaches(Set<String> configNames)
           
 void setEagerStartPojoCaches(Set<String> configNames)
           
 void setJmxDomain(String jmxDomain)
           
 void setJndiName(String jndiName)
           
 void setPojoCacheJmxAttributes(String pojoCacheJmxAttributes)
           
 void setRegisterCachesInJmx(boolean register)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.jboss.cache.CacheManagerImpl
createCache, getCacheNames, getChannelFactory, getConfigurationRegistry, setChannelFactory, setConfigurationRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.CacheManager
getCacheNames, getChannelFactory
 
Methods inherited from interface org.jboss.ha.framework.server.PojoCacheManager
getChannelFactory
 
Methods inherited from interface org.jboss.ha.cachemanager.CacheManagerMBean
getCacheNames
 

Field Detail

DEFAULT_CORE_CACHE_JMX_ATTRIBUTES

public static final String DEFAULT_CORE_CACHE_JMX_ATTRIBUTES
See Also:
Constant Field Values

DEFAULT_POJO_CACHE_JMX_ATTRIBUTES

public static final String DEFAULT_POJO_CACHE_JMX_ATTRIBUTES
See Also:
Constant Field Values
Constructor Detail

CacheManager

public CacheManager()
Create a new CacheManagerImpl.


CacheManager

public CacheManager(org.jboss.cache.config.ConfigurationRegistry configRegistry,
                    org.jgroups.ChannelFactory factory)
Create a new CacheManagerImpl.

Parameters:
configRegistry -
factory -

CacheManager

public CacheManager(String configFileName,
                    org.jgroups.ChannelFactory factory)
Create a new CacheManagerImpl.

Parameters:
configFileName -
factory -
Method Detail

getConfigurationNames

public Set<String> getConfigurationNames()
Specified by:
getConfigurationNames in interface org.jboss.cache.CacheManager
Specified by:
getConfigurationNames in interface CacheManagerMBean
Specified by:
getConfigurationNames in interface org.jboss.ha.framework.server.PojoCacheManager
Overrides:
getConfigurationNames in class org.jboss.cache.CacheManagerImpl

getPojoCacheNames

public Set<String> getPojoCacheNames()
Specified by:
getPojoCacheNames in interface CacheManagerMBean
Specified by:
getPojoCacheNames in interface org.jboss.ha.framework.server.PojoCacheManager

getPojoCache

public org.jboss.cache.pojo.PojoCache getPojoCache(String configName,
                                                   boolean create)
                                            throws Exception
Specified by:
getPojoCache in interface org.jboss.ha.framework.server.PojoCacheManager
Throws:
Exception

createPojoCache

protected org.jboss.cache.pojo.PojoCache createPojoCache(org.jboss.cache.config.Configuration config)
Extension point for subclasses, where we actually use a PojoCacheFactory to create a PojoCache.

Parameters:
config - the Configuration for the cache
Returns:
the PojoCache

registerPojoCache

public void registerPojoCache(org.jboss.cache.pojo.PojoCache cache,
                              String configName)

getCache

public org.jboss.cache.Cache<Object,Object> getCache(String configName,
                                                     boolean create)
                                              throws Exception
Specified by:
getCache in interface org.jboss.cache.CacheManager
Overrides:
getCache in class org.jboss.cache.CacheManagerImpl
Throws:
Exception

registerCache

public void registerCache(org.jboss.cache.Cache<Object,Object> cache,
                          String configName)
Overrides:
registerCache in class org.jboss.cache.CacheManagerImpl

releaseCache

public void releaseCache(String configName)
Specified by:
releaseCache in interface org.jboss.cache.CacheManager
Specified by:
releaseCache in interface org.jboss.ha.framework.server.PojoCacheManager
Overrides:
releaseCache in class org.jboss.cache.CacheManagerImpl

start

public void start()
           throws Exception
Overrides:
start in class org.jboss.cache.CacheManagerImpl
Throws:
Exception

stop

public void stop()
Overrides:
stop in class org.jboss.cache.CacheManagerImpl

getJmxDomain

public String getJmxDomain()
Specified by:
getJmxDomain in interface CacheManagerMBean

setJmxDomain

public void setJmxDomain(String jmxDomain)

getCoreCacheJmxAttributes

public String getCoreCacheJmxAttributes()
Specified by:
getCoreCacheJmxAttributes in interface CacheManagerMBean

setCoreCacheJmxAttributes

public void setCoreCacheJmxAttributes(String coreCacheJmxAttributes)

getPojoCacheJmxAttributes

public String getPojoCacheJmxAttributes()
Specified by:
getPojoCacheJmxAttributes in interface CacheManagerMBean

setPojoCacheJmxAttributes

public void setPojoCacheJmxAttributes(String pojoCacheJmxAttributes)

getRegisterCachesInJmx

public boolean getRegisterCachesInJmx()
Specified by:
getRegisterCachesInJmx in interface CacheManagerMBean

setRegisterCachesInJmx

public void setRegisterCachesInJmx(boolean register)

getJndiName

public String getJndiName()
Specified by:
getJndiName in interface CacheManagerMBean

setJndiName

public void setJndiName(String jndiName)

getConfigAliases

public Map<String,String> getConfigAliases()

setConfigAliases

public void setConfigAliases(Map<String,String> aliases)

setEagerStartCaches

public void setEagerStartCaches(Set<String> configNames)

setEagerStartPojoCaches

public void setEagerStartPojoCaches(Set<String> configNames)

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.