Buffer to Connection.
There are two basic Writer implementations in Grizzly: org.glassfish.grizzly.asyncqueue.AsyncQueueWriter ,
org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter .
| Modifier and Type | Class and Description |
|---|---|
| public static class | Writer.
Write reentrants counter |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the connection has not exceeded it's maximum size in bytes of pending writes, otherwise
falsethe connection)Connection to test whether or not the specified number of bytes can be written to.Return |
| public void | notifyWritePossible(final Connection<L> connection, final WriteHandler
WriteHandler to be notified.Registers |
| public GrizzlyFuture | Returns: Future, using which it's possible to check the resultthe connection, WritableMessage org. to write tothe message)WritableMessage, from which the data will be writtenMethod writes the |
| public void | write(Connection<L>
the connection, WritableMessage org. to write tothe message, CompletionHandler<WriteResult<WritableMessage, L>> WritableMessage, from which the data will be writtenorg., which will get notified, when write will be
completedMethod writes the |
| public GrizzlyFuture | Returns: Future, using which it's possible to check the resultthe connection, L org. to write tothe destination address the dstAddress, WritableMessage WritableMessage will be sent tothe message)WritableMessage, from which the data will be writtenMethod writes the |
| public void | write(Connection<L>
the connection, L org. to write tothe destination address the dstAddress, WritableMessage WritableMessage will be sent tothe message, CompletionHandler<WriteResult<WritableMessage, L>> WritableMessage, from which the data will be writtenorg., which will get notified, when write will be
completedMethod writes the |
| public void | write(Connection<L>
the connection, L org. to write tothe destination address the dstAddress, WritableMessage WritableMessage will be sent tothe message, CompletionHandler<WriteResult<WritableMessage, L>> WritableMessage, from which the data will be writtenorg., which will get notified, when write will be
completedorg., which will be notified if message
was accepted by transport write queue or refused
Deprecated
push back logic is deprecated
Method writes the |
| public void | write(Connection<L>
the connection, L org. to write tothe destination address the dstAddress, WritableMessage WritableMessage will be sent tothe message, CompletionHandler<WriteResult<WritableMessage, L>> WritableMessage, from which the data will be writtenorg., which will get notified, when write will be
completedthe messageCloner)MessageCloner, which will be able to clone the message in case it can't be
completely written in the current thread.Method writes the |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(final Connection<L> connection) Return
| |
| notifyWritePossible | back to summary |
|---|---|
| public void notifyWritePossible(final Connection<L> connection, final WriteHandler writeHandler) Registers
| |
| write | back to summary |
|---|---|
| public GrizzlyFuture Method writes the
| |
| write | back to summary |
|---|---|
| public void write(Connection<L> connection, WritableMessage message, CompletionHandler<WriteResult<WritableMessage, L>> completionHandler) Method writes the
| |
| write | back to summary |
|---|---|
| public GrizzlyFuture Method writes the
| |
| write | back to summary |
|---|---|
| public void write(Connection<L> connection, L dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage, L>> completionHandler) Method writes the
| |
| write | back to summary |
|---|---|
| public void write(Connection<L> connection, L dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage, L>> completionHandler, PushBackHandler pushBackHandler)
Deprecated push back logic is deprecated Method writes the
| |
| write | back to summary |
|---|---|
| public void write(Connection<L> connection, L dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage, L>> completionHandler, MessageCloner<WritableMessage> messageCloner) Method writes the
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final int | |
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the counter (after decrementing) didn't reachgetMaxReentrants() limit, or
false otherwise.Decrements the reentrants counter by one. |
| public int | |
| public static int | Returns: the maximum number of write() method reentrants a thread is allowed to make.Returns the maximum number of write() method reentrants a thread is allowed to made. |
| public static Writer. | |
| public boolean | Returns: true if the counter (after incrementing) didn't reachgetMaxReentrants() limit, or
false otherwise.Increments the reentrants counter by one. |
| public boolean | Returns: true, if max number of write->completion-handler reentrants has been reached for the passedReentrant object, and next write will happen in the separate thread.Returns true, if max number of write->completion-handler reentrants has been reached for the passed
|
| counter | back to summary |
|---|---|
| private int counter | |
| maxWriteReentrants | back to summary |
|---|---|
| private static final int maxWriteReentrants | |
| REENTRANTS_COUNTER | back to summary |
|---|---|
| private static final ThreadLocal<Writer. | |
| Reentrant | back to summary |
|---|---|
| public Reentrant() | |
| dec | back to summary |
|---|---|
| public boolean dec() Decrements the reentrants counter by one.
| |
| get | back to summary |
|---|---|
| public int get() Returns the value of the reentrants counter for the current thread. | |
| getMaxReentrants | back to summary |
|---|---|
| public static int getMaxReentrants() Returns the maximum number of write() method reentrants a thread is allowed to made. This is related to possible write()->onComplete()->write()->... chain, which may grow infinitely and cause StackOverflow. Using maxWriteReentrants value it's possible to limit such a chain.
| |
| getWriteReentrant | back to summary |
|---|---|
| public static Writer. Returns the current write reentrants counter. Might be useful, if developer wants to use custom notification
mechanism, based on on | |
| inc | back to summary |
|---|---|
| public boolean inc() Increments the reentrants counter by one.
| |
| isMaxReentrantsReached | back to summary |
|---|---|
| public boolean isMaxReentrantsReached() Returns true, if max number of write->completion-handler reentrants has been reached for the passed
| |