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() |
FillInterest |
getFillInterest() |
InetSocketAddress |
getLocalAddress() |
InetSocketAddress |
getRemoteAddress() |
protected WriteFlusher |
getWriteFlusher() |
boolean |
isFillInterested() |
boolean |
isOptimizedForDirectBuffers()
Is the endpoint optimized for DirectBuffer usage
|
protected abstract void |
needsFillInterest() |
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 |
upgrade(Connection newConnection)
Upgrade connections.
|
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, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, 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(),
EndPoint.upgrade(Connection)public boolean isOptimizedForDirectBuffers()
EndPointisOptimizedForDirectBuffers in interface EndPointpublic 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 boolean isFillInterested()
isFillInterested in interface EndPointEndPoint.fillInterested(Callback) has been called, but EndPoint.fill(ByteBuffer) has not yet
been calledpublic 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 void needsFillInterest()
throws IOException
IOExceptionpublic FillInterest getFillInterest()
protected WriteFlusher getWriteFlusher()
protected void onIdleExpired(TimeoutException timeout)
IdleTimeoutonIdleExpired in class IdleTimeouttimeout - a TimeoutExceptionpublic void upgrade(Connection newConnection)
EndPointConnection.UpgradeFrom then
a prefilled buffer is requested and passed to the newConnection if it is an instance
of Connection.UpgradeToCopyright © 1995-2015 Webtide. All Rights Reserved.