GemFire 7.0

com.gemstone.gemfire.management
Class ManagementService

java.lang.Object
  extended by com.gemstone.gemfire.management.ManagementService

public abstract class ManagementService
extends Object

This class is the gateway to GemFire Management service. User of this service has to pass the Cache reference to obtain a handle to this service. A ManagementService instance will execute all the methods in the same VM.

Since:
7.0

Constructor Summary
ManagementService()
           
 
Method Summary
abstract
<T> void
federate(ObjectName objectName, Class<T> interfaceClass, boolean notificationEmitter)
          This method is used to mark an MBean for federation.
abstract  ObjectName getAsyncEventQueueMBeanName(DistributedMember member, String queueId)
          This will return a JMX ObjectName representing given AsyncEventQueueMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ObjectName getCacheServerMBeanName(int serverPort, DistributedMember member)
          This will return a JMX ObjectName representing given port This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ObjectName getDiskStoreMBeanName(DistributedMember member, String diskName)
          This will return a JMX ObjectName representing given DiskStoreMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ObjectName getDistributedLockServiceMBeanName(String lockService)
          This will return a JMX ObjectName representing given lock service.
abstract  DistributedLockServiceMXBean getDistributedLockServiceMXBean(String lockServiceName)
          System wide view of a particular lock service.
abstract  ObjectName getDistributedRegionMBeanName(String regionName)
          This will return a JMX ObjectName representing given DistributedRegionMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  DistributedRegionMXBean getDistributedRegionMXBean(String regionPath)
          DistributedRegionMXBean represents a system wide view of a particular region.
abstract  ObjectName getDistributedSystemMBeanName()
          This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  DistributedSystemMXBean getDistributedSystemMXBean()
          Returns null if MBean not present.
static ManagementService getExistingManagementService(Cache cache)
          Returns null if no management service exists
abstract  ObjectName getGatewayReceiverMBeanName(DistributedMember member)
          This will return a JMX ObjectName representing given GatewayReceiverMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ObjectName getGatewaySenderMBeanName(DistributedMember member, String gatwaySenderId)
          This will return a JMX ObjectName representing given GatewaySenderMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  long getLastUpdateTime(ObjectName objectName)
          This will return the last updated time of the Remote MBean If the ObjectName is of a local MBean it will return 0 value.
abstract  AsyncEventQueueMXBean getLocalAsyncEventQueueMXBean(String queueId)
           
abstract  CacheServerMXBean getLocalCacheServerMXBean(int serverPort)
          Returns a reference to a CacheServerMBean for the given port.
abstract  DiskStoreMXBean getLocalDiskStoreMBean(String diskStoreName)
          Returns LocalDiskStoreMBean corresponding to the DiskStore name Returns null if MBean not present.
abstract  GatewayReceiverMXBean getLocalGatewayReceiverMXBean()
           
abstract  GatewaySenderMXBean getLocalGatewaySenderMXBean(String senderId)
           
abstract  LocatorMXBean getLocalLocatorMXBean()
           
abstract  LockServiceMXBean getLocalLockServiceMBean(String lockServiceName)
          Returns an instance of LocalLockServiceMBean corresponding to the Lock service name.
abstract  RegionMXBean getLocalRegionMBean(String regionPath)
          Returns an instance of RegionMBen corresponding to the Region path.
abstract  ObjectName getLocatorMBeanName(DistributedMember member)
          This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ObjectName getLockServiceMBeanName(DistributedMember member, String lockServiceName)
          This will return a JMX ObjectName representing given LockServiceMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
static ManagementService getManagementService(Cache cache)
          Returns a ManagementService to use for the specified Cache.
abstract  ObjectName getManagerMBeanName()
          This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.
abstract  ManagerMXBean getManagerMXBean()
          Returns null if MBean not present.
abstract
<T> T
getMBeanInstance(ObjectName objectName, Class<T> interfaceClass)
          The method will return the MBean instance represented by the ObjectName.
abstract  ObjectName getMemberMBeanName(DistributedMember member)
          This will return a JMX ObjectName representing MemberMBean of a Member.
abstract  MemberMXBean getMemberMXBean()
          Returns MemberMBean which represents the local DistributedMember.
abstract  ObjectName getRegionMBeanName(DistributedMember member, String regionPath)
          This will return a JMX ObjectName representing given RegionMBean.
abstract  boolean isManager()
           
abstract  Set<ObjectName> queryMBeanNames(DistributedMember member)
          Returns a Set of MBeans registered in GemFire domain in a particular member.
abstract  ObjectName registerMBean(Object object, ObjectName objectName)
          This method will register an MBean in GemFire domain.
abstract  void startManager()
          This method will be invoked whenever a member wants to be a managing node.
abstract  void stopManager()
          This method will be invoked whenever a member stops being a managing node.
abstract  void unregisterMBean(ObjectName objectName)
          This method will unregister the MBean from GemFire Domain
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagementService

public ManagementService()
Method Detail

getManagementService

