Package com.adaptris.core
Class NullMessageProducer
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageWorkerImp
-
- com.adaptris.core.AdaptrisMessageProducerImp
-
- com.adaptris.core.NullMessageProducer
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageProducer
,AdaptrisMessageSender
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
@ComponentProfile(summary="Default NO-OP producer implementation", tag="producer,base", recommended=NullConnection.class) public class NullMessageProducer extends AdaptrisMessageProducerImp
Null implementation of
AdaptrisMessageProducer
.In the adapter configuration file this class is aliased as null-message-producer which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description NullMessageProducer()
-
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.void
prepare()
Prepare for initialisation.void
produce(AdaptrisMessage msg)
Produces theAdaptrisMessage
to the default destination.AdaptrisMessage
request(AdaptrisMessage msg)
Produce theAdaptrisMessage
to the configured destination and blocks indefinitely for a reply.AdaptrisMessage
request(AdaptrisMessage msg, long timeout)
Produces theAdaptrisMessage
and blocks for the specified timeout for a reply.-
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
-
request
public AdaptrisMessage request(AdaptrisMessage msg) throws ProduceException
Description copied from interface:AdaptrisMessageProducer
Produce theAdaptrisMessage
to the configured destination and blocks indefinitely for a reply.- Parameters:
msg
- theAdaptrisMessage
to produce- Returns:
- a reply
AdaptrisMessage
which is generally the same as supplied parameter - Throws:
ProduceException
- wrapping any underlying Exceptions
-
request
public AdaptrisMessage request(AdaptrisMessage msg, long timeout) throws ProduceException
Description copied from interface:AdaptrisMessageProducer
Produces theAdaptrisMessage
and blocks for the specified timeout for a reply.- Parameters:
msg
- theAdaptrisMessage
to producetimeout
- the time to wait for a reply in milliseconds- Returns:
- a reply
AdaptrisMessage
which is generally the same as supplied parameter - Throws:
ProduceException
- wrapping any underlying Exceptions
-
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)
-
produce
public void produce(AdaptrisMessage msg) throws ProduceException
Description copied from interface:AdaptrisMessageSender
Produces theAdaptrisMessage
to the default destination.- Parameters:
msg
- the @link AdaptrisMessage} to produce- Throws:
ProduceException
- wrapping any underlying Exceptions
-
-