Class ShortCutJettyResponse
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.http.jetty.ShortCutJettyResponse
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Allows you to commit the HTTP response immediately rather than at the end of a PoolingWorkflow", tag="service,http,https,jetty") public class ShortCutJettyResponse extends ServiceImp
Allows you to short cutJettyPoolingWorkflowInterceptor
behaviour in aPoolingWorkflow
.Normally, the response is not committed until the workflow is complete. If you have a workflow bound to HTTP that takes a significant amount of time then this can cause arbitrary timeouts within firewalls and proxies. If the client sends a
Expect: 102-Processing
header, then the adapter will automatically send a 102 response every 20 seconds or so until the workflow has finished. This service allows you to shortcut that behaviour and commit a response before the underlying workflow is complete. You will still need to useStandardResponseProducer
prior to using this service.While not strictly enforced, you should consider returning a
202 ACCEPTED
rather than a200 OK
if you are going to send the response before the end of the workflow. This would be the more "correct" behaviour as per the HTTP specifications.In the adapter configuration file this class is aliased as jetty-commit-response which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description ShortCutJettyResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
void
doService(AdaptrisMessage msg)
Apply the service to the message.protected void
initService()
void
prepare()
Prepare for initialisation.-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
-