public static ManagementService getManagementService(Cache cache)
Returns a ManagementService to use for the specified Cache.

Parameters:
cache - defines the scope of resources to be managed

getExistingManagementService

public static ManagementService getExistingManagementService(Cache cache)
Returns null if no management service exists


isManager

public abstract boolean isManager()
Returns:
whether this is a Managing node or not

startManager

public abstract void startManager()
This method will be invoked whenever a member wants to be a managing node. The exception Management exception has to be handled by the caller.


stopManager

public abstract void stopManager()
This method will be invoked whenever a member stops being a managing node. The exception Management exception has to be handled by the caller.


registerMBean

public abstract ObjectName registerMBean(Object object,
                                         ObjectName objectName)
This method will register an MBean in GemFire domain. Even if the client provides a domain name it will be ignored and GemFire domain name will be used. The return ObjectName will be the modified ObjectName .

Parameters:
object - MBean Instance
objectName - ObjectName of the MBean
Returns:
objectName newly created MBean name

unregisterMBean

public abstract void unregisterMBean(ObjectName objectName)
This method will unregister the MBean from GemFire Domain

Parameters:
objectName - ObjectName of the MBean

federate

public abstract <T> void federate(ObjectName objectName,
                                  Class<T> interfaceClass,
                                  boolean notificationEmitter)
This method is used to mark an MBean for federation. State of the Bean will be pushed to Managing Node periodically. Users may want to only register their MBean in GemFire domain. In that case they don't have to call federate(); Note; Dynamic MBean is not supported in this service Usage : CustomMXBean customMBean = new CustomMBean(); ObjectName customMBeanName = ObjectName.getInstance("DefualtDomain:type=CustomType"); ObjectName changedObjectName = service.registerMBean(customMBean, customMBeanName); service.federate(changedObjectName, CustomMXBean.class, true);

Parameters:
objectName - ObjectName of the MBean
interfaceClass - MBean interface class
notificationEmitter - is the MBean a notification emitter

getMemberMXBean

public abstract MemberMXBean getMemberMXBean()
Returns MemberMBean which represents the local DistributedMember. Returns null if MBean not present.

Returns:
reference to local MemberMXBean

getLocalRegionMBean

public abstract RegionMXBean getLocalRegionMBean(String regionPath)
Returns an instance of RegionMBen corresponding to the Region path. If no RegionMBean found with the specified path it will return null;

Parameters:
regionPath - Region Path of the Local Region instance
Returns:
reference to local RegionMXBean

getLocalLockServiceMBean

public abstract LockServiceMXBean getLocalLockServiceMBean(String lockServiceName)
Returns an instance of LocalLockServiceMBean corresponding to the Lock service name. Returns null if MBean not present.

Parameters:
lockServiceName - Name of the LockService
Returns:
reference to given LockServiceMXBean

getLocalDiskStoreMBean

public abstract DiskStoreMXBean getLocalDiskStoreMBean(String diskStoreName)
Returns LocalDiskStoreMBean corresponding to the DiskStore name Returns null if MBean not present.

Parameters:
diskStoreName - Name of the DiskStore
Returns:
reference to given DiskStoreMXBean

getLocalCacheServerMXBean

public abstract CacheServerMXBean getLocalCacheServerMXBean(int serverPort)
Returns a reference to a CacheServerMBean for the given port. Returns null if MBean not present.

Parameters:
serverPort - port of the cache server
Returns:
reference to given CacheServerMXBean

getDistributedSystemMXBean

public abstract DistributedSystemMXBean getDistributedSystemMXBean()
Returns null if MBean not present.

Returns:
reference to the DistributedSystemMXBean

getManagerMXBean

public abstract ManagerMXBean getManagerMXBean()
Returns null if MBean not present.

Returns:
reference to the ManagerMXBean

getDistributedRegionMXBean

public abstract DistributedRegionMXBean getDistributedRegionMXBean(String regionPath)
DistributedRegionMXBean represents a system wide view of a particular region. Returns null if MBean not present.

Parameters:
regionPath - regionPath
Returns:
reference to a DistributedSystemMXBean

getDistributedLockServiceMXBean

public abstract DistributedLockServiceMXBean getDistributedLockServiceMXBean(String lockServiceName)
System wide view of a particular lock service.

Parameters:
lockServiceName -
Returns:
reference to a DistributedLockServiceMXBean

getLocalGatewayReceiverMXBean

public abstract GatewayReceiverMXBean getLocalGatewayReceiverMXBean()
Returns:
reference to local GatewayReceiverMXBean

getLocalGatewaySenderMXBean

public abstract GatewaySenderMXBean getLocalGatewaySenderMXBean(String senderId)
Parameters:
senderId - id of the GatewaySender
Returns:
reference to local GatewaySenderMXBean corresponding to the sender ID

getLocalAsyncEventQueueMXBean

public abstract AsyncEventQueueMXBean getLocalAsyncEventQueueMXBean(String queueId)
Parameters:
queueId - id of the AsyncEventQueue
Returns:
reference to local AsyncEventQueueMXBean corresponding to the Queue ID

