Class JmsProducer
- java.lang.Object
- 
- All Implemented Interfaces:
- AdaptrisComponent,- AdaptrisMessageProducer,- AdaptrisMessageSender,- AdaptrisMessageWorker,- ComponentLifecycle,- ComponentLifecycleExtension,- JmsActorConfig,- MessageEventGenerator
 - Direct Known Subclasses:
- JmsAsyncProducer
 
 @ComponentProfile(summary="Place message on a JMS queue or topic", tag="producer,jms", recommended=JmsConnection.class) public class JmsProducer extends JmsProducerImplJMS Producer implementation that can target queues or topics via an RFC6167 style destination.This differs from the standard PtpProducerandPasProducerin that it supports a destination that is specified in RFC6167 style. For instancejms:queue:myQueueNamewill produce to a queue calledmyQueueNameandjms:topic:myTopicNameto a topic calledmyTopicNameWhile RFC6167 defines the ability to use jndi to lookup the (as part of the 'jndi' variant section); this is not supported. The standard deliveryMode, timeToLive, priority, replyToName properties are supported. If not specified, then they will be inherited from the producers configuration. For instance you could have the following destinations: - jms:queue:MyQueueName
- jms:topic:MyTopicName
- jms:queue:MyQueueName?replyToName=StaticReplyTo&priority=1&timeToLive=1234
- jms:topic:MyTopicName?replyToName=StaticReplyTo
 As the RFC6167 string can specify priority, timeToLive and deliveryMode; this producer defaults JmsProducerImpl.getPerMessageProperties()to be true.In the adapter configuration file this class is aliased as jms-producer which is the preferred alternative to the fully qualified classname when building your configuration. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classJmsProducer.MyJmsDestination
 - 
Field Summary- 
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImplog
 
- 
 - 
Constructor SummaryConstructors Constructor Description JmsProducer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JmsDestinationbuildDestination(java.lang.String dest, AdaptrisMessage msg, boolean createReplyTo)Build a JMSDestination.protected javax.jms.DestinationcreateReplyTo(AdaptrisMessage msg, JmsDestination target, boolean createTmpDest)Create a Destination for JMSReplyTo if one doesn't already exist or ifJMS_ASYNC_STATIC_REPLY_TOexists as metadata.java.lang.Stringendpoint(AdaptrisMessage msg)Return the endpoint that will be derived from the message.java.lang.StringgetEndpoint()The JMS Endpoint defined in an RFC6167 manner.booleanperMessageProperties()voidprepare()Prepare for initialisation.voidproduce(AdaptrisMessage msg)Produces theAdaptrisMessageto the default destination.protected voidproduce(AdaptrisMessage msg, JmsDestination jmsDest)voidproduce(AdaptrisMessage msg, java.lang.String dest)AdaptrisMessagerequest(AdaptrisMessage msg, long timeout)Produces theAdaptrisMessageand blocks for the specified timeout for a reply.AdaptrisMessagerequest(AdaptrisMessage msg, java.lang.String dest, long timeout)voidsetEndpoint(java.lang.String endpoint)The JMS Endpoint defined in an RFC6167 manner.protected <T extends VendorImplementationBase>
 TvendorImplementation()protected AdaptrisMessagewaitForReply(javax.jms.MessageConsumer receiver, long timeout)Wait for a reply.<T extends JmsProducer>
 TwithEndpoint(java.lang.String s)- 
Methods inherited from class com.adaptris.core.jms.JmsProducerImplacknowledge, calculateDeliveryMode, calculatePriority, calculateTimeToLive, captureOutgoingMessageDetails, captureOutgoingMessageDetails, close, commit, configuredAcknowledgeMode, configuredCorrelationIdSource, configuredMessageListener, configuredMessageTranslator, currentLogger, currentSession, defaultTimeout, getAcknowledgeMode, getCaptureOutgoingMessageDetails, getCorrelationIdSource, getDeliveryMode, getMessageTranslator, getPerMessageProperties, getPriority, getSessionFactory, getTtl, init, isManagedTransaction, logLinkedException, messagePriority, producerSession, request, retrieveObjectDestination, rollback, rollbackTimeout, setAcknowledgeMode, setCaptureOutgoingMessageDetails, setCorrelationIdSource, setDeliveryMode, setMessageTranslator, setPerMessageProperties, setPriority, setSessionFactory, setTtl, setupSession, start, stop, timeToLive, transactedSession, translate
 - 
Methods inherited from class com.adaptris.core.RequestReplyProducerBasecopyReplyContents, getIgnoreReplyMetadata, mergeReply, setIgnoreReplyMetadata
 - 
