|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpyrasun.eio.Endpoint
pyrasun.eio.ReadWriteEndpoint
A ReadWriteEndpoint is an endpoint that represents a socket channel, but has
been cleverly named "ReadWriteEndpoint" to befuddle and confuse you into thinking
it's alot more impressive than it actually is.
In addition to the mechanisms it inherits from the abstract Endpoint class,
ReadWriteEndpoint encapsulates the machinery for managing READ, PROCESS, and WRITE events.
Specifically, it contains the following:
| Constructor Summary | |
ReadWriteEndpoint(EndpointCoordinator coordinator,
java.nio.channels.SocketChannel nioChannel)
Construct a new ReadWriteEndpoint. |
|
| Method Summary | |
void |
abortWrites()
Evil, evil hack. |
void |
addToProcessing(java.lang.Object o)
Adds a new Object to be available as input to a PROCESS event. |
boolean |
arePendingWrites()
Returns true if there are objects sitting in the write queue. |
EIOInputBuffer |
getInputBuffer()
Get the input buffer associated with this endpoint. |
java.nio.channels.SelectableChannel |
getNIOChannel()
Get the NIO channel associated with this endpoint. |
EIOOutputBuffer |
getOutputBuffer()
Get the output buffer associated with this endpoint. |
int |
getProcessingQueueDepth()
|
int |
getWriteQueueDepth()
|
boolean |
isWriteInProgress()
Returns true if a write is in progress or a partial write was performed that needs to be taken care of at some later time. |
boolean |
isWriteQueueEmpty()
Returns the true if the writing object queue is empty. |
boolean |
needsReadPause()
|
java.lang.Object |
nextForProcessing()
Returns the next Object available as input to a PROCESS event. |
java.lang.Object |
nextForWriting()
Returns the next object available as input to a WRITE event. |
boolean |
noReadsForMe()
|
boolean |
noWritesForMe()
|
void |
processingDispatch(boolean meProc)
If no one else is handling PROCESS on this right now, dispatch it for handling |
void |
readPause()
|
void |
setIsWriteInProgress(boolean inProgress)
If 'inProgress' is true, this indicates that a write is in progress right now and hasn't been completed yet. |
void |
write(java.lang.Object o)
Tell EIO to write an object out on this Endpoint. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ReadWriteEndpoint(EndpointCoordinator coordinator,
java.nio.channels.SocketChannel nioChannel)
coordinator - the EndpointCoordinator that defines that kind of Endpoint this is, and how to handle it.nioChannel - The SocketChannel. evil evil evil for a generic beyond-NIO library!| Method Detail |
public java.nio.channels.SelectableChannel getNIOChannel()
Endpoint
getNIOChannel in class Endpointpublic EIOInputBuffer getInputBuffer()
public EIOOutputBuffer getOutputBuffer()
public java.lang.Object nextForProcessing()
public void addToProcessing(java.lang.Object o)
public boolean needsReadPause()
public void readPause()
public void processingDispatch(boolean meProc)
public java.lang.Object nextForWriting()
public int getWriteQueueDepth()
public int getProcessingQueueDepth()
public boolean isWriteQueueEmpty()
public void write(java.lang.Object o)
throws java.io.IOException
java.io.IOExceptionpublic void setIsWriteInProgress(boolean inProgress)
public boolean isWriteInProgress()
public boolean arePendingWrites()
public void abortWrites()
public boolean noWritesForMe()
public boolean noReadsForMe()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||