org.apache.camel.component.jms
Class JmsComponent

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultComponent
          extended by org.apache.camel.component.jms.JmsComponent
All Implemented Interfaces:
CamelContextAware, Component, Service, ShutdownableService, HeaderFilterStrategyAware, ApplicationContextAware
Direct Known Subclasses:
AMQPComponent

public class JmsComponent
extends DefaultComponent
implements ApplicationContextAware, HeaderFilterStrategyAware

A JMS Component

Version:
$Revision:520964 $

Constructor Summary
JmsComponent()
           
JmsComponent(CamelContext context)
           
JmsComponent(JmsConfiguration configuration)
           
 
Method Summary
protected  String convertPathToActualDestination(String path, Map<String,Object> parameters)
          A strategy method allowing the URI destination to be translated into the actual JMS destination name (say by looking up in JNDI or something)
protected  JmsConfiguration createConfiguration()
          Factory method to create the default configuration instance
protected  Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters)
          A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters
protected  void doStop()
           
 JmsConfiguration getConfiguration()
           
 HeaderFilterStrategy getHeaderFilterStrategy()
          Gets the header filter strategy used
 QueueBrowseStrategy getQueueBrowseStrategy()
           
static JmsComponent jmsComponent()
          Static builder method
static JmsComponent jmsComponent(ConnectionFactory connectionFactory)
          Static builder method
static JmsComponent jmsComponent(JmsConfiguration configuration)
          Static builder method
static JmsComponent jmsComponentAutoAcknowledge(ConnectionFactory connectionFactory)
          Static builder method
static JmsComponent jmsComponentClientAcknowledge(ConnectionFactory connectionFactory)
          Static builder method
static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory)
           
static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory, PlatformTransactionManager transactionManager)
           
 void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
           
 void setAcknowledgementMode(int consumerAcknowledgementMode)
           
 void setAcknowledgementModeName(String consumerAcknowledgementMode)
           
 void setAlwaysCopyMessage(boolean alwaysCopyMessage)
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setAutoStartup(boolean autoStartup)
           
 void setCacheLevel(int cacheLevel)
           
 void setCacheLevelName(String cacheName)
           
 void setClientId(String consumerClientId)
           
 void setConcurrentConsumers(int concurrentConsumers)
           
 void setConfiguration(JmsConfiguration configuration)
          Sets the JMS configuration
 void setConnectionFactory(ConnectionFactory connectionFactory)
           
 void setConsumerType(ConsumerType consumerType)
           
 void setDeliveryPersistent(boolean deliveryPersistent)
           
 void setDestinationResolver(DestinationResolver destinationResolver)
           
 void setDurableSubscriptionName(String durableSubscriptionName)
           
 void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
           
 void setExceptionListener(ExceptionListener exceptionListener)
           
 void setExplicitQosEnabled(boolean explicitQosEnabled)
           
 void setExposeListenerSession(boolean exposeListenerSession)
           
 void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
          Sets the header filter strategy to use
 void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
           
 void setJmsOperations(JmsOperations jmsOperations)
           
 void setMapJmsMessage(boolean mapJmsMessage)
           
 void setMaxConcurrentConsumers(int maxConcurrentConsumers)
           
 void setMaxMessagesPerTask(int maxMessagesPerTask)
           
 void setMessageConverter(MessageConverter messageConverter)
           
 void setMessageIdEnabled(boolean messageIdEnabled)
           
 void setMessageTimestampEnabled(boolean messageTimestampEnabled)
           
 void setPriority(int priority)
           
 void setPubSubNoLocal(boolean pubSubNoLocal)
           
 void setQueueBrowseStrategy(QueueBrowseStrategy queueBrowseStrategy)
           
 void setReceiveTimeout(long receiveTimeout)
           
 void setRecoveryInterval(long recoveryInterval)
           
 void setRequestTimeout(long requestTimeout)
           
 void setSubscriptionDurable(boolean subscriptionDurable)
          Deprecated. 
 void setTaskExecutor(TaskExecutor taskExecutor)
           
 void setTaskExecutorSpring2(Object taskExecutor)
           
 void setTestConnectionOnStartup(boolean testConnectionOnStartup)
           
 void setTimeToLive(long timeToLive)
           
 void setTransacted(boolean consumerTransacted)
           
 void setTransactionManager(PlatformTransactionManager transactionManager)
           
 void setTransactionName(String transactionName)
           
 void setTransactionTimeout(int transactionTimeout)
           
 void setTransferException(boolean transferException)
           
 void setTransferExchange(boolean transferExchange)
           
 void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)
           
protected static QueueBrowseStrategy tryCreateDefaultQueueBrowseStrategy(CamelContext context)
          Attempts to instantiate the default QueueBrowseStrategy which should work fine if Spring 2.5.x or later is on the classpath but this will fail if 2.0.x are on the classpath.
 
Methods inherited from class org.apache.camel.impl.DefaultComponent
afterConfiguration, createEndpoint, doStart, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, useIntrospectionOnEndpoint, validateParameters, validateURI
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsComponent

public JmsComponent()

JmsComponent

public JmsComponent(CamelContext context)

JmsComponent

public JmsComponent(JmsConfiguration configuration)
Method Detail

jmsComponent

public static JmsComponent jmsComponent()
Static builder method


jmsComponent

public static JmsComponent jmsComponent(JmsConfiguration configuration)
Static builder method


jmsComponent

public static JmsComponent jmsComponent(ConnectionFactory connectionFactory)
Static builder method


jmsComponentClientAcknowledge

public static JmsComponent jmsComponentClientAcknowledge(ConnectionFactory connectionFactory)
Static builder method


