|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.exolab.core.messenger.ManagedPacketConnection
A ManagedPacketConnection implements an efficient packet
based protocol over a low level transport protocol.
PacketConnection,
Messenger| Nested Class Summary | |
static class |
ManagedPacketConnection.ConnectRequest
|
static class |
ManagedPacketConnection.ConnectResponse
|
| Constructor Summary | |
ManagedPacketConnection(Context context,
MultiplexerFactory factory)
Construct a new ManagedPacketConnection |
|
| Method Summary | |
void |
accept(java.lang.String name,
ConnectionHandler handler)
Register a handler to accept new connections. This method returns immediately. |
void |
close()
Destroys the physical connection, prior to notifying any registered ManagedConnectionEventListener instance |
void |
close(java.lang.String name)
Stop accepting connect requests for the specified connection |
void |
closed(Connection connection)
Invoked when a connection is closed |
protected PacketConnection |
createConnection(java.lang.String name)
Create a new connection to serve a client |
protected void |
doClose()
Performs the actual connection closure, without notifying registered listeners |
protected void |
ensureOpen()
|
void |
error(Connection connection,
java.lang.Exception exception)
Invoked when a fatal connection error occurs, just before an Exception is thrown to the application |
protected void |
errorOnStream(java.lang.Exception reason)
Handle an error event, raised by the Multiplexer or Demultiplexer. |
protected Channel |
getChannel(int connectionId,
int channelId)
Helper to return a channel for a particular connection |
protected PacketQueue |
getOutputQueue()
Returns the queue of packets to be streamed down the physical connection |
protected org.exolab.core.messenger.PacketPool |
getPool()
Returns the pool of free packets |
protected ThreadPool |
getThreadPool()
Returns the thread pool |
protected void |
initialise()
Initialises the 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 |
protected void |
streamClosed()
Handle a close event, raised by the Multiplexer or Demultiplexer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ManagedPacketConnection(Context context,
MultiplexerFactory factory)
ManagedPacketConnection
context - the connection contextfactory - the factory for multiplexers/demultiplexers
java.lang.IllegalArgumentException - if any argument is null| Method Detail |
public Connection open(java.lang.String name,
ConnectionProperties properties)
throws java.rmi.RemoteException
open in interface ManagedConnectionname - the name of the connectionproperties - connection properties (may be null)
ConnectException - if no handler is registered for
name
java.rmi.RemoteException - if a new connection handle cannot be created
public void accept(java.lang.String name,
ConnectionHandler handler)
throws java.rmi.RemoteException
accept in interface ManagedConnectionhandler - the handler to pass new connections toname - the connection name to listen on
java.rmi.RemoteException - if an error occurs registering the handler
java.lang.IllegalArgumentException - if any argument is nullpublic void close(java.lang.String name)
close in interface ManagedConnectionname - the connection name
java.lang.IllegalArgumentException - if name is null
public void close()
throws java.rmi.RemoteException
ManagedConnectionEventListener instance
close in interface ManagedConnectionjava.rmi.RemoteException - if an error occurs closing the connectionpublic void setManagedConnectionEventListener(ManagedConnectionEventListener listener)
setManagedConnectionEventListener in interface ManagedConnectionlistener - the event listener. Setting it to null
removes the listenerpublic void closed(Connection connection)
closed in interface ConnectionEventListenerconnection - the closed connection
public void error(Connection connection,
java.lang.Exception exception)
error in interface ConnectionEventListenerconnection - the connection the error occurred onexception - the error
protected Channel getChannel(int connectionId,
int channelId)
connectionId - the connection identifierchannelId - the channel identifier
protected void initialise()
throws java.rmi.RemoteException
java.rmi.RemoteException - if the connection can't be initialised
protected void doClose()
throws java.rmi.RemoteException
java.rmi.RemoteException - if an error occurs closing the connectionprotected PacketQueue getOutputQueue()
protected org.exolab.core.messenger.PacketPool getPool()
protected ThreadPool getThreadPool()
protected PacketConnection createConnection(java.lang.String name)
throws java.rmi.RemoteException
name - the connection name
java.rmi.RemoteException - if the connection cannot be created
java.lang.IllegalArgumentException - if name is null
protected void ensureOpen()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionprotected void streamClosed()
protected void errorOnStream(java.lang.Exception reason)
reason - the exception describing the cause
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||