mx4j.remote
Class ConnectionResolver

java.lang.Object
  extended bymx4j.remote.ProviderHelper
      extended bymx4j.remote.ConnectionResolver
Direct Known Subclasses:
HTTPResolver, Resolver, Resolver

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 JMXConnectorFactory. Here a subclass has a fully qualified name specified like this: .resolver..Resolver, for example Resolver 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.6 $

Constructor Summary
ConnectionResolver()
           
 
Method Summary
abstract  java.lang.Object bindClient(java.lang.Object client, java.util.Map environment)
          Connects the client returned by lookupClient(javax.management.remote.JMXServiceURL, java.util.Map) to the server side.
abstract  javax.management.remote.JMXServiceURL bindServer(java.lang.Object server, javax.management.remote.JMXServiceURL url, java.util.Map environment)
          Binds the server created by createServer(javax.management.remote.JMXServiceURL, java.util.Map) to a place specified by the JMXServiceURL.
abstract  java.lang.Object createServer(javax.management.remote.JMXServiceURL url, java.util.Map environment)
          Creates an instance of the server as specified in the given JMXServiceURL.
abstract  void destroyServer(java.lang.Object server, javax.management.remote.JMXServiceURL url, java.util.Map environment)
          Destroys the server created by createServer(javax.management.remote.JMXServiceURL, java.util.Map), by cleaning up resources it may have requested at creation time
abstract  java.lang.Object lookupClient(javax.management.remote.JMXServiceURL url, java.util.Map environment)
          Looks up a connection with the server side as specified in the given JMXServiceURL.
static ConnectionResolver newConnectionResolver(java.lang.String proto, java.util.Map environment)
          Returns a subclass of ConnectionResolver for the specified protocol.
abstract  void unbindServer(java.lang.Object server, javax.management.remote.JMXServiceURL address, java.util.Map environment)
          Unbinds the server bound by bindServer(java.lang.Object, javax.management.remote.JMXServiceURL, java.util.Map) from the place specified by the JMXServiceURL.
 
Methods inherited from class mx4j.remote.ProviderHelper
constructClassName, findSystemPackageList, getLogger, loadClass, normalizeProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionResolver

public ConnectionResolver()
Method Detail

newConnectionResolver

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


lookupClient

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

Throws:
java.io.IOException
See Also:
bindClient(java.lang.Object, java.util.Map)

bindClient

public abstract java.lang.Object bindClient(java.lang.Object client,
                                            java.util.Map environment)
                                     throws java.io.IOException
Connects the client returned by lookupClient(javax.management.remote.JMXServiceURL, java.util.Map) to the server side.

Returns:
An object of the same type as the client passed in; normally the client object itself
Throws:
java.io.IOException

createServer

public abstract java.lang.Object createServer(javax.management.remote.JMXServiceURL url,
                                              java.util.Map environment)
                                       throws java.io.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 JMXConnectorServerMBean.start().

Throws:
java.io.IOException
See Also:
bindServer(java.lang.Object, javax.management.remote.JMXServiceURL, java.util.Map), destroyServer(java.lang.Object, javax.management.remote.JMXServiceURL, java.util.Map)

bindServer

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

Returns:
a new JMXServiceURL that specifies where the server has been bound to.
Throws:
java.io.IOException
See Also:
unbindServer(java.lang.Object, javax.management.remote.JMXServiceURL, java.util.Map)

unbindServer

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

Throws:
java.io.IOException
See Also:
destroyServer(java.lang.Object, javax.management.remote.JMXServiceURL, java.util.Map)

destroyServer

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

Throws:
java.io.IOException
See Also:
createServer(javax.management.remote.JMXServiceURL, java.util.Map)


Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.