org.apache.camel.component.sjms
Class SjmsConsumer

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer
          extended by org.apache.camel.component.sjms.SjmsConsumer
All Implemented Interfaces:
org.apache.camel.Consumer, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class SjmsConsumer
extends org.apache.camel.impl.DefaultConsumer

The SjmsConsumer is the base class for the SJMS MessageListener pool.


Nested Class Summary
protected  class SjmsConsumer.MessageConsumerPool
          A pool of MessageConsumerResources created at the initialization of the associated consumer.
protected  class SjmsConsumer.MessageConsumerResources
           
 
Field Summary
protected  SjmsConsumer.MessageConsumerPool consumers
           
 
Fields inherited from class org.apache.camel.impl.DefaultConsumer
log
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
SjmsConsumer(org.apache.camel.Endpoint endpoint, org.apache.camel.Processor processor)
           
 
Method Summary
protected  javax.jms.MessageListener createMessageHandler(javax.jms.Session session)
          Helper factory method used to create a MessageListener based on the MEP
protected  void doStart()
           
protected  void doStop()
           
 int getAcknowledgementMode()
           
protected  ConnectionResource getConnectionResource()
           
 int getConsumerCount()
          Returns the number of consumer listeners.
 String getDestinationName()
          The destination name for this consumer.
 String getDurableSubscriptionId()
          Gets the durable subscription Id.
 SjmsEndpoint getEndpoint()
           
 String getMessageSelector()
          Gets the JMS Message selector syntax.
protected  SessionPool getSessionPool()
           
 int getTransactionBatchCount()
          If transacted, returns the nubmer of messages to be processed before committing the transaction.
 long getTransactionBatchTimeout()
          Returns the timeout value for batch transactions.
 TransactionCommitStrategy getTransactionCommitStrategy()
          Gets the commit strategy.
 boolean isSynchronous()
          Use to determine whether or not to process exchanges synchronously.
 boolean isTopic()
          Flag set by the endpoint used by consumers and producers to determine if the consumer is a JMS Topic.
 boolean isTransacted()
          Use to determine if transactions are enabled or disabled.
 
Methods inherited from class org.apache.camel.impl.DefaultConsumer
getAsyncProcessor, getExceptionHandler, getProcessor, handleException, handleException, setExceptionHandler, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Field Detail

consumers

protected SjmsConsumer.MessageConsumerPool consumers
Constructor Detail

SjmsConsumer

public SjmsConsumer(org.apache.camel.Endpoint endpoint,
                    org.apache.camel.Processor processor)
Method Detail

getEndpoint

public SjmsEndpoint getEndpoint()
Specified by:
getEndpoint in interface org.apache.camel.Consumer
Overrides:
getEndpoint in class org.apache.camel.impl.DefaultConsumer

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class org.apache.camel.impl.DefaultConsumer
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class org.apache.camel.impl.DefaultConsumer
Throws:
Exception

createMessageHandler

protected javax.jms.MessageListener createMessageHandler(javax.jms.Session session)
Helper factory method used to create a MessageListener based on the MEP

Parameters:
session - a session is only required if we are a transacted consumer
Returns:
the listener

getConnectionResource

protected ConnectionResource getConnectionResource()

getSessionPool

protected SessionPool getSessionPool()

getAcknowledgementMode

public int getAcknowledgementMode()

isTransacted

public boolean isTransacted()
Use to determine if transactions are enabled or disabled.

Returns:
true if transacted, otherwise false

isSynchronous

public boolean isSynchronous()
Use to determine whether or not to process exchanges synchronously.

Returns:
true if synchronous

getDestinationName

public String getDestinationName()
The destination name for this consumer.

Returns:
String

getConsumerCount

public int getConsumerCount()
Returns the number of consumer listeners.

Returns:
the consumerCount

isTopic

public boolean isTopic()
Flag set by the endpoint used by consumers and producers to determine if the consumer is a JMS Topic.

Returns:
the topic true if consumer is a JMS Topic, default is false

getMessageSelector

public String getMessageSelector()
Gets the JMS Message selector syntax.


getDurableSubscriptionId

public String getDurableSubscriptionId()
Gets the durable subscription Id.

Returns:
the durableSubscriptionId

getTransactionCommitStrategy

public TransactionCommitStrategy getTransactionCommitStrategy()
Gets the commit strategy.

Returns:
the transactionCommitStrategy

getTransactionBatchCount

public int getTransactionBatchCount()
If transacted, returns the nubmer of messages to be processed before committing the transaction.

Returns:
the transactionBatchCount

getTransactionBatchTimeout

public long getTransactionBatchTimeout()
Returns the timeout value for batch transactions.

Returns:
long


Apache Camel