|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.utils.asyncsocket.ListenableServerSocketChannel
public class ListenableServerSocketChannel
ListenableServerSocketChannel adds convenient listening mechanism over non-blocking ServerSocketChannel.
| Nested Class Summary | |
|---|---|
static interface |
ListenableServerSocketChannel.ServerSocketAcceptable
|
| Constructor Summary | |
|---|---|
ListenableServerSocketChannel(ServerSocketChannel channel,
Executor eventExecutor)
Wrap AsyncServerSocket over given ServerSocketChannel using given event worker thread and a new selector thread. |
|
ListenableServerSocketChannel(ServerSocketChannel channel,
Executor eventExecutor,
AsyncSelector t)
Wrap AsyncServerSocket over given ServerSocketChannel using given event worker thread and selector thread. |
|
| Method Summary | |
|---|---|
void |
bind(SocketAddress addr,
int backlog)
Binds the ServerSocket to a specific address
(IP address and port number). |
void |
close()
close. |
ListenableServerSocketChannel.ServerSocketAcceptable |
getAcceptableListener()
Getter for the field acceptableListener. |
ServerSocketChannel |
getChannel()
Getter for the field channel. |
AsyncSelector |
getSelectorThread()
getSelectorThread. |
void |
setAcceptableListener(ListenableServerSocketChannel.ServerSocketAcceptable listener)
Setter for the field acceptableListener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListenableServerSocketChannel(ServerSocketChannel channel,
Executor eventExecutor,
AsyncSelector t)
throws ClosedChannelException
channel - a ServerSocketChannel object.eventExecutor - event executor or null for selector threadt - selector thread
ClosedChannelException - if any.
public ListenableServerSocketChannel(ServerSocketChannel channel,
Executor eventExecutor)
throws IOException
channel - a ServerSocketChannel object.eventExecutor - event executor or null for selector thread
ClosedChannelException - if any.
IOException - if any.| Method Detail |
|---|
public void setAcceptableListener(ListenableServerSocketChannel.ServerSocketAcceptable listener)
Setter for the field acceptableListener.
listener - a ListenableServerSocketChannel.ServerSocketAcceptable object.public ListenableServerSocketChannel.ServerSocketAcceptable getAcceptableListener()
Getter for the field acceptableListener.
ListenableServerSocketChannel.ServerSocketAcceptable object.public ServerSocketChannel getChannel()
Getter for the field channel.
ServerSocketChannel object.public AsyncSelector getSelectorThread()
getSelectorThread.
AsyncSelector object.
public void close()
throws IOException
close.
IOException - if any.
public void bind(SocketAddress addr,
int backlog)
throws IOException
ServerSocket to a specific address
(IP address and port number).
If the address is null, then the system will pick up
an ephemeral port and a valid local address to bind the socket.
The backlog argument must be a positive
value greater than 0. If the value passed if equal or less
than 0, then the default value will be assumed.
addr - addressbacklog - backlog
IllegalArgumentException - if endpoint is a
SocketAddress subclass not supported by this socket
IOException - if error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||