com.sun.grizzly.http.portunif
Class HttpProtocolHandler
java.lang.Object
com.sun.grizzly.http.portunif.HttpProtocolHandler
- All Implemented Interfaces:
- ProtocolHandler
public class HttpProtocolHandler
- extends java.lang.Object
- implements ProtocolHandler
Redirect the request to the proper protocol, which can be http or https.
- Author:
- Jeanfrancois Arcand, Alexey Stashok
|
Field Summary |
protected java.lang.String[][] |
protocols
The protocols supported by this handler. |
|
Method Summary |
boolean |
expireKey(java.nio.channels.SelectionKey key)
Invoked when the SelectorThread is about to expire a SelectionKey. |
java.nio.ByteBuffer |
getByteBuffer()
|
java.lang.String[] |
getProtocols()
Returns an array of supported protocols. |
boolean |
handle(Context context,
PUProtocolRequest protocolRequest)
Redirect the request to the protocol defined in the
protocolInfo. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
protocols
protected java.lang.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 java.io.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:
java.io.IOException
getProtocols
public java.lang.String[] getProtocols()
- Returns an array of supported protocols.
- Specified by:
getProtocols in interface ProtocolHandler
- Returns:
- an array of supported protocols.
expireKey
public boolean expireKey(java.nio.channels.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 java.nio.ByteBuffer getByteBuffer()
- Specified by:
getByteBuffer in interface ProtocolHandler
Copyright © 2012 Oracle Corporation. All Rights Reserved.