getLocalLocatorMXBean

public abstract LocatorMXBean getLocalLocatorMXBean()
Returns:
Returns a local locator MBean interface corresponding to the port

queryMBeanNames

public abstract Set<ObjectName> queryMBeanNames(DistributedMember member)
Returns a Set of MBeans registered in GemFire domain in a particular member.

Parameters:
member - DistributedMember
Returns:
Set of ObjectName of the MBean ObjectNames for a given node

getMBeanInstance

public abstract <T> T getMBeanInstance(ObjectName objectName,
                                       Class<T> interfaceClass)
The method will return the MBean instance represented by the ObjectName. It will be an actual reference to the MBean instance rather than an ObjectInstance. If the MBean interface does not implement the given interface class a ClassCastException. will be thrown

Parameters:
objectName - ObjectName of the MBean
interfaceClass - Interface class to which the MBean has been exposed
Returns:
instance of the MBean

getLastUpdateTime

public abstract long getLastUpdateTime(ObjectName objectName)
This will return the last updated time of the Remote MBean If the ObjectName is of a local MBean it will return 0 value. This method is supposed to work for federated MBeans on Manager node. If a node is not a manager node it will return a 0 value.

Parameters:
objectName - ObjectName of the MBean
Returns:
last updated time as per System.currentTimeInMillis() format

getMemberMBeanName

public abstract ObjectName getMemberMBeanName(DistributedMember member)
This will return a JMX ObjectName representing MemberMBean of a Member. This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
Returns:
Object Name of the MBean representing the member specified by the member Id

getRegionMBeanName

public abstract ObjectName getRegionMBeanName(DistributedMember member,
                                              String regionPath)
This will return a JMX ObjectName representing given RegionMBean. This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
regionPath - full Path of the region
Returns:
Object Name of the RegionMBean which represents the given region

getDiskStoreMBeanName

public abstract ObjectName getDiskStoreMBeanName(DistributedMember member,
                                                 String diskName)
This will return a JMX ObjectName representing given DiskStoreMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
diskName - name of the disk store
Returns:
Object Name of the DiskStoreMBean which represents the given disk store

getCacheServerMBeanName

public abstract ObjectName getCacheServerMBeanName(int serverPort,
                                                   DistributedMember member)
This will return a JMX ObjectName representing given port This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
serverPort - cache server port which acts as an unique identified for cache servers in a given VM
member - distributed member
Returns:
Object Name of the CacheServerMBean which is hosted on the given member

getLockServiceMBeanName

public abstract ObjectName getLockServiceMBeanName(DistributedMember member,
                                                   String lockServiceName)
This will return a JMX ObjectName representing given LockServiceMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
lockServiceName - lock service name
Returns:
Object Name of the LockServiceMBean which represents the given lock service

getGatewayReceiverMBeanName

public abstract ObjectName getGatewayReceiverMBeanName(DistributedMember member)
This will return a JMX ObjectName representing given GatewayReceiverMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
Returns:
Object Name of the GatewayReceiverMBean which is hosted on the given member

getGatewaySenderMBeanName

public abstract ObjectName getGatewaySenderMBeanName(DistributedMember member,
                                                     String gatwaySenderId)
This will return a JMX ObjectName representing given GatewaySenderMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
gatwaySenderId - gateway sender id
Returns:
Object Name of the GatewaySenderMBean which represents the given GatewaySender Id

getAsyncEventQueueMBeanName

public abstract ObjectName getAsyncEventQueueMBeanName(DistributedMember member,
                                                       String queueId)
This will return a JMX ObjectName representing given AsyncEventQueueMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
queueId - Async Event Queue Id
Returns:
Object Name of the AsyncEventQueueMBean which represents the given queue Id

getDistributedRegionMBeanName

public abstract ObjectName getDistributedRegionMBeanName(String regionName)
This will return a JMX ObjectName representing given DistributedRegionMBean This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
regionName - name of the region
Returns:
Object Name of the DistributedRegionMBean which represents the given region name

getDistributedLockServiceMBeanName

public abstract ObjectName getDistributedLockServiceMBeanName(String lockService)
This will return a JMX ObjectName representing given lock service. This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
lockService - name of the lock service
Returns:
Object Name of the DistributedLockServiceMBean which represents the given lock service name

getDistributedSystemMBeanName

public abstract ObjectName getDistributedSystemMBeanName()
This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Returns:
Object name of the DistributedSystemMBean

getManagerMBeanName

public abstract ObjectName getManagerMBeanName()
This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Returns:
Object name of the ManagerMBean

getLocatorMBeanName

public abstract ObjectName getLocatorMBeanName(DistributedMember member)
This is just an utility method to construct ObjectName .Successful execution of method does not mean the MBean is registered.

Parameters:
member - distributed member
Returns:
ObjectName of the locator MBean

GemFire 7.0

Copyright © 1997-2012 VMware, Inc. All rights reserved.