jmsComponentAutoAcknowledge

public static JmsComponent jmsComponentAutoAcknowledge(ConnectionFactory connectionFactory)
Static builder method


jmsComponentTransacted

public static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory)

jmsComponentTransacted

public static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory,
                                                  PlatformTransactionManager transactionManager)

getConfiguration

public JmsConfiguration getConfiguration()

setConfiguration

public void setConfiguration(JmsConfiguration configuration)
Sets the JMS configuration

Parameters:
configuration - the configuration to use by default for endpoints

setAcceptMessagesWhileStopping

public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)

setAcknowledgementMode

public void setAcknowledgementMode(int consumerAcknowledgementMode)

setEagerLoadingOfProperties

public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)

setAcknowledgementModeName

public void setAcknowledgementModeName(String consumerAcknowledgementMode)

setAutoStartup

public void setAutoStartup(boolean autoStartup)

setCacheLevel

public void setCacheLevel(int cacheLevel)

setCacheLevelName

public void setCacheLevelName(String cacheName)

setClientId

public void setClientId(String consumerClientId)

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)

setConsumerType

public void setConsumerType(ConsumerType consumerType)

setDeliveryPersistent

public void setDeliveryPersistent(boolean deliveryPersistent)

setDurableSubscriptionName

public void setDurableSubscriptionName(String durableSubscriptionName)

setExceptionListener

public void setExceptionListener(ExceptionListener exceptionListener)

setExplicitQosEnabled

public void setExplicitQosEnabled(boolean explicitQosEnabled)

setExposeListenerSession

public void setExposeListenerSession(boolean exposeListenerSession)

setIdleTaskExecutionLimit

public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)

setMaxConcurrentConsumers

public void setMaxConcurrentConsumers(int maxConcurrentConsumers)

setMaxMessagesPerTask

public void setMaxMessagesPerTask(int maxMessagesPerTask)

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)

setMapJmsMessage

public void setMapJmsMessage(boolean mapJmsMessage)

setMessageIdEnabled

public void setMessageIdEnabled(boolean messageIdEnabled)

setMessageTimestampEnabled

public void setMessageTimestampEnabled(boolean messageTimestampEnabled)

setAlwaysCopyMessage

public void setAlwaysCopyMessage(boolean alwaysCopyMessage)

setUseMessageIDAsCorrelationID

public void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)

setPriority

public void setPriority(int priority)

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)

setRecoveryInterval

public void setRecoveryInterval(long recoveryInterval)

setSubscriptionDurable

@Deprecated
public void setSubscriptionDurable(boolean subscriptionDurable)
Deprecated. 


setTaskExecutor

public void setTaskExecutor(TaskExecutor taskExecutor)

setTaskExecutorSpring2

public void setTaskExecutorSpring2(Object taskExecutor)

setTimeToLive

public void setTimeToLive(long timeToLive)

setTransacted

public void setTransacted(boolean consumerTransacted)

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)

setTransactionName

public void setTransactionName(String transactionName)

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)

setTestConnectionOnStartup

public void setTestConnectionOnStartup(boolean testConnectionOnStartup)

setRequestTimeout

public void setRequestTimeout(long requestTimeout)

setTransferExchange

public void setTransferExchange(boolean transferExchange)

setTransferException

public void setTransferException(boolean transferException)

setJmsOperations

public void setJmsOperations(JmsOperations jmsOperations)

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

getQueueBrowseStrategy

public QueueBrowseStrategy getQueueBrowseStrategy()

setQueueBrowseStrategy

public void setQueueBrowseStrategy(QueueBrowseStrategy queueBrowseStrategy)

getHeaderFilterStrategy

public HeaderFilterStrategy getHeaderFilterStrategy()
Description copied from interface: HeaderFilterStrategyAware
Gets the header filter strategy used

Specified by:
getHeaderFilterStrategy in interface HeaderFilterStrategyAware
Returns:
the strategy

setHeaderFilterStrategy

public void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
Description copied from interface: HeaderFilterStrategyAware
Sets the header filter strategy to use

Specified by:
setHeaderFilterStrategy in interface HeaderFilterStrategyAware
Parameters:
strategy - the strategy

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class DefaultComponent
Throws:
Exception

createEndpoint

protected Endpoint createEndpoint(String uri,
                                  String remaining,
                                  Map<String,Object> parameters)
                           throws Exception
Description copied from class: DefaultComponent
A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters

Specified by:
createEndpoint in class DefaultComponent
Parameters:
uri - the full URI of the endpoint
remaining - the remaining part of the URI without the query parameters or component prefix
parameters - the optional parameters passed in
Returns:
a newly created endpoint or null if the endpoint cannot be created based on the inputs
Throws:
Exception

convertPathToActualDestination

protected String convertPathToActualDestination(String path,
                                                Map<String,Object> parameters)
A strategy method allowing the URI destination to be translated into the actual JMS destination name (say by looking up in JNDI or something)


createConfiguration

protected JmsConfiguration createConfiguration()
Factory method to create the default configuration instance

Returns:
a newly created configuration object which can then be further customized

tryCreateDefaultQueueBrowseStrategy

protected static QueueBrowseStrategy tryCreateDefaultQueueBrowseStrategy(CamelContext context)
Attempts to instantiate the default QueueBrowseStrategy which should work fine if Spring 2.5.x or later is on the classpath but this will fail if 2.0.x are on the classpath. We can continue to operate on this version we just cannot support the browseable queues supported by JmsQueueEndpoint

Returns:
the queue browse strategy or null if it cannot be supported


Apache CAMEL