org.exolab.core.messenger
Interface ManagedConnection

All Known Implementing Classes:
ManagedPacketConnection

public interface ManagedConnection

A ManagedConnection instance represents a physical connection over a low level transport protocol.

It is responsible for establishing the connection, and managing its lifecyle. The physical connection is shared amongst multiple Connection instances.

Version:
$Revision: 1.2 $ $Date: 2002/02/21 09:49:41 $
Author:
Tim Anderson
See Also:
Connection, Messenger

Method Summary
 void accept(java.lang.String name, ConnectionHandler handler)
          Register a handler to accept connections for the specified name.
 void close()
          Destroys the physical connection
 void close(java.lang.String name)
          Stop accepting connect requests for the specified connection
 Connection open(java.lang.String name, ConnectionProperties properties)
          Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance
 void setManagedConnectionEventListener(ManagedConnectionEventListener listener)
          Set the listener for connection events
 

Method Detail

open

public Connection open(java.lang.String name,
                       ConnectionProperties properties)
                throws java.rmi.RemoteException
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance

Parameters:
name - the name of the connection
properties - connection properties (may be null)
Returns:
a new conneciton handle
Throws:
ConnectException - if no handler is registered for name
java.rmi.RemoteException - if a new connection handle cannot be created

accept

public void accept(java.lang.String name,
                   ConnectionHandler handler)
            throws java.rmi.RemoteException
Register a handler to accept connections for the specified name.
This method returns immediately.

Parameters:
name - the connection name to listen on
handler - the handler to pass new connections to
Throws:
java.rmi.RemoteException - if an error occurs registering the handler
java.lang.IllegalArgumentException - if any argument is null

close

public void close(java.lang.String name)
Stop accepting connect requests for the specified connection

Parameters:
name - the connection name
Throws:
java.lang.IllegalArgumentException - if name is null

close

public void close()
           throws java.rmi.RemoteException
Destroys the physical connection

Throws:
java.rmi.RemoteException - if an error occurs closing the connection

setManagedConnectionEventListener

public void setManagedConnectionEventListener(ManagedConnectionEventListener listener)
Set the listener for connection events

Parameters:
listener - the event listener. Setting it to null removes the listener


Copyright © 1999-2005 The Exolab Group. All Rights Reserved.