com.sun.grizzly.portunif
Interface ProtocolHandler

All Known Implementing Classes:
CustomFilterChainProtocolHandler, DefaultFilterChainProtocolHandler, HttpProtocolHandler, SSLFilterChainProtocolHandler, WebProtocolHandler

public interface ProtocolHandler

Once a protocol has been found by a ProtocolFinder

Author:
Jeanfrancois Arcand

Method Summary
 boolean expireKey(SelectionKey key)
          Invoked when the SelectorThread is about to expire a SelectionKey.
 ByteBuffer getByteBuffer()
          Returns ByteBuffer, where PUReadFilter will read data
 String[] getProtocols()
          Return an array of protocols supported by this ProtocolHandler.
 boolean handle(Context context, PUProtocolRequest protocolRequest)
          Handle the current request by either redirecting the request to a new port or by delivering the request to the proper endpoint.
 

Method Detail

getProtocols

String[] getProtocols()
Return an array of protocols supported by this ProtocolHandler.


handle

boolean handle(Context context,
               PUProtocolRequest protocolRequest)
               throws IOException
Handle the current request by either redirecting the request to a new port or by delivering the request to the proper endpoint.

Returns:
true, if connection should be kept alive, false - otherwise
Throws:
IOException

expireKey

boolean expireKey(SelectionKey key)
Invoked when the SelectorThread is about to expire a SelectionKey.

Returns:
true if the SelectorThread should expire the SelectionKey, false if not.

getByteBuffer

ByteBuffer getByteBuffer()
Returns ByteBuffer, where PUReadFilter will read data

Returns:
ByteBuffer


Copyright © 2013 Oracle Corporation. All Rights Reserved.