com.sun.grizzly.filter
Class UDPWriteFilter

java.lang.Object
  extended by com.sun.grizzly.filter.UDPWriteFilter
All Implemented Interfaces:
ProtocolFilter

public class UDPWriteFilter
extends Object
implements ProtocolFilter

Simple ProtocolFilter implementation which write the available bytes and delegate the processing to the next ProtocolFilter in the ProtocolChain. If no bytes are available for write, no new ProtocolHandler will be a invoked and the connection (SelectionKey) will be cancelled.

Author:
Jeanfrancois Arcand

Field Summary
static String UDP_SOCKETADDRESS
           
 
Fields inherited from interface com.sun.grizzly.ProtocolFilter
SUCCESSFUL_READ
 
Constructor Summary
UDPWriteFilter()
           
 
Method Summary
 boolean execute(Context ctx)
          Write available bytes and delegate the processing of them to the next ProtocolFilter in the ProtocolChain.
protected  void log(String msg, Throwable t)
          Log a message/exception.
 boolean postExecute(Context ctx)
          Re-enable the SelectionKey and make sure the ByteBuffer has been cleared.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UDP_SOCKETADDRESS

public static final String UDP_SOCKETADDRESS
See Also:
Constant Field Values
Constructor Detail

UDPWriteFilter

public UDPWriteFilter()
Method Detail

execute

public boolean execute(Context ctx)
                throws IOException
Write available bytes and delegate the processing of them to the next ProtocolFilter in the ProtocolChain.

Specified by:
execute in interface ProtocolFilter
Parameters:
ctx - Context
Returns:
true if the next ProtocolFilter on the ProtocolChain need to bve invoked.
Throws:
IOException

postExecute

public boolean postExecute(Context ctx)
                    throws IOException
Re-enable the SelectionKey and make sure the ByteBuffer has been cleared.

Specified by:
postExecute in interface ProtocolFilter
Parameters:
ctx - Context
Returns:
true if the previous ProtocolFilter postExecute method needs to be invoked.
Throws:
IOException

log

protected void log(String msg,
                   Throwable t)
Log a message/exception.

Parameters:
msg - String
t - Throwable


Copyright © 2010 SUN Microsystems. All Rights Reserved.