ManagementService (Apache Geode 1.15.4)

org.apache.geode.management

## Class ManagementService

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

-     public abstract class ManagementService
      extends 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(ObjectName objectName, 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 ObjectName` | `getAsyncEventQueueMBeanName(DistributedMember member, String queueId)` Returns the object name of the AsyncEventQueueMBean representing an asynchronous queue.
    `abstract Set<ObjectName>` | `getAsyncEventQueueMBeanNames(DistributedMember member)` Returns the ids of the async event queues on this member
    `abstract ObjectName` | `getCacheServerMBeanName(int serverPort, DistributedMember member)` Returns the object name of the CacheServerMBean representing a cache server.
    `abstract ObjectName` | `getDiskStoreMBeanName(DistributedMember member, String diskName)` Returns the object name of the DiskStoreMBean representing a disk store.
    `abstract ObjectName` | `getDistributedLockServiceMBeanName(String lockService)` Returns the object name of the DistributedLockServiceMBean representing a lock service.
    `abstract DistributedLockServiceMXBean` | `getDistributedLockServiceMXBean(String lockServiceName)` Returns a LockServiceMXBean for managing and monitoring a lock service from a system wide perspective.
    `abstract ObjectName` | `getDistributedRegionMBeanName(String regionName)` Returns the object name of the DistributedRegionMBean representing a region.
    `abstract DistributedRegionMXBean` | `getDistributedRegionMXBean(String regionPath)` Returns a DistributedRegionMXBean for managing and monitoring a region from a system wide perspective.
    `abstract ObjectName` | `getDistributedSystemMBeanName()` Returns the object name of the DistributedSystemMBean 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 ObjectName` | `getGatewayReceiverMBeanName(DistributedMember member)` Returns the object name of the GatewayReceiverMBean representing a gateway receiver.
    `abstract ObjectName` | `getGatewaySenderMBeanName(DistributedMember member, String gatwaySenderId)` Returns the object name of the GatewaySenderMBean representing a gateway sender.
    `abstract long` | `getLastUpdateTime(ObjectName objectName)` Returns the last updated time of the remote MBean as reported by Sysem.currentTimeMillis().
    `abstract AsyncEventQueueMXBean` | `getLocalAsyncEventQueueMXBean(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(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(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(String lockServiceName)` Returns a LockServiceMXBean for managing and monitoring a lock service.
    `abstract RegionMXBean` | `getLocalRegionMBean(String regionPath)` Returns a RegionMXBbean for managing and monitoring a Region.
    `abstract ObjectName` | `getLocatorMBeanName(DistributedMember member)` Returns the object name of the LocatorMBean representing a locator.
    `abstract ObjectName` | `getLockServiceMBeanName(DistributedMember member, 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 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(ObjectName objectName, Class<T> interfaceClass)` Returns an instance of an MBean.
    `abstract 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 ObjectName` | `getRegionMBeanName(DistributedMember member, 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 Set<ObjectName>` | `queryMBeanNames(DistributedMember member)` Returns the object names for all MBeans associated with a member.
    `abstract ObjectName` | `registerMBean(Object object, 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(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.
      Returns:
        a newly created or the existing instance of the management service for a cache

    - #### 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 ObjectName registerMBean(Object object,
                                                   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(ObjectName objectName)

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

    - #### federate

          public abstract <T> void federate(ObjectName objectName,
                                            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);

      Type Parameters:
        `T` - the type of MBean
      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.
      Returns:
        the MemberMXBean for managing and monitoring the local member

    - #### getLocalRegionMBean

          public abstract RegionMXBean getLocalRegionMBean(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(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(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(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(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(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(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 Set<ObjectName> queryMBeanNames(DistributedMember member)

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

    - #### getAsyncEventQueueMBeanNames

          public abstract Set<ObjectName> getAsyncEventQueueMBeanNames(DistributedMember member)

      Returns the ids of the async event queues on this member
      Parameters:
        `member` - Member for which to find MBeans.
      Returns:
        the ids of the async event queues on this member

    - #### getMBeanInstance

          public abstract <T> T getMBeanInstance(ObjectName objectName,
                                                 Class<T> interfaceClass)

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

    - #### getLastUpdateTime

          public abstract long getLastUpdateTime(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 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.
      Returns:
        the object name of the MemberMBean representing a distributed member

    - #### getRegionMBeanName

          public abstract ObjectName getRegionMBeanName(DistributedMember member,
                                                        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.
      Returns:
        the object name of the RegionMBean representing a region

    - #### getDiskStoreMBeanName

          public abstract ObjectName getDiskStoreMBeanName(DistributedMember member,
                                                           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.
      Returns:
        the object name of the DiskStoreMBean representing a disk store

    - #### getCacheServerMBeanName

          public abstract 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.
      Returns:
        the object name of the CacheServerMBean representing a cache server

    - #### getLockServiceMBeanName

          public abstract ObjectName getLockServiceMBeanName(DistributedMember member,
                                                             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.
      Returns:
        the object name of the LockServiceMBean representing a lock service

    - #### getGatewayReceiverMBeanName

          public abstract ObjectName getGatewayReceiverMBeanName(DistributedMember member)

      Returns the object name of the GatewayReceiverMBean 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.
      Returns:
        the object name of the GatewayReceiverMBean representing a gateway receiver

    - #### getGatewaySenderMBeanName

          public abstract ObjectName getGatewaySenderMBeanName(DistributedMember member,
                                                               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.
      Returns:
        the object name of the GatewaySenderMBean representing a gateway sender

    - #### getAsyncEventQueueMBeanName

          public abstract ObjectName getAsyncEventQueueMBeanName(DistributedMember member,
                                                                 String queueId)

      Returns the object name of the AsyncEventQueueMBean representing an 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.
      Returns:
        the object name of the AsyncEventQueueMBean representing an asynchronous queue

    - #### getDistributedRegionMBeanName

          public abstract ObjectName getDistributedRegionMBeanName(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.
      Returns:
        the object name of the DistributedRegionMBean representing a region

    - #### getDistributedLockServiceMBeanName

          public abstract ObjectName getDistributedLockServiceMBeanName(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.
      Returns:
        the object name of the DistributedLockServiceMBean representing a lock service

    - #### getDistributedSystemMBeanName

          public abstract ObjectName getDistributedSystemMBeanName()

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

    - #### getManagerMBeanName

          public abstract 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.
      Returns:
        the object name of the ManagerMBean representing a manager

    - #### getLocatorMBeanName

          public abstract 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.
      Returns:
        the object name of the LocatorMBean representing a locator

    - #### addMembershipListener

          public abstract void addMembershipListener(MembershipListener listener)

      Registers a listener that receives call backs when a member joins or leaves the distributed system.
      Parameters:
        `listener` - the membership listener to register

    - #### removeMembershipListener

          public abstract void removeMembershipListener(MembershipListener listener)

      Unregisters a membership listener
      Parameters:
        `listener` - the membership listener to unregister
      See Also:
        `addMembershipListener(org.apache.geode.management.membership.MembershipListener)`