com.sun.grizzly.http.portunif
Class HttpProtocolHandler
java.lang.Object
com.sun.grizzly.http.portunif.HttpProtocolHandler
- All Implemented Interfaces:
- ProtocolHandler
public class HttpProtocolHandler
- extends Object
- implements ProtocolHandler
Redirect the request to the proper protocol, which can be http or https.
- Author:
- Jeanfrancois Arcand, Alexey Stashok
Field Summary |
protected String[][] |
protocols
The protocols supported by this handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
protocols
protected String[][] protocols
- The protocols supported by this handler.
HttpProtocolHandler
public HttpProtocolHandler()
HttpProtocolHandler
public HttpProtocolHandler(HttpProtocolHandler.Mode mode)
handle
public boolean handle(Context context,
PUProtocolRequest protocolRequest)
throws IOException
- Redirect the request to the protocol defined in the
protocolInfo
. Protocols supported are http and https.
- Specified by:
handle
in interface ProtocolHandler
- Parameters:
protocolInfo
- The protocol that needs to be redirected.
- Throws:
IOException
getProtocols
public String[] getProtocols()
- Returns an array of supported protocols.
- Specified by:
getProtocols
in interface ProtocolHandler
- Returns:
- an array of supported protocols.
expireKey
public boolean expireKey(SelectionKey key)
- Invoked when the SelectorThread is about to expire a SelectionKey.
- Specified by:
expireKey
in interface ProtocolHandler
- Returns:
- true if the SelectorThread should expire the SelectionKey, false
if not.
getByteBuffer
public ByteBuffer getByteBuffer()
- Specified by:
getByteBuffer
in interface ProtocolHandler
Copyright © 2009 SUN Microsystems. All Rights Reserved.