public abstract class ChannelEndPoint extends AbstractEndPoint implements ManagedSelector.Selectable
Holds the channel and socket for an NIO endpoint.
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
_currentInterestOps
The current value for
SelectionKey.interestOps(). |
protected int |
_desiredInterestOps
The desired value for
SelectionKey.interestOps(). |
protected SelectionKey |
_key |
protected ManagedSelector |
_selector |
| 构造器和说明 |
|---|
ChannelEndPoint(ByteChannel channel,
ManagedSelector selector,
SelectionKey key,
org.eclipse.jetty.util.thread.Scheduler scheduler) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
doClose() |
int |
fill(ByteBuffer buffer)
Fill the passed buffer with data from this endpoint.
|
boolean |
flush(ByteBuffer... buffers)
Flush data from the passed header/buffer to this endpoint.
|
ByteChannel |
getChannel() |
Object |
getTransport() |
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
|
protected void |
needsFillInterest() |
void |
onClose()
Callback method invoked when this
EndPoint is close. |
protected void |
onIncompleteFlush() |
Runnable |
onSelected()
Callback method invoked when a read or write events has been
detected by the
ManagedSelector for this endpoint. |
String |
toEndPointString() |
void |
updateKey()
Callback method invoked when all the keys selected by the
ManagedSelector for this endpoint have been processed. |
checkFill, checkFlush, close, close, doShutdownInput, doShutdownOutput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getWriteFlusher, isFillInterested, isInputShutdown, isOutputShutdown, onClose, onIdleExpired, onOpen, reset, setConnection, shutdownInput, shutdownOutput, toConnectionString, toString, tryFillInterested, upgrade, writecheckIdleTimeout, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, notIdle, setIdleTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdleTimeout, getLocalAddress, getRemoteAddress, setIdleTimeoutprotected final ManagedSelector _selector
protected final SelectionKey _key
protected int _currentInterestOps
SelectionKey.interestOps().protected int _desiredInterestOps
SelectionKey.interestOps().public ChannelEndPoint(ByteChannel channel, ManagedSelector selector, SelectionKey key, org.eclipse.jetty.util.thread.Scheduler scheduler)
public boolean isOptimizedForDirectBuffers()
EndPointisOptimizedForDirectBuffers 在接口中 EndPointisOptimizedForDirectBuffers 在类中 AbstractEndPointpublic boolean isOpen()
IdleTimeoutisOpen 在接口中 EndPointisOpen 在类中 AbstractEndPointpublic void doClose()
doClose 在类中 AbstractEndPointpublic void onClose()
EndPointCallback method invoked when this EndPoint is close.
onClose 在接口中 EndPointonClose 在类中 AbstractEndPointEndPoint.onOpen()public int fill(ByteBuffer buffer) throws IOException
EndPointfill 在接口中 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 boolean flush(ByteBuffer... buffers) throws IOException
EndPointflush 在接口中 EndPointbuffers - the buffers to flushIOException - If the endpoint is closed or output is shutdown.public ByteChannel getChannel()
public Object getTransport()
getTransport 在接口中 EndPointprotected void needsFillInterest()
needsFillInterest 在类中 AbstractEndPointprotected void onIncompleteFlush()
onIncompleteFlush 在类中 AbstractEndPointpublic Runnable onSelected()
ManagedSelector.SelectableManagedSelector for this endpoint.onSelected 在接口中 ManagedSelector.Selectablepublic void updateKey()
ManagedSelector.SelectableManagedSelector for this endpoint have been processed.updateKey 在接口中 ManagedSelector.Selectablepublic String toEndPointString()
toEndPointString 在类中 AbstractEndPointCopyright © 2017. All rights reserved.