public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEndPoint(Scheduler scheduler,
InetSocketAddress local,
InetSocketAddress remote) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close any backing stream associated with the endpoint
|
void |
fillInterested(Callback callback)
Requests callback methods to be invoked when a call to
EndPoint.fill(ByteBuffer) would return data or EOF. |
Connection |
getConnection() |
long |
getCreatedTimeStamp() |
protected FillInterest |
getFillInterest() |
InetSocketAddress |
getLocalAddress() |
InetSocketAddress |
getRemoteAddress() |
protected WriteFlusher |
getWriteFlusher() |
protected abstract boolean |
needsFill() |
void |
onClose()
Callback method invoked when this
EndPoint is close. |
protected void |
onIdleExpired(TimeoutException timeout)
This abstract method is called when the idle timeout has expired.
|
protected abstract void |
onIncompleteFlush() |
void |
onOpen()
Callback method invoked when this
EndPoint is opened. |
void |
setConnection(Connection connection) |
String |
toString() |
void |
write(Callback callback,
ByteBuffer... buffers)
Writes the given buffers via
EndPoint.flush(ByteBuffer...) and invokes callback methods when either
all the data has been flushed or an error occurs. |
checkIdleTimeout, getIdleTimeout, getIdleTimestamp, isOpen, notIdle, setIdleTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfill, flush, getIdleTimeout, getTransport, isInputShutdown, isOpen, isOutputShutdown, setIdleTimeout, shutdownOutputprotected AbstractEndPoint(Scheduler scheduler, InetSocketAddress local, InetSocketAddress remote)
public long getCreatedTimeStamp()
getCreatedTimeStamp in interface EndPointpublic InetSocketAddress getLocalAddress()
getLocalAddress in interface EndPointEndPoint is bound, or null
if this EndPoint does not represent a network connection.public InetSocketAddress getRemoteAddress()
getRemoteAddress in interface EndPointEndPoint is bound, or null
if this EndPoint does not represent a network connection.public Connection getConnection()
getConnection in interface EndPointConnection associated with this EndPointEndPoint.setConnection(Connection)public void setConnection(Connection connection)
setConnection in interface EndPointconnection - the Connection associated with this EndPointEndPoint.getConnection()public void onOpen()
EndPointCallback method invoked when this EndPoint is opened.
onOpen in interface EndPointonOpen in class IdleTimeoutEndPoint.onClose()public void onClose()
EndPointCallback method invoked when this EndPoint is close.
onClose in interface EndPointonClose in class IdleTimeoutEndPoint.onOpen()public void close()
EndPointpublic void fillInterested(Callback callback) throws IllegalStateException
EndPointRequests callback methods to be invoked when a call to EndPoint.fill(ByteBuffer) would return data or EOF.
fillInterested in interface EndPointcallback - the callback to call when an error occurs or we are readable.ReadPendingException - if another read operation is concurrent.IllegalStateExceptionpublic void write(Callback callback, ByteBuffer... buffers) throws IllegalStateException
EndPointWrites the given buffers via EndPoint.flush(ByteBuffer...) and invokes callback methods when either
all the data has been flushed or an error occurs.
write in interface EndPointcallback - the callback to call when an error occurs or the write completed.buffers - one or more ByteBuffers that will be flushed.WritePendingException - if another write operation is concurrent.IllegalStateExceptionprotected abstract void onIncompleteFlush()
protected abstract boolean needsFill()
throws IOException
IOExceptionprotected FillInterest getFillInterest()
protected WriteFlusher getWriteFlusher()
protected void onIdleExpired(TimeoutException timeout)
IdleTimeoutonIdleExpired in class IdleTimeouttimeout - a TimeoutExceptionCopyright © 1995-2015 Webtide. All Rights Reserved.