public abstract class AbstractProcessor<S> extends java.lang.Object implements ActionHook, Processor<S>
Modifier and Type | Field and Description |
---|---|
protected Adapter |
adapter |
protected AsyncStateMachine |
asyncStateMachine |
protected AbstractEndpoint<S> |
endpoint |
protected char[] |
hostNameC |
protected Request |
request |
protected Response |
response |
protected static StringManager |
sm |
protected SocketWrapper<S> |
socketWrapper |
protected UserDataHelper |
userDataHelper |
Modifier | Constructor and Description |
---|---|
protected |
AbstractProcessor()
Intended for use by the Upgrade sub-classes that have no need to
initialise the request, response, etc.
|
|
AbstractProcessor(AbstractEndpoint<S> endpoint) |
Modifier and Type | Method and Description |
---|---|
abstract AbstractEndpoint.Handler.SocketState |
asyncDispatch(SocketStatus status)
Process in-progress Servlet 3.0 Async requests.
|
AbstractEndpoint.Handler.SocketState |
asyncPostProcess() |
void |
errorDispatch() |
abstract AbstractEndpoint.Handler.SocketState |
event(SocketStatus status)
Process in-progress Comet requests.
|
Adapter |
getAdapter()
Get the associated adapter.
|
protected AbstractEndpoint<S> |
getEndpoint()
The endpoint receiving connections that are handled by this processor.
|
protected ErrorState |
getErrorState() |
java.util.concurrent.Executor |
getExecutor()
Obtain the Executor used by the underlying endpoint.
|
protected abstract Log |
getLog() |
int |
getMaxCookieCount() |
Request |
getRequest()
The request associated with this processor.
|
protected SocketWrapper<S> |
getSocketWrapper()
Get the socket wrapper being used.
|
abstract UpgradeToken |
getUpgradeToken() |
boolean |
isAsync() |
abstract boolean |
isComet() |
abstract boolean |
isUpgrade() |
protected void |
parseHost(MessageBytes valueMB) |
protected void |
populateHost()
Called when a host name is not present in the request (e.g.
|
abstract AbstractEndpoint.Handler.SocketState |
process(SocketWrapper<S> socket)
Process HTTP requests.
|
protected abstract void |
registerForEvent(boolean read,
boolean write)
Register the socket for the specified events.
|
protected void |
resetErrorState() |
void |
setAdapter(Adapter adapter)
Set the associated adapter.
|
protected void |
setErrorState(ErrorState errorState,
java.lang.Throwable t)
Update the current error state to the new error state if the new error
state is more severe than the current error state.
|
void |
setMaxCookieCount(int maxCookieCount) |
protected void |
setSocketWrapper(SocketWrapper<S> socketWrapper)
Set the socket wrapper being used.
|
abstract AbstractEndpoint.Handler.SocketState |
upgradeDispatch(SocketStatus status)
Processes data received on a connection that has been through an HTTP
upgrade.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
action
getLeftoverInput, recycle, setSslSupport
protected static final StringManager sm
protected char[] hostNameC
protected Adapter adapter
protected final AsyncStateMachine asyncStateMachine
protected final AbstractEndpoint<S> endpoint
protected final Request request
protected final Response response
protected volatile SocketWrapper<S> socketWrapper
protected final UserDataHelper userDataHelper
protected AbstractProcessor()
public AbstractProcessor(AbstractEndpoint<S> endpoint)
protected void setErrorState(ErrorState errorState, java.lang.Throwable t)
protected void resetErrorState()
protected ErrorState getErrorState()
protected AbstractEndpoint<S> getEndpoint()
public Request getRequest()
getRequest
in interface Processor<S>
public void setAdapter(Adapter adapter)
adapter
- the new adapterpublic Adapter getAdapter()
protected final void setSocketWrapper(SocketWrapper<S> socketWrapper)
protected final SocketWrapper<S> getSocketWrapper()
public java.util.concurrent.Executor getExecutor()
getExecutor
in interface Processor<S>
public AbstractEndpoint.Handler.SocketState asyncPostProcess()
asyncPostProcess
in interface Processor<S>
public void errorDispatch()
errorDispatch
in interface Processor<S>
protected void parseHost(MessageBytes valueMB)
protected void populateHost()
The default implementation is a NO-OP.
public abstract AbstractEndpoint.Handler.SocketState process(SocketWrapper<S> socket) throws java.io.IOException
public abstract AbstractEndpoint.Handler.SocketState event(SocketStatus status) throws java.io.IOException
public abstract AbstractEndpoint.Handler.SocketState asyncDispatch(SocketStatus status)
asyncDispatch
in interface Processor<S>
public abstract AbstractEndpoint.Handler.SocketState upgradeDispatch(SocketStatus status) throws java.io.IOException
upgradeDispatch
in interface Processor<S>
java.io.IOException
public int getMaxCookieCount()
public void setMaxCookieCount(int maxCookieCount)
public abstract UpgradeToken getUpgradeToken()
getUpgradeToken
in interface Processor<S>
protected abstract void registerForEvent(boolean read, boolean write)
read
- Register the socket for read eventswrite
- Register the socket for write eventsprotected abstract Log getLog()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.