Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Code Block
languagejava
public class ManagementService {
  /**
   * It will a singleton instance across a Cache. This instance will
   * act as th einterface between user and GemFire Management.
   * 
   * @param Cache
   * @return ManagementService
   */
  public static ManagementService getManagementService(Cache cache) {
  }
  /**
   * This will register the MBean in default GemFire domain.
   * Any MBean which wishes to register itself in Gemfire
   * domain should use this method.
   * Note: The ObjectName will be modified here. Hence returning the
   * modified ObjectName.
   */
  public ObjectName registerMBean(Object object, ObjectName objectName) {
  }
  /**
   * For consistency and clean up of GemFire resources
   * use this method to unregister the MBean from GemFire Domain
   */
  public void unregisterMBean(ObjectName objectName) {
  }
  /**
   * This method is used to mark an MBean for federation.
   * 
   * Users may want to only register their MBean in GemFire domain. In that
   * case they don't have to call federate();
   * 
   * @param <T>
   * @param name MBean name
   * @param interfaceClass MBean interface class
   * @param notificationEmitter is the MBean a notification emitter
   * @return
   */
  public <T> boolean federate(ObjectName name, Class<T> interfaceClass, boolean notificationEmitter) {
  }
  /**
   * This method is used to process a command
   * This takes an String is a parameter.
   * 
   * @param commandString
   * @return
   */
  public Object processComand(String commandString) {
  }
  /**
   * Interfaces to get all GemFire specific MBeans
   *
   */
  public RegionMXBean getLocalRegionMXBean(Region region) {
  }
  public LockServiceMXBean getLocalLockServiceMXBean(String name){
  }
  ........
}

 

  • APIs useful for MBean Federation

Usage:

Code Block
languagejava
MyCustomMXBean myMbean = new MyCustomMBean();
ManagementService service = ManagementService.getManagementService(cache); 


//To register in Gemfire domain
// GemFire will modify the given ObjectName to append memberName
ObjectName newObjectName service.register(myMbean, name);


/**
 * To allow MyCustomMBean to be federated 
 */
service.federate(newObjectName, MyCustomMXBean.class, false);

 

  • APIs useful at Managed Node

     

    Code Block
    languagejava
    Foo
    Code Block
    languagejava
    public class ManagementService {
      /**
       * It will a singleton instance across a Cache. This instance will
       * act as the interface between user and GemFire Management.
       * 
       * @param Cache
       * @return ManagementService
       */
      public static ManagementService getManagementService(Cache cache) {
      }
      /**
       * This will register the MBean in default GemFire domain.
       * Any MBean which wishes to register itself in Gemfire
       * domain should use this method.
       * Note: The ObjectName will be modified here. Hence returning the
       * modified ObjectName.
       */
      public ObjectName registerMBean(Object object, ObjectName objectName) {
      }
      /**
       * For consistency and clean up of GemFire resources
       * use this method to unregister the MBean from GemFire Domain
       */
      public void unregisterMBean(ObjectName objectName) {
      }
      /**
       * This method is used to mark an MBean for federation.
       * 
       * Users may want to only register their MBean in GemFire domain. In that
       * case they don't have to call federate();
       * 
       * @param <T>
       * @param name MBean name
       * @param interfaceClass MBean interface class
       * @param notificationEmitter is the MBean a notification emitter
       */
      public <T> boolean federate(ObjectName name, Class<T> interfaceClass, boolean notificationEmitter) {
      }
      /**
       * This method is used to process a command
       * This takes an String is a parameter.
       * 
       * @param commandString
       * @return
       */
      public Object processComand(String commandString) {
      }
      /**
       * Interfaces to get all GemFire specific MBeans
       *
       */
      public RegionMXBean getLocalRegionMXBean(Region region) {
      }
      public LockServiceMXBean getLocalLockServiceMXBean(String name){
      }
      ........
    }
  • APIs useful for MBean Federation

    Usage : 

     

    Code Block
    languagejava
    MyCustomMXBean myMbean = new MyCustomMBean();
    ManagementService service = ManagementService.getManagementService(cache); 
    
    //To register in Gemfire domain
    // GemFire will modify the given ObjectName to append memberName
    ObjectName newObjectName service.register(myMbean, name);
    
    /**
     * To allow MyCustomMBean to be federated 
     */
    service.federate(newObjectName, MyCustomMXBean.class, false);

...