public static class ProxyConnectionFactory.ProxyEndPoint extends AttributesMap implements EndPoint
| Constructor and Description |
|---|
ProxyEndPoint(EndPoint endp,
InetSocketAddress remote,
InetSocketAddress local) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close any backing stream associated with the endpoint
|
int |
fill(ByteBuffer buffer)
Fill the passed buffer with data from this endpoint.
|
void |
fillInterested(Callback callback)
Requests callback methods to be invoked when a call to
EndPoint.fill(ByteBuffer) would return data or EOF. |
boolean |
flush(ByteBuffer... buffer)
Flush data from the passed header/buffer to this endpoint.
|
Connection |
getConnection() |
long |
getCreatedTimeStamp() |
long |
getIdleTimeout()
Get the max idle time in ms.
|
InetSocketAddress |
getLocalAddress() |
InetSocketAddress |
getRemoteAddress() |
Object |
getTransport() |
boolean |
isFillInterested() |
boolean |
isInputShutdown()
Test if the input is shutdown.
|
boolean |
isOpen() |
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 |
setIdleTimeout(long idleTimeout)
Set the idle timeout.
|
void |
shutdownOutput()
Shutdown the output.
|
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. |
addAll, clearAttributes, dump, dump, getAttribute, getAttributeEntrySet, getAttributeNames, getAttributeNamesCopy, getAttributeNameSet, removeAttribute, setAttribute, sizeequals, getClass, hashCode, notify, notifyAll, wait, wait, waitdump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, namedpublic ProxyEndPoint(EndPoint endp, InetSocketAddress remote, InetSocketAddress local)
public void close()
EndPointpublic int fill(ByteBuffer buffer) throws IOException
EndPointfill in interface EndPointbuffer - The buffer to fill. The position and limit are modified during the fill. After the
operation, the position is unchanged and the limit is increased to reflect the new data filled.int value indicating the number of bytes
filled or -1 if EOF is read or the input is shutdown.IOException - if the endpoint is closed.public void fillInterested(Callback callback) throws ReadPendingException
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.ReadPendingException - if another read operation is concurrent.public boolean flush(ByteBuffer... buffer) throws IOException
EndPointflush in interface EndPointbuffer - the buffers to flushIOException - If the endpoint is closed or output is shutdown.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 long getCreatedTimeStamp()
getCreatedTimeStamp in interface EndPointpublic long getIdleTimeout()
EndPointThe max idle time is the time the endpoint can be idle before extraordinary handling takes place.
getIdleTimeout in interface EndPointpublic void setIdleTimeout(long idleTimeout)
EndPointsetIdleTimeout in interface EndPointidleTimeout - the idle timeout in MS. Timeout <= 0 implies an infinite timeoutpublic 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 Object getTransport()
getTransport in interface EndPointpublic boolean isFillInterested()
isFillInterested in interface EndPointEndPoint.fillInterested(Callback) has been called, but EndPoint.fill(ByteBuffer) has not yet
been calledpublic 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 isOptimizedForDirectBuffers()
EndPointisOptimizedForDirectBuffers in interface EndPointpublic boolean isOutputShutdown()
EndPointEndPoint.shutdownOutput()
or EndPoint.close().isOutputShutdown in interface EndPointpublic void onClose()
EndPointCallback method invoked when this EndPoint is close.
onClose in interface EndPointEndPoint.onOpen()public void onOpen()
EndPointCallback method invoked when this EndPoint is opened.
onOpen in interface EndPointEndPoint.onClose()public 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 String toString()
toString in class AttributesMappublic 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 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 void write(Callback callback, ByteBuffer... buffers) throws WritePendingException
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.Copyright © 2010 - 2020 Adobe. All Rights Reserved