ManagementService (Apache Geode 1.5.0)
Date: 2018-03-30

org.apache.geode.management

## Class ManagementService

- java.lang.Object
- - org.apache.geode.management.ManagementService

-     public abstract class ManagementService
      extends java.lang.Object

  Interface to the GemFire management service for a single Cache.
  Since:
    GemFire 7.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ManagementService()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `addMembershipListener(MembershipListener listener)` Registers a listener that receives call backs when a member joins or leaves the distributed system.
    `abstract <T> void` | `federate(javax.management.ObjectName objectName, java.lang.Class<T> interfaceClass, boolean notificationEmitter)` Adds a bean to the list of those being federated, meaning that it's state will be periodically pushed to managing members.
    `abstract javax.management.ObjectName` | `getAsyncEventQueueMBeanName(DistributedMember member, java.lang.String queueId)` Returns the object name of the AsyncEventQueueMBean representing a asynchronous queue.
    `abstract java.util.Set<javax.management.ObjectName>` | `getAsyncEventQueueMBeanNames(DistributedMember member)` Returns the ids of the async event queues on this member
    `abstract javax.management.ObjectName` | `getCacheServerMBeanName(int serverPort, DistributedMember member)` Returns the object name of the CacheServerMBean representing a cache server.
    `abstract javax.management.ObjectName` | `getDiskStoreMBeanName(DistributedMember member, java.lang.String diskName)` Returns the object name of the DiskStoreMBean representing a disk store.
    `abstract javax.management.ObjectName` | `getDistributedLockServiceMBeanName(java.lang.String lockService)` Returns the object name of the DistributedLockServiceMBean representing a lock service.
    `abstract DistributedLockServiceMXBean` | `getDistributedLockServiceMXBean(java.lang.String lockServiceName)` Returns a LockServiceMXBean for managing and monitoring a lock service from a system wide perspective.
    `abstract javax.management.ObjectName` | `getDistributedRegionMBeanName(java.lang.String regionName)` Returns the object name of the DistributedRegionMBean representing a region.
    `abstract DistributedRegionMXBean` | `getDistributedRegionMXBean(java.lang.String regionPath)` Returns a DistributedRegionMXBean for managing and monitoring a region from a system wide perspective.
    `abstract javax.management.ObjectName` | `getDistributedSystemMBeanName()` Returns the object name of the getDistributedSystemMBeanName representing a distributed system.
    `abstract DistributedSystemMXBean` | `getDistributedSystemMXBean()` Returns the DistributedSystemMXBean for managing and monitoring the distributed system as a whole.
    `static ManagementService` | `getExistingManagementService(Cache cache)` Returns the existing instance of the management service for a cache.
    `abstract javax.management.ObjectName` | `getGatewayReceiverMBeanName(DistributedMember member)` Returns the object name of the GatewayReciverMBean representing a gateway receiver.
    `abstract javax.management.ObjectName` | `getGatewaySenderMBeanName(DistributedMember member, java.lang.String gatwaySenderId)` Returns the object name of the GatewaySenderMBean representing a gateway sender.
    `abstract long` | `getLastUpdateTime(javax.management.ObjectName objectName)` Returns the last updated time of the remote MBean as reported by Sysem.currentTimeMillis().
    `abstract AsyncEventQueueMXBean` | `getLocalAsyncEventQueueMXBean(java.lang.String queueId)` Returns a AsyncEventQueueMXBean for managing and monitoring an asynchronous queue.
    `abstract CacheServerMXBean` | `getLocalCacheServerMXBean(int serverPort)` Returns a CacheServerMXBean for managing and monitoring a cache server.
    `abstract DiskStoreMXBean` | `getLocalDiskStoreMBean(java.lang.String diskStoreName)` Returns a DiskStoreMXBean for managing and monitoring a disk store.
    `abstract GatewayReceiverMXBean` | `getLocalGatewayReceiverMXBean()` Returns the GatewayReceiverMXBean for managing and monitoring the gateway receiver.
    `abstract GatewaySenderMXBean` | `getLocalGatewaySenderMXBean(java.lang.String senderId)` Returns a GatewaySenderMXBean for managing and monitoring a gateway sender.
    `abstract LocatorMXBean` | `getLocalLocatorMXBean()` Returns the LocatorMXBean for managing and monitoring the locator.
    `abstract LockServiceMXBean` | `getLocalLockServiceMBean(java.lang.String lockServiceName)` Returns a LockServiceMXBean for managing and monitoring a lock service.
    `abstract RegionMXBean` | `getLocalRegionMBean(java.lang.String regionPath)` Returns a RegionMXBbean for managing and monitoring a Region.
    `abstract javax.management.ObjectName` | `getLocatorMBeanName(DistributedMember member)` Returns the object name of the LocatorMBean representing a locator.
    `abstract javax.management.ObjectName` | `getLockServiceMBeanName(DistributedMember member, java.lang.String lockServiceName)` Returns the object name of the LockServiceMBean representing a lock service.
    `static ManagementService` | `getManagementService(Cache cache)` Returns a newly created or the existing instance of the management service for a cache.
    `abstract javax.management.ObjectName` | `getManagerMBeanName()` Returns the object name of the ManagerMBean representing a manager.
    `abstract ManagerMXBean` | `getManagerMXBean()` Returns the ManagerMXBean for the management service.
    `abstract <T> T` | `getMBeanInstance(javax.management.ObjectName objectName, java.lang.Class<T> interfaceClass)` Returns an instance of an MBean.
    `abstract javax.management.ObjectName` | `getMemberMBeanName(DistributedMember member)` Returns the object name of the MemberMBean representing a distributed member.
    `abstract MemberMXBean` | `getMemberMXBean()` Returns the MemberMXBean for managing and monitoring the local member.
    `abstract javax.management.ObjectName` | `getRegionMBeanName(DistributedMember member, java.lang.String regionPath)` Returns the object name of the RegionMBean representing a region.
    `abstract boolean` | `isManager()` Returns whether this member is running the management service.
    `abstract java.util.Set<javax.management.ObjectName>` | `queryMBeanNames(DistributedMember member)` Returns the object names for all MBeans associated with a member.
    `abstract javax.management.ObjectName` | `registerMBean(java.lang.Object object, javax.management.ObjectName objectName)` Registers an MBean in the GemFire domain.
    `abstract void` | `removeMembershipListener(MembershipListener listener)` Unregisters a membership listener
    `abstract void` | `startManager()` Starts the management service on this member.
    `abstract void` | `stopManager()` Stops the management service running on this member.
    `abstract void` | `unregisterMBean(javax.management.ObjectName objectName)` Unregisters an MBean.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ManagementService

          public ManagementService()

  - ### Method Detail

    - #### getManagementService

          public static ManagementService getManagementService(Cache cache)

      Returns a newly created or the existing instance of the management service for a cache.
      Parameters:
        `cache` - Cache for which to get the management service.

    - #### getExistingManagementService

          public static ManagementService getExistingManagementService(Cache cache)

      Returns the existing instance of the management service for a cache.
      Parameters:
        `cache` - Cache for which to get the management service.
      Returns:
        The existing management service if one exists, null otherwise.

    - #### isManager

          public abstract boolean isManager()

      Returns whether this member is running the management service.
      Returns:
        True if this member is running the management service, false otherwise.

    - #### startManager

          public abstract void startManager()

      Starts the management service on this member.

    - #### stopManager

          public abstract void stopManager()

      Stops the management service running on this member.

    - #### registerMBean

          public abstract javax.management.ObjectName registerMBean(java.lang.Object object,
                                                                    javax.management.ObjectName objectName)

      Registers an MBean in the GemFire domain. Any other domain specified as part of the object will be ignored.
      Parameters:
        `object` - MBean to register.
        `objectName` - Object name of the MBean to register.
      Returns:
        Object name, which may have been modified to use the GemFire domain.

    - #### unregisterMBean

          public abstract void unregisterMBean(javax.management.ObjectName objectName)

      Unregisters an MBean.
      Parameters:
        `objectName` - Object name of the MBean to unregister.

    - #### federate

          public abstract <T> void federate(javax.management.ObjectName objectName,
                                            java.lang.Class<T> interfaceClass,
                                            boolean notificationEmitter)

      Adds a bean to the list of those being federated, meaning that it's state will be periodically pushed to managing members. It's possible to simply register MBeans in the GemFire domain without calling federate if the developer doesn't need their state to be shared amongst members. Note that Dynamic MBeans are not supported by this service.

           Example Usage:

           CustomMXBean bean = new CustomMBean();
           ObjectName beanName = ObjectName.getInstance("DefualtDomain:type=CustomType");
           ObjectName gemfireBeanName = service.registerMBean(customMBean, customMBeanName);
           service.federate(gemfireBeanName, CustomMXBean.class, true);

      Parameters:
        `objectName` - Object name of the MBean.
        `interfaceClass` - Interface which this MBean exposes.
        `notificationEmitter` - True if the MBean is a notification emitter.

    - #### getMemberMXBean

          public abstract MemberMXBean getMemberMXBean()

      Returns the MemberMXBean for managing and monitoring the local member.

    - #### getLocalRegionMBean

          public abstract RegionMXBean getLocalRegionMBean(java.lang.String regionPath)

      Returns a RegionMXBbean for managing and monitoring a Region.
      Parameters:
        `regionPath` - Path of the region.
      Returns:
        A RegionMXBean if the region exists, null otherwise.

    - #### getLocalLockServiceMBean

          public abstract LockServiceMXBean getLocalLockServiceMBean(java.lang.String lockServiceName)

      Returns a LockServiceMXBean for managing and monitoring a lock service.
      Parameters:
        `lockServiceName` - Name of the lock service.
      Returns:
        A LockServiceMXBean if the lock service exists, null otherwise.

    - #### getLocalDiskStoreMBean

          public abstract DiskStoreMXBean getLocalDiskStoreMBean(java.lang.String diskStoreName)

      Returns a DiskStoreMXBean for managing and monitoring a disk store.
      Parameters:
        `diskStoreName` - Name of the disk store.
      Returns:
        A DiskStoreMXBean if the disk store exists, null otherwise.

    - #### getLocalCacheServerMXBean

          public abstract CacheServerMXBean getLocalCacheServerMXBean(int serverPort)

      Returns a CacheServerMXBean for managing and monitoring a cache server.
      Parameters:
        `serverPort` - Port on which the cache server is listening.
      Returns:
        A CacheServerMXBean if the cache server is found, null otherwise.

    - #### getDistributedSystemMXBean

          public abstract DistributedSystemMXBean getDistributedSystemMXBean()

      Returns the DistributedSystemMXBean for managing and monitoring the distributed system as a whole.
      Returns:
        A DistributedSystemMXBean if one is found, null otherwise.

    - #### getManagerMXBean

          public abstract ManagerMXBean getManagerMXBean()

      Returns the ManagerMXBean for the management service.
      Returns:
        A ManagerMXBean if one is found, null otherwise.

    - #### getDistributedRegionMXBean

          public abstract DistributedRegionMXBean getDistributedRegionMXBean(java.lang.String regionPath)

      Returns a DistributedRegionMXBean for managing and monitoring a region from a system wide perspective.
      Parameters:
        `regionPath` - Path of the Region.
      Returns:
        A DistributedRegionMXBean if the region exists, null otherwise.

    - #### getDistributedLockServiceMXBean

          public abstract DistributedLockServiceMXBean getDistributedLockServiceMXBean(java.lang.String lockServiceName)

      Returns a LockServiceMXBean for managing and monitoring a lock service from a system wide perspective.
      Parameters:
        `lockServiceName` - Name of the LockService.
      Returns:
        A DistributedLockServiceMXBean if the lock service exists, null otherwise.

    - #### getLocalGatewayReceiverMXBean

          public abstract GatewayReceiverMXBean getLocalGatewayReceiverMXBean()

      Returns the GatewayReceiverMXBean for managing and monitoring the gateway receiver.
      Returns:
        A GatewayReceiverMXBean if one is found, null otherwise.

    - #### getLocalGatewaySenderMXBean

          public abstract GatewaySenderMXBean getLocalGatewaySenderMXBean(java.lang.String senderId)

      Returns a GatewaySenderMXBean for managing and monitoring a gateway sender.
      Parameters:
        `senderId` - ID of the gateway sender.
      Returns:
        A GatewaySenderMXBean if the gateway sender is found, null otherwise.

    - #### getLocalAsyncEventQueueMXBean

          public abstract AsyncEventQueueMXBean getLocalAsyncEventQueueMXBean(java.lang.String queueId)

      Returns a AsyncEventQueueMXBean for managing and monitoring an asynchronous queue.
      Parameters:
        `queueId` - ID of the asynchronous queue.
      Returns:
        An AsyncEventQueueMXBean if the asynchronous queue is found, null otherwise.

    - #### getLocalLocatorMXBean

          public abstract LocatorMXBean getLocalLocatorMXBean()

      Returns the LocatorMXBean for managing and monitoring the locator.
      Returns:
        A LocatorMXBean if the locator is found, null otherwise.

    - #### queryMBeanNames

          public abstract java.util.Set<javax.management.ObjectName> queryMBeanNames(DistributedMember member)

      Returns the object names for all MBeans associated with a member.
      Parameters:
        `member` - Member for which to find MBeans.

    - #### getAsyncEventQueueMBeanNames

          public abstract java.util.Set<javax.management.ObjectName> getAsyncEventQueueMBeanNames(DistributedMember member)

      Returns the ids of the async event queues on this member

    - #### getMBeanInstance

          public abstract <T> T getMBeanInstance(javax.management.ObjectName objectName,
                                                 java.lang.Class<T> interfaceClass)

      Returns an instance of an MBean. This is a reference to the MBean instance and not a `ObjectInstance`.
      Parameters:
        `objectName` - Object name of the MBean.
        `interfaceClass` - Interface which this MBean exposes.
      Throws:
        `java.lang.ClassCastException` - if the MBean does not implement the given interface.

    - #### getLastUpdateTime

          public abstract long getLastUpdateTime(javax.management.ObjectName objectName)

      Returns the last updated time of the remote MBean as reported by Sysem.currentTimeMillis().
      Parameters:
        `objectName` - Object name of the MBean.
      Returns:
        Last updated time or 0 if the MBean is local or the management service is not running on this member.

    - #### getMemberMBeanName

          public abstract javax.management.ObjectName getMemberMBeanName(DistributedMember member)

      Returns the object name of the MemberMBean representing a distributed member. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.

    - #### getRegionMBeanName

          public abstract javax.management.ObjectName getRegionMBeanName(DistributedMember member,
                                                                         java.lang.String regionPath)

      Returns the object name of the RegionMBean representing a region. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `regionPath` - Path of the region.

    - #### getDiskStoreMBeanName

          public abstract javax.management.ObjectName getDiskStoreMBeanName(DistributedMember member,
                                                                            java.lang.String diskName)

      Returns the object name of the DiskStoreMBean representing a disk store. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `diskName` - Name of the disk store.

    - #### getCacheServerMBeanName

          public abstract javax.management.ObjectName getCacheServerMBeanName(int serverPort,
                                                                              DistributedMember member)

      Returns the object name of the CacheServerMBean representing a cache server. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `serverPort` - Port on which the cache server is listening.

    - #### getLockServiceMBeanName

          public abstract javax.management.ObjectName getLockServiceMBeanName(DistributedMember member,
                                                                              java.lang.String lockServiceName)

      Returns the object name of the LockServiceMBean representing a lock service. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `lockServiceName` - Name of the lock service.

    - #### getGatewayReceiverMBeanName

          public abstract javax.management.ObjectName getGatewayReceiverMBeanName(DistributedMember member)

      Returns the object name of the GatewayReciverMBean representing a gateway receiver. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.

    - #### getGatewaySenderMBeanName

          public abstract javax.management.ObjectName getGatewaySenderMBeanName(DistributedMember member,
                                                                                java.lang.String gatwaySenderId)

      Returns the object name of the GatewaySenderMBean representing a gateway sender. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `gatwaySenderId` - ID of the gateway sender.

    - #### getAsyncEventQueueMBeanName

          public abstract javax.management.ObjectName getAsyncEventQueueMBeanName(DistributedMember member,
                                                                                  java.lang.String queueId)

      Returns the object name of the AsyncEventQueueMBean representing a asynchronous queue. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.
        `queueId` - ID of the asynchronous queue.

    - #### getDistributedRegionMBeanName

          public abstract javax.management.ObjectName getDistributedRegionMBeanName(java.lang.String regionName)

      Returns the object name of the DistributedRegionMBean representing a region. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `regionName` - Name of the region.

    - #### getDistributedLockServiceMBeanName

          public abstract javax.management.ObjectName getDistributedLockServiceMBeanName(java.lang.String lockService)

      Returns the object name of the DistributedLockServiceMBean representing a lock service. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `lockService` - Name of the lock service.

    - #### getDistributedSystemMBeanName

          public abstract javax.management.ObjectName getDistributedSystemMBeanName()

      Returns the object name of the getDistributedSystemMBeanName representing a distributed system. This is a utility method for generating an object name and it does not register an MBean.

    - #### getManagerMBeanName

          public abstract javax.management.ObjectName getManagerMBeanName()

      Returns the object name of the ManagerMBean representing a manager. This is a utility method for generating an object name and it does not register an MBean.

    - #### getLocatorMBeanName

          public abstract javax.management.ObjectName getLocatorMBeanName(DistributedMember member)

      Returns the object name of the LocatorMBean representing a locator. This is a utility method for generating an object name and it does not register an MBean.
      Parameters:
        `member` - Distributed member used to generate the object name.

    - #### addMembershipListener

          public abstract void addMembershipListener(MembershipListener listener)

      Registers a listener that receives call backs when a member joins or leaves the distributed system.

    - #### removeMembershipListener

          public abstract void removeMembershipListener(MembershipListener listener)

      Unregisters a membership listener
      See Also:
        `addMembershipListener(org.apache.geode.management.membership.MembershipListener)`