|
- Overview
The J4ONet framework expands upon the JMX framework, to enable distributed management. Currently, it uses the SUN Reference Edition with RMI connectors to create an extensible, network model.
J4ONet's JsRegistryManager handles request to locate Mbeans and JMX agents running across the network. Special Mbeans, called MBeanResolvers, are registered with the JsRegistryManager. Each MbeanResolver encapsulates a strategy to locate Mbeans. Provided with the J4ONet system are three resolvers: the MbeanServerResolver which looks for Mbeans in the local JMX agent, the JsRegistryResolver which looks in the local cache of located MBeans, and the BroadcastResolver which uses UDP broadcast to locate MBeans and agents across the network.
MBeanResolvers return a data structure that the ProxyManager can use to construct a location transparent proxy. Using this proxy, clients can utilize MBeans as if they were local. Currently, this proxy supports remote access via the SUN Reference Edition JMX RMI connectors.
- The Main Components
This UML shows the main functions and relationships of the J4ONet componenets. The JavaDoc's contain their complete API.
- org.jmx4odp.j4oNet. JmxServiceObj
The JmxServiceObj (JSO) is a data object that contains information about a JMX service. A JSO can be used as a query object to locate a class of JMX Services, or it can be used as a pointer a specific service.
It is passed about the J4ONet system and is used to isolate the consumer from implementation details. Implementation agnostic data, such as ObjectName, ObjectInstance, network domain, and name space are contained in this object.
- org.jmx4odp.j4oNet. MbeanResolver
This is a base class that is never used directly, it is extended by children that can be called to do work. A MBeanResolver has a name space, network domain, and threshold that it will respond to. When given a request, in the form of a sparsely populated JSO, it will determine if the request is within the name space, network domain, and threshold. If so, the resolver will use whatever strategy it encapsulates to discover matching JMX services. It will then return the findings as an array of JSO's.
- org.jmx4odp.j4oNet. JsRegistryManager
The JsRegistryManager is the resolving engine for J4ONet. It will locate all the MBeans registered with its MbeanServer agent that are true for instanceof org.jmx4odp.j4oNet.MBeanResolver. Then it will pass the JSO request to each one of them, and build a composite list of the findings. Any resolver that returns a getCachable of true, will have its findings cached in the JsRegistry.
The JsRegistryManager keeps two such caches, one for MBeans and one for MBean agents. If a MBean is discovered, it will make sure that it's hosting agent is also cached.
When this object is created, it will automatically create JsRegistryResolver and MbeanServerResolver and register them with the MbeanServer.
- org.jmx4odp.j4oNet. JsRegistryResolver
This object extends org.jmx4odp.j4oNet. MbeanResolver. One is automatically created by the JsRegistryManager when it is initialized. It searches the JsRegistry's cache to handle resolution requests.
- org.jmx4odp.j4oNet. MBeanServerResolver
This object extends org.jmx4odp.j4oNet. MbeanResolver. One is automatically created by the JsRegistryManager when it is initialized. It searches the local MbeanServer to handle resolution requests.
- org.jmx4odp.j4oNet. BroadcastResolver
This object extends org.jmx4odp.j4oNet. MbeanResolver. One is automatically created by the J4ONet MBean when it is initialized. It uses UDP broadcast to handle resolution request. The J4ONet MBean will listen for these broadcasts and respond if it knows of an MBean that can satisfy the request.
- org.jmx4odp.j4oNet. J4ONet
J4ONe is the basis for peer to peer discovery. It contains the configuration data (held as a JSO) for the local JMX Agent. It also creates a BroadcastResolver and registers it with the MBeanServer.
Once this object is registered with the MBeanServer, the MBeanServerResolver will use it to determine the settings for any local JSO returned.
This object will start a socket listening for broadcast made by BroadcastResolvers. If it receives one from a different MBeanServer instance, it will start-up a new BroadcastRequestHandler which will reply with a UDP singlecast reply. The BroadcastRequestHandler uses the JsRegistryManager to resolve the request.
- org.jmx4odp.j4oNet. ProxyManager
This object uses the Proxy object that is part of the Java1.3 release. Using the data in a JSO, this object can dynamically generate an Object that will act as a proxy to a MBean. The Object will conform to the MBean interface (Thus is currently limited to standard MBeans). If the JSO contained a reference to the local MBeanServer, the proxy will be local, else it will use the data in the JSO to construct a remote proxy.
There can be remote exception, thus MBean interfaces should always throw exceptions, else the Proxy will through a runtime error and the exception will be lost.
- org.jmx4odp.j4oNet. InitialJsRegistry
This is the J4ONet equivalent of InitialContext. It uses the InitialJsRegsistry.properties file to locate the primary JsRegistryManager. If it is given a reference to a local MBeanServer object, it will create a local Proxy to the JsRegistryManager, else it will give a remote proxy.
- J4ONet Sequence
When the JsRegistry is registered with the MBeanServer, it creates a JsRegistry cache, a MBeanServerResolver, and a JsRegistryResolver.
When it gets a request to resolve a JSO, it uses its MBeanServerResolver to find all the MBeanResolvers registered with the agent. Then it calls them to handle the request.
When a MBeanServerResolver is called to resolve a JSO, it calls itself to find a local instance of J4ONet. If it can find one, it will use J4ONet's configuration JSO as the basis for any service it finds on the local MbeanServer, else it will use the JSO passed in as the resolve criteria.
Once a resolver has returned its array of JSO objects, JsRegistryManager will check the resolver to see if getCachable is true. If so, it will rebind any objects with the JsRegistry. So it will cache the location of the JSO for the MBean, and its agent.
|