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, setIdleTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fill, flush, getIdleTimeout, getTransport, isInputShutdown, isOpen, isOutputShutdown, setIdleTimeout, shutdownOutput
protected AbstractEndPoint(Scheduler scheduler, InetSocketAddress local, InetSocketAddress remote)
public long getCreatedTimeStamp()
getCreatedTimeStamp
in interface EndPoint
public InetSocketAddress getLocalAddress()
getLocalAddress
in interface EndPoint
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.public InetSocketAddress getRemoteAddress()
getRemoteAddress
in interface EndPoint
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.public Connection getConnection()
getConnection
in interface EndPoint
Connection
associated with this EndPoint
EndPoint.setConnection(Connection)
public void setConnection(Connection connection)
setConnection
in interface EndPoint
connection
- the Connection
associated with this EndPoint
EndPoint.getConnection()
public void onOpen()
EndPoint
Callback method invoked when this EndPoint
is opened.
onOpen
in interface EndPoint
onOpen
in class IdleTimeout
EndPoint.onClose()
public void onClose()
EndPoint
Callback method invoked when this EndPoint
is close.
onClose
in interface EndPoint
onClose
in class IdleTimeout
EndPoint.onOpen()
public void close()
EndPoint
public void fillInterested(Callback callback) throws IllegalStateException
EndPoint
Requests callback methods to be invoked when a call to EndPoint.fill(ByteBuffer)
would return data or EOF.
fillInterested
in interface EndPoint
callback
- the callback to call when an error occurs or we are readable.ReadPendingException
- if another read operation is concurrent.IllegalStateException
public void write(Callback callback, ByteBuffer... buffers) throws IllegalStateException
EndPoint
Writes 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 EndPoint
callback
- the callback to call when an error occurs or the write completed.buffers
- one or more ByteBuffer
s that will be flushed.WritePendingException
- if another write operation is concurrent.IllegalStateException
protected abstract void onIncompleteFlush()
protected abstract boolean needsFill() throws IOException
IOException
protected FillInterest getFillInterest()
protected WriteFlusher getWriteFlusher()
protected void onIdleExpired(TimeoutException timeout)
IdleTimeout
onIdleExpired
in class IdleTimeout
timeout
- a TimeoutExceptionCopyright © 1995-2015 Webtide. All Rights Reserved.