Methods inherited from class com.adaptris.core.AdaptrisMessageProducerImpcreateName
 - 
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImpcreateQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.adaptris.core.AdaptrisComponentgetUniqueId
 - 
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorkerdecode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
 - 
Methods inherited from interface com.adaptris.core.MessageEventGeneratorcreateQualifier, isTrackingEndpoint
 
- 
 
- 
- 
- 
Method Detail- 
preparepublic void prepare() throws CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Specified by:
- preparein interface- ComponentLifecycleExtension
- Overrides:
- preparein class- JmsProducerImpl
- Throws:
- CoreException
 
 - 
producepublic void produce(AdaptrisMessage msg, java.lang.String dest) throws ProduceException - Throws:
- ProduceException
 
 - 
produceprotected void produce(AdaptrisMessage msg, JmsDestination jmsDest) throws javax.jms.JMSException, CoreException - Throws:
- javax.jms.JMSException
- CoreException
 
 - 
requestpublic AdaptrisMessage request(AdaptrisMessage msg, java.lang.String dest, long timeout) throws ProduceException - Throws:
- ProduceException
 
 - 
waitForReplyprotected AdaptrisMessage waitForReply(javax.jms.MessageConsumer receiver, long timeout) throws javax.jms.JMSException Wait for a reply.- Parameters:
- receiver- the- MessageConsumer
- timeout- the timeout (ms)
- Returns:
- an AdaptrisMessage translated by the configured MessageTranslator
- Throws:
- javax.jms.JMSException- on Exception (including a timeout exception).
 
 - 
buildDestinationprotected JmsDestination buildDestination(java.lang.String dest, AdaptrisMessage msg, boolean createReplyTo) throws javax.jms.JMSException, CoreException Build a JMSDestination.- Parameters:
- dest- the ProduceDestination
- msg- the message
- createReplyTo- - passed through to- createReplyTo(AdaptrisMessage, JmsDestination, boolean)
- Returns:
- a JMSDestination instanced.
- Throws:
- javax.jms.JMSException
- CoreException
 
 - 
createReplyToprotected javax.jms.Destination createReplyTo(AdaptrisMessage msg, JmsDestination target, boolean createTmpDest) throws javax.jms.JMSException Create a Destination for JMSReplyTo if one doesn't already exist or ifJMS_ASYNC_STATIC_REPLY_TOexists as metadata.- Parameters:
- msg- the message (which will be checked for- JMS_ASYNC_STATIC_REPLY_TO.
- createTmpDest- - create a temporary destination if- JMS_ASYNC_STATIC_REPLY_TOisn't available.
- Returns:
- a javax.jms.Destination
- Throws:
- javax.jms.JMSException
 
 - 
vendorImplementationprotected <T extends VendorImplementationBase> T vendorImplementation() 
 - 
requestpublic AdaptrisMessage request(AdaptrisMessage msg, long timeout) throws ProduceException Description copied from interface:AdaptrisMessageProducerProduces theAdaptrisMessageand blocks for the specified timeout for a reply.- Parameters:
- msg- the- AdaptrisMessageto produce
- timeout- the time to wait for a reply in milliseconds
- Returns:
- a reply AdaptrisMessagewhich is generally the same as supplied parameter
- Throws:
- ProduceException- wrapping any underlying Exceptions
 
 - 
producepublic void produce(AdaptrisMessage msg) throws ProduceException Description copied from interface:AdaptrisMessageSenderProduces theAdaptrisMessageto the default destination.- Parameters:
- msg- the @link AdaptrisMessage} to produce
- Throws:
- ProduceException- wrapping any underlying Exceptions
 
 - 
endpointpublic java.lang.String endpoint(AdaptrisMessage msg) throws ProduceException Description copied from class:AdaptrisMessageProducerImpReturn 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 ProduceDestinationis being deprecated; boilerplate code can still be present in the parent super-classes w/o impacting concrete sub-classes "too much".- Specified by:
- endpointin class- AdaptrisMessageProducerImp
- Throws:
- ProduceException
- See Also:
- AdaptrisMessageSender.produce(AdaptrisMessage)
 
 - 
perMessagePropertiespublic boolean perMessageProperties() - Overrides:
- perMessagePropertiesin class- JmsProducerImpl
 
 - 
withEndpointpublic <T extends JmsProducer> T withEndpoint(java.lang.String s) 
 - 
getEndpointpublic java.lang.String getEndpoint() The JMS Endpoint defined in an RFC6167 manner.
 - 
setEndpointpublic void setEndpoint(java.lang.String endpoint) The JMS Endpoint defined in an RFC6167 manner.
 
- 
 
-