JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   Forums 

Pluggable MBeanServerForwarder

From JPPF 5.2 Documentation

Jump to: navigation, search
Main Page > Extending and Customizing JPPF > Pluggable MBeanServerForwarder

JPPF provides the ability to set an MBeanServerForwarder on all JMX remote servers created by the drivers and nodes. This can be used, for example, to implement an authorization mechanism that will grant or deny access to operations on the MBeans.

A forwarder implements the MBeanServerForwarder interface and is declared in a driver's or node's configuration file as follows:

jppf.management.server.forwarder = my.forwarder.Implementation param1 ... paramN

The value of the property is a set of space-separated strings, where the first string is the fully qualified class name of an implementation of MBeanServerForwarder, and the remaining strings are optional parameters passed on to the forwarder at construction time.

For the parameters to be passed on, the forwarder must also implement either of:

  • a constructor that takes a String[] argument
  • a setParameters(String[]) method

If both are implemented, then only the constructor will be used. If none is implemented, then no parameter will be passed, even if they are declared in the configuration. Additionally, a no-arg constructor is then expected.

In practice, it may be more convenient to extend the class MBeanServerForwarderAdapter, which implements all the methods of the MBeanServerForwarder interface and merely delegates to the underlying MBeanServer if it has been set. It also provides a getter and setter for the parameters, so you don't have to implement a setParameters(String[]) method either:

public class MBeanServerForwarderAdapter implements MBeanServerForwarder {
  // Set the parameters defined in the configuration, if any
  public void setParameters(final String[] parameters)

  // Get the parameters defined in the configuration, if any
  public String[] getParameters()

  // ... methods from the MBeanServerForwarder interface ...
}

Note: each JMX server created in a driver or node has a distinct MBeanServerForwarder instance.

To get access to a configured MBeanServerForwarder, you first need to access the JMXServer that encloses it:


Main Page > Extending and Customizing JPPF > Pluggable MBeanServerForwarder

Support This Project Copyright © 2005-2017 JPPF.org Powered by MediaWiki