|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.messenger.tcp.TcpConnector
public class TcpConnector
A factory for TcpConnection
and TcpManagedConnectionAcceptor
objects
Connector
,
TcpConnection
,
TcpConnectionAcceptor
Constructor Summary | |
---|---|
TcpConnector()
Create a new TcpConnector |
Method Summary | |
---|---|
protected org.exolab.core.messenger.tcp.TcpManagedConnection |
accepted(java.net.Socket socket,
java.util.HashMap handlers)
Construct a new connection to process messages on a socket, accepted by a TcpConnectionAcceptor |
void |
closed(ManagedConnection connection)
Invoked when a managed connection is closed |
void |
closed(ManagedConnectionAcceptor acceptor)
Invoked when a connection acceptor is closed |
void |
error(ManagedConnectionAcceptor acceptor,
java.lang.Exception exception)
Invoked when a fatal connection acceptor error occurs, just before an Exception is thrown to the application |
void |
error(ManagedConnection connection,
java.lang.Exception exception)
Invoked when a fatal connection error occurs, just before an Exception is thrown to the application |
Connection |
getConnection(java.lang.String uri,
ConnectionProperties properties)
Returns a connection for the specified URI and connection properties |
ManagedConnectionAcceptor |
getManagedConnectionAcceptor(java.lang.String uri,
ConnectionProperties properties)
Returns a connection acceptor for the specified URI and connection properties |
java.lang.String |
getScheme()
Returns the protocol that the connector supports |
protected ManagedConnection |
open(java.lang.String uri,
ConnectionProperties properties)
Opens a connection for the specified URI and connection properties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TcpConnector()
Method Detail |
---|
public Connection getConnection(java.lang.String uri, ConnectionProperties properties) throws java.net.MalformedURLException, java.rmi.RemoteException
getConnection
in interface Connector
uri
- the connection addressproperties
- connection properties (may be null)
null
java.net.MalformedURLException
- if uri
is an invalid URI
java.rmi.RemoteException
- if a connection cannot be established
java.lang.IllegalArgumentException
- if uri
is nullpublic ManagedConnectionAcceptor getManagedConnectionAcceptor(java.lang.String uri, ConnectionProperties properties) throws java.net.MalformedURLException, java.rmi.RemoteException
getManagedConnectionAcceptor
in interface Connector
uri
- the address to accept connections onproperties
- connection properties (may be null)
java.net.MalformedURLException
- if uri
is an invalid URI
java.rmi.RemoteException
- if an I/O error occurs
java.lang.IllegalArgumentException
- if uri
is nullpublic java.lang.String getScheme()
getScheme
in interface Connector
public void closed(ManagedConnection connection)
closed
in interface ManagedConnectionEventListener
connection
- the closed connectionpublic void error(ManagedConnection connection, java.lang.Exception exception)
error
in interface ManagedConnectionEventListener
connection
- the connection the error occurred onexception
- the errorpublic void closed(ManagedConnectionAcceptor acceptor)
closed
in interface AcceptorEventListener
acceptor
- the closed connection acceptorpublic void error(ManagedConnectionAcceptor acceptor, java.lang.Exception exception)
error
in interface AcceptorEventListener
acceptor
- the connection the error occurred onexception
- the errorprotected ManagedConnection open(java.lang.String uri, ConnectionProperties properties) throws java.net.MalformedURLException, java.rmi.RemoteException
uri
- the connection addressproperties
- connection properties (may be null)
null
java.net.MalformedURLException
- if uri
is an invalid URI
java.rmi.RemoteException
- if a connection cannot be establishedprotected org.exolab.core.messenger.tcp.TcpManagedConnection accepted(java.net.Socket socket, java.util.HashMap handlers) throws java.rmi.RemoteException
TcpConnectionAcceptor
socket
- the tcp sockethandlers
- the set of connection handlers, keyed on name
java.rmi.RemoteException
- for any error
java.lang.IllegalArgumentException
- if any argument is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |