Package org.apache.camel.component.sjms
Class SjmsProducer
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultProducer
-
- org.apache.camel.support.DefaultAsyncProducer
-
- org.apache.camel.component.sjms.SjmsProducer
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.AsyncProcessor
,org.apache.camel.AsyncProducer
,org.apache.camel.EndpointAware
,org.apache.camel.IsSingleton
,org.apache.camel.Processor
,org.apache.camel.Producer
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
InOnlyProducer
,InOutProducer
public abstract class SjmsProducer extends org.apache.camel.support.DefaultAsyncProducer
Base SjmsProducer class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SjmsProducer.CloseProducerCallback
protected class
SjmsProducer.MessageProducerResourcesFactory
TheMessageProducerResources
pool for allSjmsProducer
classes.protected static interface
SjmsProducer.ReleaseProducerCallback
protected class
SjmsProducer.ReturnProducerCallback
-
Constructor Summary
Constructors Constructor Description SjmsProducer(org.apache.camel.Endpoint endpoint)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected javax.jms.Session
createSession()
protected MessageProducerResources
doCreateProducerModel(javax.jms.Session session)
protected void
doStart()
protected void
doStop()
int
getAcknowledgeMode()
Gets the acknowledgment mode for this instance of DestinationProducer.protected TransactionCommitStrategy
getCommitStrategy()
Gets commitStrategy for this instance of SjmsProducer.protected ConnectionResource
getConnectionResource()
Deprecated.int
getConsumerCount()
Gets consumerCount for this instance of SjmsProducer.String
getDestinationName()
Gets the destinationName for this instance of DestinationProducer.SjmsEndpoint
getEndpoint()
ExecutorService
getExecutor()
Gets the executor for this instance of SjmsProducer.String
getNamedReplyTo()
Returns the named reply to value for this producerprotected ConnectionResource
getOrCreateConnectionResource()
int
getProducerCount()
Gets the producerCount for this instance of SjmsProducer.org.apache.commons.pool.impl.GenericObjectPool<MessageProducerResources>
getProducers()
Gets the MessageProducerPool value of producers for this instance of SjmsProducer.String
getReplyTo()
Gets the replyTo for this instance of DestinationProducer.long
getResponseTimeOut()
Gets responseTimeOut for this instance of SjmsProducer.long
getTtl()
Gets the ttl for this instance of SjmsProducer.boolean
isEndpointTransacted()
Test to determine if this endpoint should use a JMS Transaction.boolean
isPersistent()
Gets the boolean value of persistent for this instance of SjmsProducer.boolean
isSharedJMSSession()
Test to determine if this endpoint should share a JMS Session with other SJMS endpoints.boolean
isSynchronous()
Gets the synchronous value for this instance of DestinationProducer.boolean
isTopic()
Test to verify if this endpoint is a JMS Topic or Queue.boolean
process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
abstract void
sendMessage(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, MessageProducerResources producer, SjmsProducer.ReleaseProducerCallback releaseProducerCallback)
void
setProducers(org.apache.commons.pool.impl.GenericObjectPool<MessageProducerResources> producers)
Sets the producer pool for this instance of SjmsProducer.-
Methods inherited from class org.apache.camel.support.DefaultProducer
createExchange, isSingleton, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.DefaultProducer
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultProducer
- Throws:
Exception
-
getEndpoint
public SjmsEndpoint getEndpoint()
- Specified by:
getEndpoint
in interfaceorg.apache.camel.EndpointAware
- Overrides:
getEndpoint
in classorg.apache.camel.support.DefaultProducer
-
doCreateProducerModel
protected MessageProducerResources doCreateProducerModel(javax.jms.Session session) throws Exception
- Throws:
Exception
-
sendMessage
public abstract void sendMessage(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, MessageProducerResources producer, SjmsProducer.ReleaseProducerCallback releaseProducerCallback) throws Exception
- Throws:
Exception
-
process
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
-
getConnectionResource
@Deprecated protected ConnectionResource getConnectionResource()
Deprecated.
-
getOrCreateConnectionResource
protected ConnectionResource getOrCreateConnectionResource()
-
getAcknowledgeMode
public int getAcknowledgeMode()
Gets the acknowledgment mode for this instance of DestinationProducer.- Returns:
- int
-
isSynchronous
public boolean isSynchronous()
Gets the synchronous value for this instance of DestinationProducer.- Returns:
- true if synchronous, otherwise false
-
getReplyTo
public String getReplyTo()
Gets the replyTo for this instance of DestinationProducer.- Returns:
- String
-
getDestinationName
public String getDestinationName()
Gets the destinationName for this instance of DestinationProducer.- Returns:
- String
-
setProducers
public void setProducers(org.apache.commons.pool.impl.GenericObjectPool<MessageProducerResources> producers)
Sets the producer pool for this instance of SjmsProducer.- Parameters:
producers
- A MessageProducerPool
-
getProducers
public org.apache.commons.pool.impl.GenericObjectPool<MessageProducerResources> getProducers()
Gets the MessageProducerPool value of producers for this instance of SjmsProducer.- Returns:
- the producers
-
isTopic
public boolean isTopic()
Test to verify if this endpoint is a JMS Topic or Queue.- Returns:
- true if it is a Topic, otherwise it is a Queue
-
isEndpointTransacted
public boolean isEndpointTransacted()
Test to determine if this endpoint should use a JMS Transaction.- Returns:
- true if transacted, otherwise false
-
isSharedJMSSession
public boolean isSharedJMSSession()
Test to determine if this endpoint should share a JMS Session with other SJMS endpoints.- Returns:
- true if shared, otherwise false
-
getNamedReplyTo
public String getNamedReplyTo()
Returns the named reply to value for this producer- Returns:
- true if it is a Topic, otherwise it is a Queue
-
getProducerCount
public int getProducerCount()
Gets the producerCount for this instance of SjmsProducer.- Returns:
- int
-
getConsumerCount
public int getConsumerCount()
Gets consumerCount for this instance of SjmsProducer.- Returns:
- int
-
getExecutor
public ExecutorService getExecutor()
Gets the executor for this instance of SjmsProducer.- Returns:
- ExecutorService
-
getTtl
public long getTtl()
Gets the ttl for this instance of SjmsProducer.- Returns:
- long
-
isPersistent
public boolean isPersistent()
Gets the boolean value of persistent for this instance of SjmsProducer.- Returns:
- true if persistent, otherwise false
-
getResponseTimeOut
public long getResponseTimeOut()
Gets responseTimeOut for this instance of SjmsProducer.- Returns:
- long
-
getCommitStrategy
protected TransactionCommitStrategy getCommitStrategy()
Gets commitStrategy for this instance of SjmsProducer.- Returns:
- TransactionCommitStrategy
-
-