|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.exolab.jms.net.socket.SocketManagedConnectionAcceptor
A ManagedConnectionAcceptor for accepting socket connections.
| Constructor Summary | |
SocketManagedConnectionAcceptor(Authenticator authenticator,
SocketRequestInfo info)
Construct a new SocketManagedConnectionAcceptor. |
|
| Method Summary | |
void |
accept(ManagedConnectionAcceptorListener listener)
Start accepting connections. |
void |
close()
Stop accepting connection requests, and clean up any allocated resources. |
protected abstract ManagedConnection |
createManagedConnection(URI uri,
java.net.Socket socket,
Authenticator authenticator)
Create a new server-side ManagedConnection for an accepted
socket connection. |
protected java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.net.InetAddress host)
Create a new server socket. |
SocketRequestInfo |
getRequestInfo()
Returns the connection request info used to construct this. |
URI |
getURI()
Returns the URI that this acceptor is accepting connections on. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SocketManagedConnectionAcceptor(Authenticator authenticator,
SocketRequestInfo info)
throws ResourceException
SocketManagedConnectionAcceptor.
This creates a server socket with the specified port and listen backlog.
If SocketRequestInfo.getBindAll() flag can be used on multi-homed
hosts to limit the addresses on which connections are accepted.
If false, the socket will only accept connections on the
address specified by URIRequestInfo.getHostAddress().
If true it will accept connections on all local addresses.
The port returned by URIRequestInfo.getPort() must be between 0 and
65535, inclusiveauthenticator - the connection authenticatorinfo - the connection request infoResourceException - if a server socket cannot be created| Method Detail |
public void accept(ManagedConnectionAcceptorListener listener)
throws ResourceException
accept in interface ManagedConnectionAcceptorlistener - the listener to delegate accepted connections toResourceException - if connections cannot be acceptedpublic SocketRequestInfo getRequestInfo()
public URI getURI()
getURI in interface ManagedConnectionAcceptor
public void close()
throws ResourceException
close in interface ManagedConnectionAcceptorResourceException - generic exception if the operation fails
protected java.net.ServerSocket createServerSocket(int port,
int backlog,
java.net.InetAddress host)
throws java.io.IOException
port - the port to listen onbacklog - the listen backloghost - if non-null, specifies to only accept connections to the
specified address. If null, accept connections on any/all
local addresses.portjava.io.IOException - if the socket can't be created
protected abstract ManagedConnection createManagedConnection(URI uri,
java.net.Socket socket,
Authenticator authenticator)
throws ResourceException
ManagedConnection for an accepted
socket connection.uri - the URI denoting this acceptorsocket - the accepted socket connectionauthenticator - the connection authenticatorResourceException - if the managed connection can't be created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||