Class ResponseProducerImpl
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageWorkerImp
-
- com.adaptris.core.AdaptrisMessageProducerImp
-
- com.adaptris.core.ProduceOnlyProducerImp
-
- com.adaptris.core.http.jetty.ResponseProducerImpl
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageProducer
,AdaptrisMessageSender
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
- Direct Known Subclasses:
StandardResponseProducer
public abstract class ResponseProducerImpl extends ProduceOnlyProducerImp
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description ResponseProducerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
endpoint(AdaptrisMessage msg)
Return the endpoint that will be derived from the message.protected boolean
flushBuffers()
protected boolean
forwardConnectionException()
@NonNull ContentTypeProvider
getContentTypeProvider()
The Content-Type to send with the response.java.lang.Boolean
getFlushBuffer()
java.lang.Boolean
getForwardConnectionException()
Throw an exception if producing the response fails.@NonNull ResponseHeaderProvider<javax.servlet.http.HttpServletResponse>
getResponseHeaderProvider()
Additional HTTP headers that will be sent as part of the response.java.lang.Boolean
getSendPayload()
Send the current payload as part of the response.protected HttpStatusProvider.Status
getStatus(AdaptrisMessage msg)
@NonNull HttpStatusProvider
getStatusProvider()
The HTTP Status.void
prepare()
Prepare for initialisation.protected boolean
sendPayload()
void
setContentTypeProvider(@NonNull ContentTypeProvider contentTypeProvider)
The Content-Type to send with the response.void
setFlushBuffer(java.lang.Boolean flushBuffer)
void
setForwardConnectionException(java.lang.Boolean forwardConnectionException)
Throw an exception if producing the response fails.void
setResponseHeaderProvider(@NonNull ResponseHeaderProvider<javax.servlet.http.HttpServletResponse> responseHeaderProvider)
Additional HTTP headers that will be sent as part of the response.void
setSendPayload(java.lang.Boolean sendPayload)
Send the current payload as part of the response.void
setStatusProvider(@NonNull HttpStatusProvider statusProvider)
The HTTP Status.<T extends ResponseProducerImpl>
TwithContentTypeProvider(ContentTypeProvider b)
<T extends ResponseProducerImpl>
TwithFlushBuffer(java.lang.Boolean b)
<T extends ResponseProducerImpl>
TwithForwardConnectionException(java.lang.Boolean b)
<T extends ResponseProducerImpl>
TwithResponseHeaderProvider(ResponseHeaderProvider<javax.servlet.http.HttpServletResponse> p)
<T extends ResponseProducerImpl>
TwithSendPayload(java.lang.Boolean b)
<T extends ResponseProducerImpl>
TwithStatusProvider(HttpStatusProvider p)
-
Methods inherited from class com.adaptris.core.ProduceOnlyProducerImp
doProduce, produce, request, request
-
Methods inherited from class com.adaptris.core.AdaptrisMessageProducerImp
createName
-
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
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.ComponentLifecycle
close, init, start, stop
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createQualifier, isTrackingEndpoint
-
-
-
-
Method Detail
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
endpoint
public java.lang.String endpoint(AdaptrisMessage msg) throws ProduceException
Description copied from class:AdaptrisMessageProducerImp
Return the endpoint that will be derived from the message.The purpose of this method is to mitigate the number of changes that need to happen because
ProduceDestination
is being deprecated; boilerplate code can still be present in the parent super-classes w/o impacting concrete sub-classes "too much".- Specified by:
endpoint
in classAdaptrisMessageProducerImp
- Throws:
ProduceException
- See Also:
AdaptrisMessageSender.produce(AdaptrisMessage)
-
withStatusProvider
public <T extends ResponseProducerImpl> T withStatusProvider(HttpStatusProvider p)
-
withResponseHeaderProvider
public <T extends ResponseProducerImpl> T withResponseHeaderProvider(ResponseHeaderProvider<javax.servlet.http.HttpServletResponse> p)
-
withForwardConnectionException
public <T extends ResponseProducerImpl> T withForwardConnectionException(java.lang.Boolean b)
-
forwardConnectionException
protected boolean forwardConnectionException()
-
flushBuffers
protected boolean flushBuffers()
-
withFlushBuffer
public <T extends ResponseProducerImpl> T withFlushBuffer(java.lang.Boolean b)
-
getStatus
protected HttpStatusProvider.Status getStatus(AdaptrisMessage msg)
-
withContentTypeProvider
public <T extends ResponseProducerImpl> T withContentTypeProvider(ContentTypeProvider b)
-
withSendPayload
public <T extends ResponseProducerImpl> T withSendPayload(java.lang.Boolean b)
-
sendPayload
protected boolean sendPayload()
-
getStatusProvider
@NonNull public @NonNull HttpStatusProvider getStatusProvider()
The HTTP Status.
-
setStatusProvider
public void setStatusProvider(@NonNull @NonNull HttpStatusProvider statusProvider)
The HTTP Status.
-
getResponseHeaderProvider
@NonNull public @NonNull ResponseHeaderProvider<javax.servlet.http.HttpServletResponse> getResponseHeaderProvider()
Additional HTTP headers that will be sent as part of the response.
-
setResponseHeaderProvider
public void setResponseHeaderProvider(@NonNull @NonNull ResponseHeaderProvider<javax.servlet.http.HttpServletResponse> responseHeaderProvider)
Additional HTTP headers that will be sent as part of the response.
-
getContentTypeProvider
@NonNull public @NonNull ContentTypeProvider getContentTypeProvider()
The Content-Type to send with the response.
-
setContentTypeProvider
public void setContentTypeProvider(@NonNull @NonNull ContentTypeProvider contentTypeProvider)
The Content-Type to send with the response.
-
getSendPayload
public java.lang.Boolean getSendPayload()
Send the current payload as part of the response.Defaults to true if not explicitly configured.
-
setSendPayload
public void setSendPayload(java.lang.Boolean sendPayload)
Send the current payload as part of the response.Defaults to true if not explicitly configured.
-
getForwardConnectionException
public java.lang.Boolean getForwardConnectionException()
Throw an exception if producing the response fails.When producing the reply to a client; it may be that they have already terminated the connection. By default client disconnections will not generate a
ServiceException
so normal processing continues. Set this to be true if you want error handling to be triggered in this situation. This defaults tofalse
unless explicitly configured.
-
setForwardConnectionException
public void setForwardConnectionException(java.lang.Boolean forwardConnectionException)
Throw an exception if producing the response fails.When producing the reply to a client; it may be that they have already terminated the connection. By default client disconnections will not generate a
ServiceException
so normal processing continues. Set this to be true if you want error handling to be triggered in this situation. This defaults tofalse
unless explicitly configured.
-
getFlushBuffer
public java.lang.Boolean getFlushBuffer()
-
setFlushBuffer
public void setFlushBuffer(java.lang.Boolean flushBuffer)
-
-