The channel associated with implementations of this interface can be used to read data from and write data to the session.
I/O sessions are not bound to an execution thread, therefore one cannot use the context of the thread to store a session's state. All details about a particular session must be stored within the session itself, usually using execution context associated with it.
Implementations of this interface are expected to be threading safe.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | IOSession.Status
This enum represents a set of states I/O session transitions through during its life-span. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteChannel | |
| public void | clearEvent(int
I/O event type. op)Clears interest in a particular I/O event type by updating the event mask associated with the session. |
| public void | close()
Redeclares java. |
| public void | |
| public int | |
| public IOEventHandler | |
| public long | Returns: timestamp.Returns timestamp of the last I/O event including socket timeout reset. |
| public long | |
| public long | |
| public SocketAddress | |
| public Lock | getLock()
Returns session lock that should be used by I/O event handlers to synchronize access to the session. |
| public SocketAddress | |
| public Timeout | Returns: socket timeout.Redeclares org. |
| public IOSession. | |
| public boolean | |
| public Command | |
| public void | setEvent(int
I/O event type. op)Declares interest in a particular I/O event type by updating the event mask associated with the session. |
| public void | setEventMask(int
new I/O event mask. ops)Declares interest in I/O event notifications by setting the event mask associated with the session |
| public void | setSocketTimeout(Timeout
socket timeout. timeout)Redeclares org. |
| public void | |
| public void | |
| public void |
| channel | back to summary |
|---|---|
| public ByteChannel channel() Returns the underlying I/O channel associated with this session.
| |
| clearEvent | back to summary |
|---|---|
| public void clearEvent(int op) Clears interest in a particular I/O event type by updating the event mask associated with the session.
| |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Terminates the session gracefully and closes the underlying I/O channel. This method ensures that session termination handshake, such as the one used by the SSL/TLS protocol, is correctly carried out.
| |
| enqueue | back to summary |
|---|---|
| public void enqueue(Command command, Command. Inserts
| |
| getEventMask | back to summary |
|---|---|
| public int getEventMask() Returns mask of I/O evens this session declared interest in.
| |
| getHandler | back to summary |
|---|---|
| public IOEventHandler getHandler() Returns event handler associated with the session.
| |
| getLastEventTime | back to summary |
|---|---|
| public long getLastEventTime() Returns timestamp of the last I/O event including socket timeout reset.
| |
| getLastReadTime | back to summary |
|---|---|
| public long getLastReadTime() Returns timestamp of the last read event.
| |
| getLastWriteTime | back to summary |
|---|---|
| public long getLastWriteTime() Returns timestamp of the last write event.
| |
| getLocalAddress | back to summary |
|---|---|
| public SocketAddress getLocalAddress() Returns local address.
| |
| getLock | back to summary |
|---|---|
| public Lock getLock() Returns session lock that should be used by I/O event handlers to synchronize access to the session.
| |
| getRemoteAddress | back to summary |
|---|---|
| public SocketAddress getRemoteAddress() Returns address of the remote peer.
| |
| getSocketTimeout | back to summary |
|---|---|
| public Timeout getSocketTimeout() Redeclares org. Returns value of the socket timeout in milliseconds. The value of
| |
| getStatus | back to summary |
|---|---|
| public IOSession. Returns status of the session:
| |
| hasCommands | back to summary |
|---|---|
| public boolean hasCommands() Tests if there enqueued commands pending execution.
| |
| poll | back to summary |
|---|---|
| public Command poll() Removes first
| |
| setEvent | back to summary |
|---|---|
| public void setEvent(int op) Declares interest in a particular I/O event type by updating the event mask associated with the session.
| |
| setEventMask | back to summary |
|---|---|
| public void setEventMask(int ops) Declares interest in I/O event notifications by setting the event mask associated with the session
| |
| setSocketTimeout | back to summary |
|---|---|
| public void setSocketTimeout(Timeout timeout) Redeclares org. Sets value of the socket timeout in milliseconds. The value of
Please note this operation may affect the last event time.
| |
| updateReadTime | back to summary |
|---|---|
| public void updateReadTime() Updates the timestamp of the last read event | |
| updateWriteTime | back to summary |
|---|---|
| public void updateWriteTime() Updates the timestamp of the last write event | |
| upgrade | back to summary |
|---|---|
| public void upgrade(IOEventHandler handler) Upgrades event handler associated with the session.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final IOSession. | |
| public static final IOSession. | |
| public static final IOSession. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static IOSession. | |
| public static IOSession. |
| ACTIVE | back to summary |
|---|---|
| public static final IOSession. | |
| CLOSED | back to summary |
|---|---|
| public static final IOSession. | |
| CLOSING | back to summary |
|---|---|
| public static final IOSession. | |
| Status | back to summary |
|---|---|
| private Status() | |
| valueOf | back to summary |
|---|---|
| public static IOSession. | |
| values | back to summary |
|---|---|
| public static IOSession. | |