Package org.glassfish.grizzly.http.ajp
Class AjpHandlerFilter
java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.http.ajp.AjpHandlerFilter
- All Implemented Interfaces:
Filter
Filter is working as Codec between Ajp and Http packets. In other words it's responsible for decoding Ajp message to
HttpRequestPacket, and encoding HttpResponsePacket to Ajp message back.
- Author:
- Alexey Stashok
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddShutdownHandler(ShutdownHandler handler) Add theShutdownHandler, which will be called, when shutdown request received.voidconfigure(Properties properties) Configure Ajp Filter using properties.If not null, only requests from workers with this secret keyword will be accepted.handleEvent(FilterChainContext ctx, FilterChainEvent event) Handling Http request completion event sent by Http server filter and send the Ajp end response message.Handle the Ajp message.Encoding HttpResponsePacket or HttpContent to Ajp message.booleanIf set to true, the authentication will be done in Grizzly.voidremoveShutdownHandler(ShutdownHandler handler) Remove theShutdownHandler.voidIf not null, only requests from workers with this secret keyword will be accepted.voidsetTomcatAuthentication(boolean isTomcatAuthentication) /** If set to true, the authentication will be done in Grizzly.Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, onAdded, onFilterChainChanged, onRemoved, toString
-
Constructor Details
-
AjpHandlerFilter
public AjpHandlerFilter()
-
-
Method Details
-
configure
Configure Ajp Filter using properties. We support following properties: request.useSecret, request.secret, tomcatAuthentication.- Parameters:
properties-
-
isTomcatAuthentication
public boolean isTomcatAuthentication()If set to true, the authentication will be done in Grizzly. Otherwise, the authenticated principal will be propagated from the native webserver and used for authorization in Grizzly. The default value is true.- Returns:
- true, if the authentication will be done in Grizzly. Otherwise, the authenticated principal will be propagated from the native webserver and used for authorization in Grizzly.
-
setTomcatAuthentication
public void setTomcatAuthentication(boolean isTomcatAuthentication) /** If set to true, the authentication will be done in Grizzly. Otherwise, the authenticated principal will be propagated from the native webserver and used for authorization in Grizzly. The default value is true.- Parameters:
isTomcatAuthentication- if true, the authentication will be done in Grizzly. Otherwise, the authenticated principal will be propagated from the native webserver and used for authorization in Grizzly.
-
getSecret
If not null, only requests from workers with this secret keyword will be accepted.- Returns:
- not null, if only requests from workers with this secret keyword will be accepted, or null otherwise.
-
setSecret
If not null, only requests from workers with this secret keyword will be accepted.- Parameters:
requiredSecret- if not null, only requests from workers with this secret keyword will be accepted.
-
addShutdownHandler
Add theShutdownHandler, which will be called, when shutdown request received.- Parameters:
handler-ShutdownHandler
-
removeShutdownHandler
Remove theShutdownHandler.- Parameters:
handler-ShutdownHandler
-
handleRead
Handle the Ajp message.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx- theFilterChainContextfor the currentFilterChaininvocation.- Returns:
- the
NextAction - Throws:
IOException- if an I/O error occurs
-
handleWrite
Encoding HttpResponsePacket or HttpContent to Ajp message.- Specified by:
handleWritein interfaceFilter- Overrides:
handleWritein classBaseFilter- Parameters:
ctx- theFilterChainContextfor the currentFilterChaininvocation.- Returns:
- the
NextAction - Throws:
IOException- if an I/O error occurs
-
handleEvent
Handling Http request completion event sent by Http server filter and send the Ajp end response message.- Specified by:
handleEventin interfaceFilter- Overrides:
handleEventin classBaseFilter- Parameters:
ctx- theFilterChainContextfor the currentFilterChaininvocation.event- the event triggering the invocation of this method.- Returns:
- the
NextAction. - Throws:
IOException- if an I/O error occurs.
-