mx4j.remote

Class ConnectionResolver

Known Direct Subclasses:
HTTPResolver, LOCALResolver, RMIResolver

public abstract class ConnectionResolver
extends ProviderHelper

ConnectionResolver handles the details of creating connections for different protocols. Subclasses for the specific protocol are instantiated using a mechanism very similar to the one specified by javax.management.remote.JMXConnectorFactory. Here a subclass has a fully qualified name specified like this: .resolver..Resolver, for example RMIResolver This class is used from both the client and the server. The former uses it to lookup stubs or connections to the server side; the latter uses it to create server instances and make them availale to clients, for example via JNDI. The client and server methods have not been splitted into 2 different interfaces because most of the times they share common code, although it may have been a better design.

Version:
$Revision: 1.5 $

Method Summary

Object
bindClient(Object client, Map environment)
Connects the client returned by lookupClient(JMXServiceURL,Map) to the server side.
javax.management.remote.JMXServiceURL
bindServer(Object server, javax.management.remote.JMXServiceURL url, Map environment)
Binds the server created by createServer(JMXServiceURL,Map) to a place specified by the JMXServiceURL.
Object
createServer(javax.management.remote.JMXServiceURL url, Map environment)
Creates an instance of the server as specified in the given JMXServiceURL.
void
destroyServer(Object server, javax.management.remote.JMXServiceURL url, Map environment)
Destroys the server created by createServer(JMXServiceURL,Map), by cleaning up resources it may have requested at creation time
Object
lookupClient(javax.management.remote.JMXServiceURL url, Map environment)
Looks up a connection with the server side as specified in the given JMXServiceURL.
static ConnectionResolver
newConnectionResolver(String proto, Map environment)
Returns a subclass of ConnectionResolver for the specified protocol.
void
unbindServer(Object server, javax.management.remote.JMXServiceURL address, Map environment)
Unbinds the server bound by bindServer(Object,JMXServiceURL,Map) from the place specified by the JMXServiceURL.

Methods inherited from class mx4j.remote.ProviderHelper

constructClassName, findSystemPackageList, getLogger, loadClass, normalizeProtocol

Method Details

bindClient

public Object bindClient(Object client,
                         Map environment)
            throws IOException

Returns:
An object of the same type as the client passed in; normally the client object itself


bindServer

public javax.management.remote.JMXServiceURL bindServer(Object server,
                                                        javax.management.remote.JMXServiceURL url,
                                                        Map environment)
            throws IOException
Binds the server created by createServer(JMXServiceURL,Map) to a place specified by the JMXServiceURL.

Returns:
a new JMXServiceURL that specifies where the server has been bound to.

See Also:
unbindServer(Object,JMXServiceURL,Map)


createServer

public Object createServer(javax.management.remote.JMXServiceURL url,
                           Map environment)
            throws IOException
Creates an instance of the server as specified in the given JMXServiceURL. It is only a factory method, it should just return a fresh instance of the server; other methods are responsible to make it available to clients (for example exporting it). This method is used in implementations of javax.management.remote.JMXConnectorServer.start.

See Also:
bindServer(Object,JMXServiceURL,Map), destroyServer(Object,JMXServiceURL,Map)


destroyServer

public void destroyServer(Object server,
                          javax.management.remote.JMXServiceURL url,
                          Map environment)
            throws IOException
Destroys the server created by createServer(JMXServiceURL,Map), by cleaning up resources it may have requested at creation time

See Also:
createServer(JMXServiceURL,Map)


lookupClient

public Object lookupClient(javax.management.remote.JMXServiceURL url,
                           Map environment)
            throws IOException
Looks up a connection with the server side as specified in the given JMXServiceURL. This method is used in implementations of javax.management.remote.JMXConnector.connect().

See Also:
bindClient(Object,Map)


newConnectionResolver

public static ConnectionResolver newConnectionResolver(String proto,
                                                       Map environment)
Returns a subclass of ConnectionResolver for the specified protocol.


unbindServer

public void unbindServer(Object server,
                         javax.management.remote.JMXServiceURL address,
                         Map environment)
            throws IOException
Unbinds the server bound by bindServer(Object,JMXServiceURL,Map) from the place specified by the JMXServiceURL.

See Also:
destroyServer(Object,JMXServiceURL,Map)


Copyright © 2001-2003 MX4J Team. All Rights Reserved.