com.jrockit.mc.rjmx
Interface IConnectionHandle


public interface IConnectionHandle

An IConnectionHandle is a handle to an active connection. It provides services around the connection. Use an IConnectionManager to get an IConnectionHandle.

See the package documentation for examples on usage.

Author:
Marcus Hirt

Method Summary
 IConnectionDescriptor getDescriptor()
          Returns the descriptor that was used to create the connection.
<T> T
getService(java.lang.Class<T> clazz)
          Returns a service associated with IConnectionHandle.
 boolean hasService(java.lang.Class<?> clazz)
          Returns true if there is a service registered for the given class
 boolean isConnected()
          Return true if this connection is live.
<T> boolean
registerService(java.lang.Class<T> clazz, T serviceObject)
          Registers a service with the IConnectionHandle.
<T> T
unregisterService(java.lang.Class<T> clazz)
          Unregisters a service with the IConnectionHandle.
 

Method Detail

getDescriptor

IConnectionDescriptor getDescriptor()
Returns the descriptor that was used to create the connection.

Returns:
the descriptor.

getService

<T> T getService(java.lang.Class<T> clazz)
Returns a service associated with IConnectionHandle.

Parameters:
clazz - the class used to register the service.
Returns:
the service object registered for the given class.

registerService

<T> boolean registerService(java.lang.Class<T> clazz,
                            T serviceObject)
                        throws java.lang.IllegalArgumentException
Registers a service with the IConnectionHandle.

Parameters:
clazz - the service class for which to register a service.
serviceObject - the service implementation.
Returns:
true if the registration succeeded, false if the service class already had a service registered for it.
Throws:
java.lang.IllegalArgumentException - if a serviceObject does not implement or extend clazz.

unregisterService

<T> T unregisterService(java.lang.Class<T> clazz)
Unregisters a service with the IConnectionHandle.

Parameters:
clazz - the class to unregister a service object for.
Returns:
the service object that was unregistered for the given class.

hasService

boolean hasService(java.lang.Class<?> clazz)
Returns true if there is a service registered for the given class

Parameters:
clazz - the service class
Returns:
true if the service exist, false otherwise.

isConnected

boolean isConnected()
Return true if this connection is live.

Returns:
true if this connection is live.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.