Class BasicJettyConsumer
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,StateManagedComponent
- Direct Known Subclasses:
JettyMessageConsumer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
static interface
-
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ServletWrapper
void
close()
Closes the component.Provides the metadata key '"jettyURI"' that contains the URI which triggered the consumer.abstract AdaptrisMessage
createMessage
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Create an AdaptrisMessage from the incoming servlet request and response.protected String
Comma separated string of valid methods.getPath()
The path we register against jetty for this consumervoid
init()
Initialises the component.protected void
logHeaders
(javax.servlet.http.HttpServletRequest req) void
prepare()
Prepare for initialisation.protected String
void
setAdditionalDebug
(Boolean additionalDebug) void
setMethods
(String methods) Comma separated string of valid methods.void
The path we register against jetty for this consumervoid
If required send a 102 upon this interval.void
setTimeoutAction
(TimeoutAction action) Set the behaviour that should occur when the workflow takes too long to finish.void
Log a warning after this interval.void
start()
Starts the component.void
stop()
Stop the componentprotected String
<T extends BasicJettyConsumer>
TMethods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, newThreadName, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Constructor Details
-
BasicJettyConsumer
public BasicJettyConsumer()
-
-
Method Details
-
servletPath
-
validMethods
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
createMessage
public abstract AdaptrisMessage createMessage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException Create an AdaptrisMessage from the incoming servlet request and response.- Parameters:
request
- the HttpServletRequestresponse
- the HttpServletResponse- Returns:
- an AdaptrisMessage instance.
- Throws:
IOException
javax.servlet.ServletException
- See Also:
-
HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
-
logHeaders
protected void logHeaders(javax.servlet.http.HttpServletRequest req) -
asServletWrapper
- Throws:
CoreException
-
ensureIsPath
- Throws:
CoreException
-
init
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
-
start
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
-
stop
public void stop()Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- See Also:
-
close
public void close()Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- See Also:
-
getTimeoutAction
-
setTimeoutAction
Set the behaviour that should occur when the workflow takes too long to finish.This setting only has an impact if the consumer is the entry point for a
PoolingWorkflow
instance. In the event that the wait time is exceeded, then the behaviour specified here is done.- Parameters:
action
- the action; default is a 202 after 10 minutes.
-
getAdditionalDebug
-
setAdditionalDebug
-
getWarnAfter
- Returns:
- the warnAfter
-
setWarnAfter
Log a warning after this interval.- Parameters:
t
- the warnAfter to set, default is to never warn.
-
getSendProcessingInterval
- Returns:
- the sendExpectEvery
-
setSendProcessingInterval
If required send a 102 upon this interval.- Parameters:
t
- the sendExpectEvery to set, default is 20 seconds.
-
consumeLocationKey
Provides the metadata key '"jettyURI"' that contains the URI which triggered the consumer.- Returns:
- the metadata key;
- Since:
- 3.9.0
-
withPath
-
getPath
The path we register against jetty for this consumer -
setPath
The path we register against jetty for this consumer -
getMethods
Comma separated string of valid methods. -
setMethods
Comma separated string of valid methods.
-