org.exolab.core.messenger
Interface ManagedConnectionAcceptor


public interface ManagedConnectionAcceptor

A ManagedConnectionAcceptor waits for a connection request to come in over the network, and constructs a ManagedConnection object to handle it.

Version:
$Revision: 1.1 $ $Date: 2002/02/21 09:46:42 $
Author:
Tim Anderson
See Also:
ManagedConnection, Messenger

Method Summary
 ManagedConnection accept()
          Listens for a connection to be made to this acceptor and accepts it
 void accept(java.lang.String uri, ConnectionHandler handler)
          Register a connection handler to accept new Connection instances
 void addAcceptorEventListener(AcceptorEventListener listener)
          Add a listener for connection acceptor events
 void close()
          Close the acceptor, freeing all associated resources
 void close(java.lang.String uri)
          Stop accepting connections for the specified URI
 java.lang.String getURI()
          Returns the URI that connections are being accepted on
 void removeAcceptorEventListener(AcceptorEventListener listener)
          Remove a listener of connection acceptor events
 

Method Detail

getURI

java.lang.String getURI()
Returns the URI that connections are being accepted on

Returns:
the URI that connections are being accepted on

accept

void accept(java.lang.String uri,
            ConnectionHandler handler)
            throws java.net.MalformedURLException,
                   java.rmi.RemoteException
Register a connection handler to accept new Connection instances

Parameters:
uri - the URI that the handler accepts connections for
handler - the connection handler
Throws:
java.net.MalformedURLException - if uri is an invalid URI
java.rmi.RemoteException - if the handler cannot be registered
java.lang.IllegalArgumentException - if any argument is null

close

void close(java.lang.String uri)
           throws java.net.MalformedURLException,
                  java.rmi.RemoteException
Stop accepting connections for the specified URI

Parameters:
uri - the URI to close
Throws:
java.net.MalformedURLException - if uri is an invalid URI
java.rmi.RemoteException - if an error occurs closing the connection
java.lang.IllegalArgumentException - if uri is null

accept

ManagedConnection accept()
                         throws java.rmi.RemoteException
Listens for a connection to be made to this acceptor and accepts it

Returns:
the new connection
Throws:
java.rmi.RemoteException - if an error occurs when waiting for a connection

close

void close()
           throws java.rmi.RemoteException
Close the acceptor, freeing all associated resources

Throws:
java.rmi.RemoteException - if an error occurs

addAcceptorEventListener

void addAcceptorEventListener(AcceptorEventListener listener)
Add a listener for connection acceptor events

Parameters:
listener - the listener to add

removeAcceptorEventListener

void removeAcceptorEventListener(AcceptorEventListener listener)
Remove a listener of connection acceptor events

Parameters:
listener - the listener to remove


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