A convenience base implementation of Connection.
This class uses the capabilities of the EndPoint API to provide a
more traditional style of async reading. A call to fillInterested()
will schedule a callback to onFillable() or onFillInterestedFailed(Throwable)
as appropriate.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final EndPoint | |
| private final Executor | |
| private int | |
| private final List | |
| private final Callback | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addEventListener(EventListener
the listener to add listener)Implements org. Adds a listener of connection events. |
| public void | close()
Implements org. Performs a logical close of this connection. |
| protected void | |
| public void | |
| public long | |
| public long | |
| public long | |
| public EndPoint | |
| protected Executor | |
| public int | |
| public Invocable. | getInvocationType()
Overrides default org.
Deprecated
|
| public long | |
| public long | |
| public boolean | |
| public void | onClose(Throwable
The cause of the close or null for a normal close cause)Implements org. Callback method invoked when this connection is closed. |
| private void | |
| public abstract void | |
| protected void | onFillInterestedFailed(Throwable
the exception that caused the failure cause)Callback method invoked when the endpoint failed to be ready to be read. |
| public boolean | onIdleExpired(TimeoutException timeoutException)
Implements org. Callback method invoked upon an idle timeout event. |
| public void | onOpen()
Implements org. Callback method invoked when this connection is opened. |
| private void | |
| protected boolean | Returns: true to signal that the endpoint must be closed, false to keep the endpoint openthe cause of the read timeout timeout)Callback method invoked when the endpoint failed to be ready to be read after a timeout |
| public void | removeEventListener(EventListener
the listener to remove eventListener)Implements org. Removes a listener of connection events. |
| public void | |
| public String | |
| public final String | |
| public void |
| _created | back to summary |
|---|---|
| private final long _created | |
| _endPoint | back to summary |
|---|---|
| private final EndPoint _endPoint | |
| _executor | back to summary |
|---|---|
| private final Executor _executor | |
| _inputBufferSize | back to summary |
|---|---|
| private int _inputBufferSize | |
| _listeners | back to summary |
|---|---|
| private final List<Connection. | |
| _readCallback | back to summary |
|---|---|
| private final Callback _readCallback | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| AbstractConnection | back to summary |
|---|---|
| protected AbstractConnection(EndPoint endPoint, Executor executor) | |
| addEventListener | back to summary |
|---|---|
| public void addEventListener(EventListener listener) Implements org. Doc from org. Adds a listener of connection events.
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Performs a logical close of this connection. For simple connections, this may just mean to delegate the close to the associated
| |
| failedCallback | back to summary |
|---|---|
| protected void failedCallback(final Callback callback, final Throwable x) | |
| fillInterested | back to summary |
|---|---|
| public void fillInterested() Utility method to be called to register read interest. After a call to this method,
| |
| getBytesIn | back to summary |
|---|---|
| public long getBytesIn() Implements org.
| |
| getBytesOut | back to summary |
|---|---|
| public long getBytesOut() Implements org.
| |
| getCreatedTimeStamp | back to summary |
|---|---|
| public long getCreatedTimeStamp() Implements org.
| |
| getEndPoint | back to summary |
|---|---|
| public EndPoint getEndPoint() Implements org.
| |
| getExecutor | back to summary |
|---|---|
| protected Executor getExecutor() | |
| getInputBufferSize | back to summary |
|---|---|
| public int getInputBufferSize() | |
| getInvocationType | back to summary |
|---|---|
| public Invocable. Overrides default org. Deprecated
| |
| getMessagesIn | back to summary |
|---|---|
| public long getMessagesIn() Implements org.
| |
| getMessagesOut | back to summary |
|---|---|
| public long getMessagesOut() Implements org.
| |
| isFillInterested | back to summary |
|---|---|
| public boolean isFillInterested() | |
| onClose | back to summary |
|---|---|
| public void onClose(Throwable cause) Implements org. Doc from org. Callback method invoked when this connection is closed. Creators of the connection implementation are responsible for calling this method. | |
| onClosed | back to summary |
|---|---|
| private void onClosed(Connection. | |
| onFillable | back to summary |
|---|---|
| public abstract void onFillable() Callback method invoked when the endpoint is ready to be read.
| |
| onFillInterestedFailed | back to summary |
|---|---|
| protected void onFillInterestedFailed(Throwable cause) Callback method invoked when the endpoint failed to be ready to be read.
| |
| onIdleExpired | back to summary |
|---|---|
| public boolean onIdleExpired(TimeoutException timeoutException) Implements org. Doc from org. Callback method invoked upon an idle timeout event. Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed. When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
| |
| onOpen | back to summary |
|---|---|
| public void onOpen() Implements org. Doc from org. Callback method invoked when this connection is opened. Creators of the connection implementation are responsible for calling this method.
| |
| onOpened | back to summary |
|---|---|
| private void onOpened(Connection. | |
| onReadTimeout | back to summary |
|---|---|
| protected boolean onReadTimeout(TimeoutException timeout) Callback method invoked when the endpoint failed to be ready to be read after a timeout
| |
| removeEventListener | back to summary |
|---|---|
| public void removeEventListener(EventListener eventListener) Implements org. Doc from org. Removes a listener of connection events.
| |
| setInputBufferSize | back to summary |
|---|---|
| public void setInputBufferSize(int inputBufferSize) | |
| toConnectionString | back to summary |
|---|---|
| public String toConnectionString() | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| tryFillInterested | back to summary |
|---|---|
| public void tryFillInterested(Callback callback) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | failed(Throwable
the reason for the operation failure x)Overrides default org. Callback invoked when the operation fails. |
| public Invocable. | |
| public void | succeeded()
Overrides default org. Callback invoked when the operation completes. |
| public String |
| ReadCallback | back to summary |
|---|---|
| private ReadCallback() | |
| failed | back to summary |
|---|---|
| public void failed(Throwable x) Overrides default org. Doc from org. Callback invoked when the operation fails. | |
| getInvocationType | back to summary |
|---|---|
| public Invocable. Overrides default org.
| |
| succeeded | back to summary |
|---|---|
| public void succeeded() Overrides default org. Doc from org. Callback invoked when the operation completes.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |