Class AbstractMBeanForwarder

java.lang.Object
org.jppf.management.forwarding.AbstractMBeanForwarder
Direct Known Subclasses:
DiagnosticsMBeanForwarder, JPPFNodeAdminMBeanForwarder, JPPFNodeMaintenanceMBeanForwarder, JPPFNodeProvisioningMBeanForwarder, JPPFNodeTaskMonitorMBeanForwarder, NodeConfigNotifierMBeanForwarder

public class AbstractMBeanForwarder extends Object
Abstrat super class for generated node MBean forwarding proxies.
Since:
6.2
Author:
Laurent Cohen
  • Constructor Details

    • AbstractMBeanForwarder

      public AbstractMBeanForwarder(JMXDriverConnectionWrapper jmx, String mbeanName) throws Exception
      Initialize this forwarding proxy with the specified driver jmx connection and mbean name.
      Parameters:
      jmx - a wrapper for the JMX connection to the driver.
      mbeanName - the name of the mbean to proxy for.
      Throws:
      Exception - if any error occurs.
  • Method Details

    • invoke

      public <E> ResultsMap<String,E> invoke(NodeSelector selector, String methodName, Object[] params, String[] signature) throws Exception
      Invoke a method on the specified MBean of the selected nodes attached to the driver.
      Type Parameters:
      E - the type of results.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      methodName - the name of the method to invoke.
      params - the method parameter values.
      signature - the types of the method parameters.
      Returns:
      a mapping of node uuids to the result of invoking the MBean method on the corresponding node. Each result may be an exception.
      Additionally, each result may be null, in particular if the invoked method has a void return type.
      Throws:
      Exception - if the invocation failed.
    • invoke

      public <E> ResultsMap<String,E> invoke(NodeSelector selector, String methodName) throws Exception
      Convenience method to invoke an MBean method that has no parameter.
      This is equivalent to calling forwardInvoke(selector, name, methodName, (Object[]) null, (String[]) null).
      Type Parameters:
      E - the type of results.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      methodName - the name of the method to invoke.
      Returns:
      a mapping of node uuids to the result of invoking the MBean method on the corresponding node. Each result may be an exception.
      Additionally, each result may be null, in particular if the invoked method has a void return type.
      Throws:
      Exception - if the invocation failed.
    • getAttribute

      public <E> ResultsMap<String,E> getAttribute(NodeSelector selector, String attribute) throws Exception
      Get the value of an attribute of the specified MBean for each specified node.
      Type Parameters:
      E - the type of results.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      attribute - the name of the MBean attribute to read.
      Returns:
      a mapping of node uuids to the result of getting the MBean attribute on the corresponding node. Each result may be an exception.
      Throws:
      Exception - if the invocation failed.
    • setAttribute

      public <E> ResultsMap<String,Void> setAttribute(NodeSelector selector, String attribute, E value) throws Exception
      Set the value of an attribute of the specified MBean on the specified nodes attached to the driver.
      Type Parameters:
      E - the type of the value to set.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      attribute - the name of the MBean attribute to set.
      value - the value to set on the attribute.
      Returns:
      a mapping of node uuids to an eventual exception resulting from setting the MBean attribute on the corresponding node.
      Throws:
      Exception - if the invocation failed.
    • addNotificationListener

      public String addNotificationListener(NodeSelector selector, NotificationListener listener) throws Exception
      Add a listener to the MBean for all selected nodes, without filter or handback object.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      listener - The listener object which will handle the notifications emitted by the broadcaster.
      Returns:
      a string which uniquely identifies the registered notification listener.
      Throws:
      Exception - if any error occurs.
    • addNotificationListener

      public String addNotificationListener(NodeSelector selector, NotificationListener listener, NotificationFilter filter, Object handback) throws Exception
      Add a listener to the MBean for all selected nodes.
      Parameters:
      selector - a filter on the nodes attached to the driver, determines the nodes this method applies to.
      listener - The listener object which will handle the notifications emitted by the broadcaster.
      filter - The filter object. If filter is null, no filtering occurs.
      handback - An opaque object to be sent back to the listener when a notification is emitted
      Returns:
      a string which uniquely identifies the registered notification listener.
      Throws:
      Exception - if any error occurs.
    • removeNotificationListener

      public void removeNotificationListener(String listenerID) throws Exception
      Remove a listener from this MBean forwarder.
      Parameters:
      listenerID - a string which uniquely identifies the notification listener to remove.
      Throws:
      Exception - if any error occurs.
    • removeAllNotificationListeners

      public void removeAllNotificationListeners() throws Exception
      Remove all listeners registered from this MBean forwarder.
      Throws:
      Exception - if any error occurs.