public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
| Modifier and Type | Method and Description |
|---|---|
void |
checkFill() |
void |
checkFlush() |
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() |
WriteFlusher |
getWriteFlusher() |
boolean |
isFillInterested() |
boolean |
isInputShutdown()
Test if the input is shutdown.
|
boolean |
isOpen()
This abstract method should be called to check if idle timeouts
should still be checked.
|
boolean |
isOptimizedForDirectBuffers()
Is the endpoint optimized for DirectBuffer usage
|
boolean |
isOutputShutdown()
Test if output is shutdown.
|
void |
onClose()
Callback method invoked when this
EndPoint is close. |
void |
onOpen()
Callback method invoked when this
EndPoint is opened. |
void |
setConnection(Connection connection) |
void |
shutdownOutput()
Shutdown the output.
|
String |
toConnectionString() |
String |
toEndPointString() |
String |
toString() |
boolean |
tryFillInterested(Callback callback)
Requests callback methods to be invoked when a call to
EndPoint.fill(ByteBuffer) would return data or EOF. |
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. |
getIdleFor, getIdleTimeout, getScheduler, notIdle, setIdleTimeoutequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfill, flush, getIdleTimeout, getLocalAddress, getRemoteAddress, getTransport, setIdleTimeoutpublic final void shutdownOutput()
EndPointThis call indicates that no more data will be sent on this endpoint that that the remote end should read an EOF once all previously sent data has been consumed. Shutdown may be done either at the TCP/IP level, as a protocol exchange (Eg TLS close handshake) or both.
If the endpoint has EndPoint.isInputShutdown() true, then this call has the same effect
as EndPoint.close().
shutdownOutput in interface EndPointpublic final void close()
EndPointpublic boolean isOutputShutdown()
EndPointEndPoint.shutdownOutput()
or EndPoint.close().isOutputShutdown in interface EndPointpublic boolean isInputShutdown()
EndPointEndPoint.fill(ByteBuffer). Once the input is shutdown, all calls to
EndPoint.fill(ByteBuffer) will return -1, until such time as the
end point is close, when they will return EofException.isInputShutdown in interface EndPointpublic boolean isOpen()
IdleTimeoutisOpen in interface EndPointisOpen in class IdleTimeoutpublic void checkFlush()
throws IOException
IOExceptionpublic void checkFill()
throws IOException
IOExceptionpublic long getCreatedTimeStamp()
getCreatedTimeStamp in interface EndPointpublic 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 fillInterested(Callback callback)
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. The callback may implement the Invocable interface to
self declare its blocking status. Non-blocking callbacks may be called more efficiently without dispatch delays.public boolean tryFillInterested(Callback callback)
EndPointRequests callback methods to be invoked when a call to EndPoint.fill(ByteBuffer) would return data or EOF.
tryFillInterested in interface EndPointcallback - the callback to call when an error occurs or we are readable. The callback may implement the Invocable interface to
self declare its blocking status. Non-blocking callbacks may be called more efficiently without dispatch delays.public 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. The callback may implement the Invocable interface to
self declare its blocking status. Non-blocking callbacks may be called more efficiently without dispatch delays.buffers - one or more ByteBuffers that will be flushed.WritePendingException - if another write operation is concurrent.IllegalStateExceptionpublic FillInterest getFillInterest()
public WriteFlusher getWriteFlusher()
public void upgrade(Connection newConnection)
EndPointConnection.UpgradeFrom then
a prefilled buffer is requested and passed to the newConnection if it is an instance
of Connection.UpgradeTopublic String toEndPointString()
public String toConnectionString()
Copyright © 2010 - 2020 Adobe. All Rights Reserved