org.jboss.cache.jmx
Interface CacheJmxWrapperMBean<K,V>

All Superinterfaces:
LegacyConfiguration
All Known Implementing Classes:
CacheJmxWrapper

public interface CacheJmxWrapperMBean<K,V>
extends LegacyConfiguration

JMX interface to the Cache. Full access to the cache is not supported, only a certain set of operations are exposed via JMX:

  1. Lifecycle methods - create, start, stop, destroy
  2. Configuration (read-only) getter - which retrieves a String (or formatted HTML for web based JMX consoles) representation of the configuration
  3. Properties exposing Configuration elements
  4. Cache information methods (numNodes, numAttributes, lockInfo, printDetails) which print as Strings or as formatted HTML (for web based JMX consoles)
  5. Since:
    2.0.0 For all purposes use JmxRegistrationManager. Use this class only when you want to obtain a reference to a Cache object through JMX.

    Field Summary
    static int CREATED
              The lifecycle method create has completed
    static int DESTROYED
              The lifecycle method destroy has completed
    static int FAILED
              There has been an error during some operation
    static int REGISTERED
              The MBean has been instantiated and has completed MBeanRegistration.postRegister
    static int STARTED
              The lifecycle method start has completed
    static int STARTING
              The lifecycle method start has been invoked
    static int STOPPED
              The lifecycle method stop has completed
    static int STOPPING
              The lifecycle method stop has been invoked
    static int UNREGISTERED
              The MBean has been instantiated but has not completed MBeanRegistration.postRegister
     
    Method Summary
     void create()
               
     void destroy()
               
     Cache<K,V> getCache()
              Retrieves a reference to the underlying Cache
     CacheStatus getCacheStatus()
              Gets where this object is in its lifecycle transitions.
     Configuration getConfiguration()
               
     org.jgroups.Address getLocalAddress()
              Returns the local address of this cache in a cluster, or null if running in local mode.
     List<org.jgroups.Address> getMembers()
              Returns a list of members in the cluster, or null if running in local mode.
     int getNumberOfAttributes()
               
     int getNumberOfNodes()
               
     boolean getRegisterJmxResource()
              Gets whether this object should register the cache's interceptors with JMX during create().
     int getState()
              Legacy attribute to expose the cache status in terms of the JBoss AS ServiceMBean values.
     String printCacheDetails()
               
     String printCacheDetailsAsHtml()
               
     String printConfigurationAsHtmlString()
               
     String printConfigurationAsString()
               
     String printLockInfo()
               
     String printLockInfoAsHtml()
               
     void setRegisterJmxResource(boolean register)
              Sets whether this object should register the cache's interceptors with JMX during create().
     void start()
               
     void stop()
               
     
    Methods inherited from interface org.jboss.cache.jmx.LegacyConfiguration
    getBuddyReplicationConfig, getCacheLoaderConfig, getCacheLoaderConfiguration, getCacheMode, getClusterConfig, getClusterName, getClusterProperties, getEvictionPolicyConfig, getExposeManagementStatistics, getFetchInMemoryState, getInitialStateRetrievalTimeout, getIsolationLevel, getLockAcquisitionTimeout, getMultiplexerStack, getMuxChannelFactory, getNodeLockingScheme, getReplicationVersion, getReplQueueInterval, getReplQueueMaxElements, getStateRetrievalTimeout, getSyncCommitPhase, getSyncReplTimeout, getSyncRollbackPhase, getTransactionManager, getTransactionManagerLookupClass, getUseInterceptorMbeans, getUseRegionBasedMarshalling, getUseReplQueue, isInactiveOnStartup, setBuddyReplicationConfig, setCacheLoaderConfig, setCacheLoaderConfiguration, setCacheMode, setClusterConfig, setClusterName, setClusterProperties, setEvictionPolicyConfig, setExposeManagementStatistics, setFetchInMemoryState, setInactiveOnStartup, setInitialStateRetrievalTimeout, setIsolationLevel, setLockAcquisitionTimeout, setMultiplexerStack, setMuxChannelFactory, setNodeLockingScheme, setReplicationVersion, setReplQueueInterval, setReplQueueMaxElements, setStateRetrievalTimeout, setSyncCommitPhase, setSyncReplTimeout, setSyncRollbackPhase, setTransactionManager, setTransactionManagerLookupClass, setUseInterceptorMbeans, setUseRegionBasedMarshalling, setUseReplQueue
     

    Field Detail

    STOPPED

    static final int STOPPED
    The lifecycle method stop has completed

    See Also:
    Constant Field Values

    STOPPING

    static final int STOPPING
    The lifecycle method stop has been invoked

    See Also:
    Constant Field Values

    STARTING

    static final int STARTING
    The lifecycle method start has been invoked

    See Also:
    Constant Field Values

    STARTED

    static final int STARTED
    The lifecycle method start has completed

    See Also:
    Constant Field Values

    FAILED

    static final int FAILED
    There has been an error during some operation

    See Also:
    Constant Field Values

    DESTROYED

    static final int DESTROYED
    The lifecycle method destroy has completed

    See Also:
    Constant Field Values

    CREATED

    static final int CREATED
    The lifecycle method create has completed

    See Also:
    Constant Field Values

    UNREGISTERED

    static final int UNREGISTERED
    The MBean has been instantiated but has not completed MBeanRegistration.postRegister

    See Also:
    Constant Field Values

    REGISTERED

    static final int REGISTERED
    The MBean has been instantiated and has completed MBeanRegistration.postRegister

    See Also:
    Constant Field Values
    Method Detail

    create

    void create()
                throws CacheException
    Throws:
    CacheException

    start

    void start()
               throws CacheException
    Throws:
    CacheException

    stop

    void stop()

    destroy

    void destroy()

    getCacheStatus

    CacheStatus getCacheStatus()
    Gets where this object is in its lifecycle transitions.

    Returns:
    the current status. Will not return null

    getState

    int getState()
    Legacy attribute to expose the cache status in terms of the JBoss AS ServiceMBean values. This interface does not extend ServiceMBean, but this attribute is retained to provide compatibility with the JBoss AS JSR-77 integration layer.

    Returns:
    the current status, e.g. STARTED.

    getCache

    Cache<K,V> getCache()
    Retrieves a reference to the underlying Cache


    getConfiguration

    Configuration getConfiguration()
    Returns:
    an immutable configuration

    printConfigurationAsString

    String printConfigurationAsString()
    Returns:
    a string based representation of the configuration

    printConfigurationAsHtmlString

    String printConfigurationAsHtmlString()
    Returns:
    an HTML formatted string based representation of the configuration

    printCacheDetails

    String printCacheDetails()
    Returns:
    details of nodes in the cache

    printCacheDetailsAsHtml

    String printCacheDetailsAsHtml()
    Returns:
    details of nodes in the cache, formatted as HTML

    getLocalAddress

    org.jgroups.Address getLocalAddress()
    Returns the local address of this cache in a cluster, or null if running in local mode.

    Returns:
    the local address of this cache in a cluster, or null if running in local mode.

    getMembers

    List<org.jgroups.Address> getMembers()
    Returns a list of members in the cluster, or null if running in local mode.

    Returns:
    a List of members in the cluster, or null if running in local mode.

    getNumberOfNodes

    int getNumberOfNodes()
    Returns:
    number of nodes in the cache

    getNumberOfAttributes

    int getNumberOfAttributes()
    Returns:
    number of attributes in the cache

    printLockInfo

    String printLockInfo()
    Returns:
    information on the state of node locks

    printLockInfoAsHtml

    String printLockInfoAsHtml()
    Returns:
    information on the state of node locks, formatted as HTML

    getRegisterJmxResource

    boolean getRegisterJmxResource()
    Gets whether this object should register the cache's interceptors with JMX during create().

    Default is true.


    setRegisterJmxResource

    void setRegisterJmxResource(boolean register)
    Sets whether this object should register the cache's interceptors with JMX during create().

    Default is true.



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