org.exolab.jms.net.connector
Interface ManagedConnection

All Known Implementing Classes:
AbstractManagedConnection

public interface ManagedConnection

A ManagedConnection represents a physical connection.
It is responsible for managing multiple Connection instances, which perform method invocations over the physical connection.

Version:
$Revision: 1.4 $ $Date: 2006/12/16 12:37:17 $
Author:
Tim Anderson
See Also:
Connection

Method Summary
 void destroy()
          Destroys the physical connection.
 Connection getConnection()
          Creates a new connection handle for the underlying physical connection.
 URI getLocalURI()
          Returns the local address that this connection is bound to.
 java.security.Principal getPrincipal()
          Returns the principal associated with this connection.
 URI getRemoteURI()
          Returns the remote address to which this is connected.
 void ping()
          Ping the connection.
 void setConnectionEventListener(ManagedConnectionListener listener)
          Registers a connection event listener.
 void setInvocationHandler(InvocationHandler handler)
          Registers a handler for handling invocations on objects exported via this connection.
 

Method Detail

setInvocationHandler

public void setInvocationHandler(InvocationHandler handler)
                          throws ResourceException
Registers a handler for handling invocations on objects exported via this connection. Once a handler is registered, it cannot be de-registered.
Parameters:
handler - the invocation handler
Throws:
IllegalStateException - if a handler is already registered
ResourceException - for any error

setConnectionEventListener

public void setConnectionEventListener(ManagedConnectionListener listener)
                                throws ResourceException
Registers a connection event listener.
Parameters:
listener - the connection event listener
Throws:
ResourceException - for any error

getConnection

public Connection getConnection()
                         throws ResourceException
Creates a new connection handle for the underlying physical connection.
Returns:
a new connection handle
Throws:
IllegalStateException - if an InvocationHandler hasn't been registered
ResourceException - for any error

ping

public void ping()
          throws ResourceException
Ping the connection. The connection event listener will be notified if the ping succeeds. NOTE: the notification may occur prior to this call returning.
Throws:
IllegalStateException - if no invocation handler has been registered, or if the connection has been destroyed
ResourceException - for any error

getRemoteURI

public URI getRemoteURI()
                 throws ResourceException
Returns the remote address to which this is connected.
Returns:
the remote address to which this is connected
Throws:
ResourceException - for any error

getLocalURI

public URI getLocalURI()
                throws ResourceException
Returns the local address that this connection is bound to.
Returns:
the local address that this connection is bound to
Throws:
ResourceException - for any error

getPrincipal

public java.security.Principal getPrincipal()
                                     throws ResourceException
Returns the principal associated with this connection.
Returns:
the principal associated with this connection, or null if none is set
Throws:
ResourceException - for any error

destroy

public void destroy()
             throws ResourceException
Destroys the physical connection.
Throws:
ResourceException - for any error


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.