public abstract class ConnectionEventListener extends java.lang.Object implements EventListener
Connection| Constructor and Description |
|---|
ConnectionEventListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onByteRead(long bytesRead)
Event whenever any bytes are read on any open connection.
|
void |
onByteWritten(long bytesWritten)
Event whenever any bytes are successfully written on any open connection.
|
void |
onCompleted()
Marks the end of all event callbacks.
|
void |
onConnectionCloseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
Event whenever a connection close failed.
|
void |
onConnectionCloseStart()
Event whenever a close of any connection is issued.
|
void |
onConnectionCloseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
Event whenever a close of any connection is successful.
|
void |
onCustomEvent(java.lang.Object event)
Typically specific instances on
EventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. |
void |
onCustomEvent(java.lang.Object event,
long duration,
java.util.concurrent.TimeUnit timeUnit)
Typically specific instances on
EventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. |
void |
onCustomEvent(java.lang.Object event,
long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
Typically specific instances on
EventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. |
void |
onCustomEvent(java.lang.Object event,
java.lang.Throwable throwable)
Typically specific instances on
EventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. |
void |
onFlushComplete(long duration,
java.util.concurrent.TimeUnit timeUnit)
Event whenever flush completes.
|
void |
onFlushStart()
Event whenever a flush is issued on a connection.
|
void |
onWriteFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
Event whenever a write failed on a connection.
|
void |
onWriteStart()
Event whenever a write is issued on a connection.
|
void |
onWriteSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
Event whenever data is written successfully on a connection.
|
public void onByteRead(long bytesRead)
bytesRead - Number of bytes read.public void onByteWritten(long bytesWritten)
bytesWritten - Number of bytes written.public void onFlushStart()
public void onFlushComplete(long duration,
java.util.concurrent.TimeUnit timeUnit)
duration - Duration between flush start and completion.timeUnit - Timeunit for the duration.public void onWriteStart()
public void onWriteSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
onByteWritten(long) to capture number
of bytes written.duration - Duration between write start and completion.timeUnit - Timeunit for the duration.public void onWriteFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
duration - Duration between write start and failure.timeUnit - Timeunit for the duration.throwable - Error that caused the failure..public void onConnectionCloseStart()
public void onConnectionCloseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
duration - Duration between close start and completion.timeUnit - Timeunit for the duration.public void onConnectionCloseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
duration - Duration between close start and failure.timeUnit - Timeunit for the duration.throwable - Error that caused the failure.public void onCustomEvent(java.lang.Object event)
EventListenerEventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. eg: Creating a custom protocol on top of an
existing protocol like TCP, would perhaps require some additional events. In such a case, this callback can be
utilized.onCustomEvent in interface EventListenerevent - Event published.EventListener.onCustomEvent(Object, long, TimeUnit),
EventListener.onCustomEvent(Object, Throwable),
EventListener.onCustomEvent(Object, long, TimeUnit, Throwable)public void onCustomEvent(java.lang.Object event,
long duration,
java.util.concurrent.TimeUnit timeUnit)
EventListenerEventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. eg: Creating a custom protocol on top of an
existing protocol like TCP, would perhaps require some additional events. In such a case, this callback can be
utilized.
One should use this overload as opposed to EventListener.onCustomEvent(Object) if the custom event need not be created
per invocation but has to be associated with a duration. This is a simple optimization to reduce event creation
overhead.onCustomEvent in interface EventListenerevent - Event published.duration - Duration associated with this event. The semantics of this duration is totally upto the published
event.timeUnit - Timeunit for the duration.EventListener.onCustomEvent(Object, long, TimeUnit),
EventListener.onCustomEvent(Object, Throwable),
EventListener.onCustomEvent(Object, long, TimeUnit, Throwable)public void onCustomEvent(java.lang.Object event,
java.lang.Throwable throwable)
EventListenerEventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. eg: Creating a custom protocol on top of an
existing protocol like TCP, would perhaps require some additional events. In such a case, this callback can be
utilized.
One should use this overload as opposed to EventListener.onCustomEvent(Object) if the custom event need not be created
per invocation but has to be associated with an error. This is a simple optimization to reduce event creation
overhead.onCustomEvent in interface EventListenerevent - Event published.EventListener.onCustomEvent(Object, long, TimeUnit),
EventListener.onCustomEvent(Object, Throwable),
EventListener.onCustomEvent(Object, long, TimeUnit, Throwable)public void onCustomEvent(java.lang.Object event,
long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
EventListenerEventListener will provide events that are fired by RxNetty, however,
there may be cases, where a user would want to emit custom events. eg: Creating a custom protocol on top of an
existing protocol like TCP, would perhaps require some additional events. In such a case, this callback can be
utilized.
One should use this overload as opposed to EventListener.onCustomEvent(Object) if the custom event need not be created
per invocation but has to be associated with a duration and an error. This is a simple optimization to reduce
event creation overhead.onCustomEvent in interface EventListenerevent - Event published.duration - Duration associated with this event. The semantics of this duration is totally upto the published
event.timeUnit - Timeunit for the duration.throwable - Error associated with the event.EventListener.onCustomEvent(Object, long, TimeUnit),
EventListener.onCustomEvent(Object, Throwable),
EventListener.onCustomEvent(Object, long, TimeUnit, Throwable)public void onCompleted()
EventListeneronCompleted in interface EventListener