org.glassfish.grizzly.nio.tmpselectors
Class TemporarySelectorWriter

java.lang.Object
  extended by org.glassfish.grizzly.AbstractWriter<SocketAddress>
      extended by org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorWriter
All Implemented Interfaces:
Writer<SocketAddress>
Direct Known Subclasses:
TCPNIOTemporarySelectorWriter, UDPNIOTemporarySelectorWriter

public abstract class TemporarySelectorWriter
extends AbstractWriter<SocketAddress>

Author:
oleksiys

Field Summary
protected  TemporarySelectorsEnabledTransport transport
           
 
Constructor Summary
TemporarySelectorWriter(TemporarySelectorsEnabledTransport transport)
           
 
Method Summary
 TemporarySelectorsEnabledTransport getTransport()
           
 void write(Connection connection, SocketAddress dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage,SocketAddress>> completionHandler, PushBackHandler pushBackHandler)
          Method writes the WritableMessage to the specific address.
 void write(Connection connection, SocketAddress dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage,SocketAddress>> completionHandler, PushBackHandler pushBackHandler, long timeout, TimeUnit timeunit)
          Method writes the WritableMessage to the specific address.
protected  long write0(NIOConnection connection, SocketAddress dstAddress, WritableMessage message, WriteResult<WritableMessage,SocketAddress> currentResult, long timeout, TimeUnit timeunit)
          Flush the buffer by looping until the Buffer is empty
protected abstract  long writeNow0(NIOConnection connection, SocketAddress dstAddress, WritableMessage message, WriteResult<WritableMessage,SocketAddress> currentResult)
           
 
Methods inherited from class org.glassfish.grizzly.AbstractWriter
write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

protected final TemporarySelectorsEnabledTransport transport
Constructor Detail

TemporarySelectorWriter

public TemporarySelectorWriter(TemporarySelectorsEnabledTransport transport)
Method Detail

write

public void write(Connection connection,
                  SocketAddress dstAddress,
                  WritableMessage message,
                  CompletionHandler<WriteResult<WritableMessage,SocketAddress>> completionHandler,
                  PushBackHandler pushBackHandler)
Method writes the WritableMessage to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the WritableMessage will be sent to
message - the WritableMessage, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
pushBackHandler - PushBackHandler, which will be notified if message was accepted by transport write queue or refused

write

public void write(Connection connection,
                  SocketAddress dstAddress,
                  WritableMessage message,
                  CompletionHandler<WriteResult<WritableMessage,SocketAddress>> completionHandler,
                  PushBackHandler pushBackHandler,
                  long timeout,
                  TimeUnit timeunit)
Method writes the WritableMessage to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the message will be sent to
message - the WritableMessage, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed

write0

protected long write0(NIOConnection connection,
                      SocketAddress dstAddress,
                      WritableMessage message,
                      WriteResult<WritableMessage,SocketAddress> currentResult,
                      long timeout,
                      TimeUnit timeunit)
               throws IOException
Flush the buffer by looping until the Buffer is empty

Parameters:
connection - the Connection.
dstAddress - the destination address.
message -
currentResult - the result of the write operation
timeout - operation timeout value value
timeunit - the timeout unit
Returns:
The number of bytes written.
Throws:
IOException

getTransport

public TemporarySelectorsEnabledTransport getTransport()

writeNow0

protected abstract long writeNow0(NIOConnection connection,
                                  SocketAddress dstAddress,
                                  WritableMessage message,
                                  WriteResult<WritableMessage,SocketAddress> currentResult)
                           throws IOException
Throws:
IOException


Copyright © 2013 Oracle Corporation. All Rights Reserved.