JmsConnector (Mule ESB 2.2.1 API)
Keywords: org.mule.transport.jms.JmsConnector class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.jms
Class JmsConnector

    java.lang.Object
      org.mule.transport.AbstractConnector
          org.mule.transport.jms.JmsConnector

All Implemented Interfaces:
  ExceptionListener, EventListener, javax.resource.spi.work.WorkListener, MuleContextAware, ConnectionNotificationListener, ServerNotificationListener, Disposable, Initialisable, Lifecycle, Startable, Stoppable, NamedObject, Connectable, Connector

Direct Known Subclasses:
  ActiveMQJmsConnector, WeblogicJmsConnector, WebsphereJmsConnector

    public class JmsConnector

extends AbstractConnector
implements ConnectionNotificationListener, ExceptionListener

`JmsConnector` is a JMS 1.0.2b compliant connector that can be used by a Mule endpoint. The connector supports all JMS functionality including topics and queues, durable subscribers, acknowledgement modes and local transactions.

Field Summary
`static String` | `JMS`
`String` | `password`
`String` | `username`

Fields inherited from class org.mule.transport.AbstractConnector
`connected, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatchers, disposed, exceptionListener, initialised, logger, muleContext, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, started, startOnConnect`

Fields inherited from interface org.mule.api.transport.Connector
`INT_VALUE_NOT_SET`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Startable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Stoppable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`JmsConnector()`

Method Summary
`void` | `close(MessageConsumer consumer)` Closes the MessageConsumer
`void` | `close(MessageProducer producer)` Closes the MessageProducer
`void` | `close(Session session)` Closes the MuleSession
`void` | `close(TemporaryQueue tempQueue)` Closes the TemporaryQueue
`void` | `close(TemporaryTopic tempTopic)` Closes the TemporaryTopic
`void` | `closeQuietly(MessageConsumer consumer)` Closes the MessageConsumer without throwing an exception (an error message is logged instead).
`void` | `closeQuietly(MessageProducer producer)` Closes the MessageProducer without throwing an exception (an error message is logged instead).
`void` | `closeQuietly(Session session)` Closes the MuleSession without throwing an exception (an error message is logged instead).
`void` | `closeQuietly(TemporaryQueue tempQueue)` Closes the TemporaryQueue without throwing an exception (an error message is logged instead).
`void` | `closeQuietly(TemporaryTopic tempTopic)` Closes the TemporaryTopic without throwing an exception (an error message is logged instead).
`protected Connection` | `createConnection()`
`protected ConnectionFactory` | `createConnectionFactory()`
`protected JmsSupport` | `createJmsSupport()` A factory method to create various JmsSupport class versions.
`protected void` | `doConnect()` Template method where any connections should be made for the connector
`protected void` | `doDisconnect()` Template method where any connected resources used by the connector should be disconnected
`protected void` | `doDispose()` Template method to perform any work when destroying the connectoe
`protected void` | `doInitialise()`
`protected void` | `doStart()` Template method to perform any work when starting the connectoe
`protected void` | `doStop()` Template method to perform any work when stopping the connectoe
`int` | `getAcknowledgementMode()`
`String` | `getClientId()`
`Connection` | `getConnection()`
`ConnectionFactory` | `getConnectionFactory()`
`String` | `getConnectionFactoryJndiName()`
`Map` | `getConnectionFactoryProperties()`
`protected ConnectionFactory` | `getDefaultConnectionFactory()` Override this method to provide a default ConnectionFactory for a vendor-specific JMS Connector.
`JmsSupport` | `getJmsSupport()`
`Context` | `getJndiContext()`
`String` | `getJndiInitialFactory()`
`Map` | `getJndiProviderProperties()`
`String` | `getJndiProviderUrl()`
`int` | `getMaxRedelivery()`
`MessageAdapter` | `getMessageAdapter(Object message)` Gets a `MessageAdapter` for the endpoint for the given message (data)
`int` | `getNumberOfConsumers()` A synonym for `AbstractConnector.numberOfConcurrentTransactedReceivers`.
`String` | `getPassword()`
`String` | `getProtocol()`
`protected Object` | `getReceiverKey(Service service, InboundEndpoint endpoint)` The method determines the key used to store the receiver against.
`RedeliveryHandlerFactory` | `getRedeliveryHandlerFactory()`
`ReplyToHandler` | `getReplyToHandler()` Getter for property 'replyToHandler'.
`Session` | `getSession(boolean transacted, boolean topic)`
`Session` | `getSession(ImmutableEndpoint endpoint)`
`Session` | `getSessionFromTransaction()`
`String` | `getSpecification()`
`JmsTopicResolver` | `getTopicResolver()` Getter for property 'topicResolver'.
`String` | `getUsername()`
`protected void` | `initJndiContext()`
`boolean` | `isCacheJmsSessions()`
`boolean` | `isDisableTemporaryReplyToDestinations()`
`boolean` | `isDurable()`
`boolean` | `isEagerConsumer()` Getter for property 'eagerConsumer'.
`boolean` | `isForceJndiDestinations()`
`boolean` | `isHonorQosHeaders()` Gets the value of `honorQosHeaders` property.
`boolean` | `isJndiDestinations()`
`boolean` | `isNoLocal()`
`boolean` | `isPersistentDelivery()`
`boolean` | `isResponseEnabled()`
`protected Object` | `lookupFromJndi(String jndiName)`
`void` | `onException(JMSException jmsException)`
`void` | `onNotification(ServerNotification notification)`
`Message` | `preProcessMessage(Message message, Session session)` This method may be overridden in order to apply pre-processing to the message as soon as it arrives.
`void` | `setAcknowledgementMode(int acknowledgementMode)`
`void` | `setCacheJmsSessions(boolean cacheJmsSessions)`
`void` | `setClientId(String clientId)`
`protected void` | `setConnection(Connection connection)`
`void` | `setConnectionFactory(ConnectionFactory connectionFactory)`
`void` | `setConnectionFactoryJndiName(String connectionFactoryJndiName)`
`void` | `setConnectionFactoryProperties(Map connectionFactoryProperties)`
`void` | `setDisableTemporaryReplyToDestinations(boolean disableTemporaryReplyToDestinations)`
`void` | `setDurable(boolean durable)`
`void` | `setEagerConsumer(boolean eagerConsumer)` A value of `true` will create a consumer on connect, in contrast to lazy instantiation in the poll loop.
`void` | `setForceJndiDestinations(boolean forceJndiDestinations)`
`void` | `setHonorQosHeaders(boolean honorQosHeaders)` Sets the `honorQosHeaders` property, which determines whether `JmsMessageDispatcher` should honor incoming message's QoS headers (JMSPriority, JMSDeliveryMode).
`void` | `setJmsSupport(JmsSupport jmsSupport)`
`void` | `setJndiContext(Context jndiContext)`
`void` | `setJndiDestinations(boolean jndiDestinations)`
`void` | `setJndiInitialFactory(String jndiInitialFactory)`
`void` | `setJndiProviderProperties(Map jndiProviderProperties)`
`void` | `setJndiProviderUrl(String jndiProviderUrl)`
`void` | `setMaxRedelivery(int maxRedelivery)`
`void` | `setNoLocal(boolean noLocal)`
`void` | `setNumberOfConsumers(int count)` A synonym for `AbstractConnector.numberOfConcurrentTransactedReceivers`.
`void` | `setPassword(String password)`
`void` | `setPersistentDelivery(boolean persistentDelivery)`
`void` | `setRedeliveryHandlerFactory(RedeliveryHandlerFactory redeliveryHandlerFactory)`
`void` | `setSpecification(String specification)`
`void` | `setTopicResolver(JmsTopicResolver topicResolver)` Setter for property 'topicResolver'.
`void` | `setUsername(String username)`
`boolean` | `supportsProperty(String property)` This method may be overridden in case a certain JMS implementation does not support all the standard JMS properties.

Methods inherited from class org.mule.transport.AbstractConnector
`checkDisposed, connect, createReceiver, destroyReceiver, disconnect, dispatch, dispose, disposeDispatchers, disposeReceivers, disposeRequesters, disposeWorkManagers, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getExceptionListener, getMaxDispatchersActive, getMaxRequestersActive, getMuleContext, getName, getNumberOfConcurrentTransactedReceivers, getOutputStream, getReceiver, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, handleException, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isStarted, isSyncEnabled, isValidateConnections, lookupReceiver, registerListener, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, send, setConnected, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherThreadingProfile, setDynamicNotification, setExceptionListener, setMaxDispatchersActive, setMaxRequestersActive, setMuleContext, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, start, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStarted`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### JMS

    public static final String JMS

See Also:
  Constant Field Values

### username

    public String username

### password

    public String password

Constructor Detail

### JmsConnector

    public JmsConnector()

Method Detail

### getProtocol

    public String getProtocol()

  Specified by:
    `getProtocol` in interface `Connector`
  Returns:
    the primary protocol name for endpoints of this connector

### doInitialise

    protected void doInitialise()
                         throws InitialisationException

  Specified by:
    `doInitialise` in class `AbstractConnector`
  Throws:
    `InitialisationException`

### createJmsSupport

    protected JmsSupport createJmsSupport()

  A factory method to create various JmsSupport class versions.

  Returns:
    JmsSupport instance
  See Also:
    `JmsSupport`

### createConnectionFactory

    protected ConnectionFactory createConnectionFactory()
                                                 throws InitialisationException,
                                                        NamingException

  Throws:
    `InitialisationException`
    `NamingException`

### getDefaultConnectionFactory

    protected ConnectionFactory getDefaultConnectionFactory()

  Override this method to provide a default ConnectionFactory for a vendor-specific JMS Connector.

### doDispose

    protected void doDispose()

  Description copied from class: `AbstractConnector`
  Template method to perform any work when destroying the connectoe

  Specified by:
    `doDispose` in class `AbstractConnector`

### initJndiContext

    protected void initJndiContext()
                            throws NamingException,
                                   InitialisationException

  Throws:
    `NamingException`
    `InitialisationException`

### lookupFromJndi

    protected Object lookupFromJndi(String jndiName)
                             throws NamingException

  Throws:
    `NamingException`

### createConnection

    protected Connection createConnection()
                                   throws NamingException,
                                          JMSException,
                                          InitialisationException

  Throws:
    `NamingException`
    `JMSException`
    `InitialisationException`

### onException

    public void onException(JMSException jmsException)

### doConnect

    protected void doConnect()
                      throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connections should be made for the connector

  Specified by:
    `doConnect` in class `AbstractConnector`
  Throws:
    `Exception`

### doDisconnect

    protected void doDisconnect()
                         throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connected resources used by the connector should be disconnected

  Specified by:
    `doDisconnect` in class `AbstractConnector`
  Throws:
    `Exception`

### getMessageAdapter

    public MessageAdapter getMessageAdapter(Object message)
                                     throws MessagingException

  Description copied from class: `AbstractConnector`
  Gets a `MessageAdapter` for the endpoint for the given message (data)

  Specified by:
    `getMessageAdapter` in interface `Connector`
  Overrides:
    `getMessageAdapter` in class `AbstractConnector`
  Parameters:
    `message` - the data with which to initialise the `MessageAdapter`
  Returns:
    the `MessageAdapter` for the endpoint
  Throws:
    `MessagingException` - if the message parameter is not supported
  See Also:
    `MessageAdapter`

### getReceiverKey

    protected Object getReceiverKey(Service service,
                                    InboundEndpoint endpoint)

  Description copied from class: `AbstractConnector`
  The method determines the key used to store the receiver against.

  Overrides:
    `getReceiverKey` in class `AbstractConnector`
  Parameters:
    `service` - the service for which the endpoint is being registered
    `endpoint` - the endpoint being registered for the service
  Returns:
    the key to store the newly created receiver against

### getSessionFromTransaction

    public Session getSessionFromTransaction()

### getSession

    public Session getSession(ImmutableEndpoint endpoint)
                       throws JMSException

  Throws:
    `JMSException`

### getSession

    public Session getSession(boolean transacted,
                              boolean topic)
                       throws JMSException

  Throws:
    `JMSException`

### doStart

    protected void doStart()
                    throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when starting the connectoe

  Specified by:
    `doStart` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### doStop

    protected void doStop()
                   throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when stopping the connectoe

  Specified by:
    `doStop` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### getReplyToHandler

    public ReplyToHandler getReplyToHandler()

  Description copied from class: `AbstractConnector`
  Getter for property 'replyToHandler'.

  Overrides:
    `getReplyToHandler` in class `AbstractConnector`
  Returns:
    Value for property 'replyToHandler'.

### onNotification

    public void onNotification(ServerNotification notification)

  Specified by:
    `onNotification` in interface `ServerNotificationListener`

### supportsProperty

    public boolean supportsProperty(String property)

  This method may be overridden in case a certain JMS implementation does not support all the standard JMS properties.

### preProcessMessage

    public Message preProcessMessage(Message message,
                                     Session session)
                              throws Exception

  This method may be overridden in order to apply pre-processing to the message as soon as it arrives.

  Parameters:
    `message` - - the incoming message
    `session` - - the JMS session
  Returns:
    the preprocessed message
  Throws:
    `Exception`

### close

    public void close(MessageProducer producer)
               throws JMSException

  Closes the MessageProducer

  Parameters:
    `producer` -
  Throws:
    `JMSException`

### closeQuietly

    public void closeQuietly(MessageProducer producer)

  Closes the MessageProducer without throwing an exception (an error message is logged instead).

  Parameters:
    `producer` -

### close

    public void close(MessageConsumer consumer)
               throws JMSException

  Closes the MessageConsumer

  Parameters:
    `consumer` -
  Throws:
    `JMSException`

### closeQuietly

    public void closeQuietly(MessageConsumer consumer)

  Closes the MessageConsumer without throwing an exception (an error message is logged instead).

  Parameters:
    `consumer` -

### close

    public void close(Session session)
               throws JMSException

  Closes the MuleSession

  Parameters:
    `session` -
  Throws:
    `JMSException`

### closeQuietly

    public void closeQuietly(Session session)

  Closes the MuleSession without throwing an exception (an error message is logged instead).

  Parameters:
    `session` -

### close

    public void close(TemporaryQueue tempQueue)
               throws JMSException

  Closes the TemporaryQueue

  Parameters:
    `tempQueue` -
  Throws:
    `JMSException`

### closeQuietly

    public void closeQuietly(TemporaryQueue tempQueue)

  Closes the TemporaryQueue without throwing an exception (an error message is logged instead).

  Parameters:
    `tempQueue` -

### close

    public void close(TemporaryTopic tempTopic)
               throws JMSException

  Closes the TemporaryTopic

  Parameters:
    `tempTopic` -
  Throws:
    `JMSException`

### closeQuietly

    public void closeQuietly(TemporaryTopic tempTopic)

  Closes the TemporaryTopic without throwing an exception (an error message is logged instead).

  Parameters:
    `tempTopic` -

### getConnection

    public Connection getConnection()

  Returns:
    Returns the connection.

### setConnection

    protected void setConnection(Connection connection)

### getAcknowledgementMode

    public int getAcknowledgementMode()

  Returns:
    Returns the acknowledgeMode.

### setAcknowledgementMode

    public void setAcknowledgementMode(int acknowledgementMode)

  Parameters:
    `acknowledgementMode` - The acknowledgementMode to set.

### isDurable

    public boolean isDurable()

  Returns:
    Returns the durable.

### setDurable

    public void setDurable(boolean durable)

  Parameters:
    `durable` - The durable to set.

### isNoLocal

    public boolean isNoLocal()

  Returns:
    Returns the noLocal.

### setNoLocal

    public void setNoLocal(boolean noLocal)

  Parameters:
    `noLocal` - The noLocal to set.

### isPersistentDelivery

    public boolean isPersistentDelivery()

  Returns:
    Returns the persistentDelivery.

### setPersistentDelivery

    public void setPersistentDelivery(boolean persistentDelivery)

  Parameters:
    `persistentDelivery` - The persistentDelivery to set.

### getJmsSupport

    public JmsSupport getJmsSupport()

### setJmsSupport

    public void setJmsSupport(JmsSupport jmsSupport)

### getSpecification

    public String getSpecification()

### setSpecification

    public void setSpecification(String specification)

### getUsername

    public String getUsername()

### setUsername

    public void setUsername(String username)

### getPassword

    public String getPassword()

### setPassword

    public void setPassword(String password)

### getClientId

    public String getClientId()

### setClientId

    public void setClientId(String clientId)

### getMaxRedelivery

    public int getMaxRedelivery()

### setMaxRedelivery

    public void setMaxRedelivery(int maxRedelivery)

### isResponseEnabled

    public boolean isResponseEnabled()

  Specified by:
    `isResponseEnabled` in interface `Connector`
  Overrides:
    `isResponseEnabled` in class `AbstractConnector`

### getTopicResolver

    public JmsTopicResolver getTopicResolver()

  Getter for property 'topicResolver'.

  Returns:
    Value for property 'topicResolver'.

### setTopicResolver

    public void setTopicResolver(JmsTopicResolver topicResolver)

  Setter for property 'topicResolver'.

  Parameters:
    `topicResolver` - Value to set for property 'topicResolver'.

### isEagerConsumer

    public boolean isEagerConsumer()

  Getter for property 'eagerConsumer'. Default is `true`.

  Returns:
    Value for property 'eagerConsumer'.
  See Also:
    `eagerConsumer`

### setEagerConsumer

    public void setEagerConsumer(boolean eagerConsumer)

  A value of `true` will create a consumer on connect, in contrast to lazy instantiation in the poll loop. This setting very much depends on the JMS vendor. Affects transactional receivers, typical symptoms are:
  - consumer thread hanging forever, though a message is available
  - failure to consume the first message (the rest are fine)

  Parameters:
    `eagerConsumer` - Value to set for property 'eagerConsumer'.
  See Also:
    `eagerConsumer`, `XaTransactedJmsMessageReceiver`

### isCacheJmsSessions

    public boolean isCacheJmsSessions()

### setCacheJmsSessions

    public void setCacheJmsSessions(boolean cacheJmsSessions)

### getConnectionFactory

    public ConnectionFactory getConnectionFactory()

### setConnectionFactory

    public void setConnectionFactory(ConnectionFactory connectionFactory)

### getRedeliveryHandlerFactory

    public RedeliveryHandlerFactory getRedeliveryHandlerFactory()

### setRedeliveryHandlerFactory

    public void setRedeliveryHandlerFactory(RedeliveryHandlerFactory redeliveryHandlerFactory)

### setHonorQosHeaders

    public void setHonorQosHeaders(boolean honorQosHeaders)

  Sets the `honorQosHeaders` property, which determines whether `JmsMessageDispatcher` should honor incoming message's QoS headers (JMSPriority, JMSDeliveryMode).

  Parameters:
    `honorQosHeaders` - `true` if `JmsMessageDispatcher` should honor incoming message's QoS headers; otherwise `false` Default is `false`, meaning that connector settings will override message headers.

### isHonorQosHeaders

    public boolean isHonorQosHeaders()

  Gets the value of `honorQosHeaders` property.

  Returns:
    `true` if `JmsMessageDispatcher` should honor incoming message's QoS headers; otherwise `false` Default is `false`, meaning that connector settings will override message headers.

### getJndiContext

    public Context getJndiContext()

### setJndiContext

    public void setJndiContext(Context jndiContext)

### getJndiInitialFactory

    public String getJndiInitialFactory()

### setJndiInitialFactory

    public void setJndiInitialFactory(String jndiInitialFactory)

### getJndiProviderUrl

    public String getJndiProviderUrl()

### setJndiProviderUrl

    public void setJndiProviderUrl(String jndiProviderUrl)

### getJndiProviderProperties

    public Map getJndiProviderProperties()

### setJndiProviderProperties

    public void setJndiProviderProperties(Map jndiProviderProperties)

### getConnectionFactoryJndiName

    public String getConnectionFactoryJndiName()

### setConnectionFactoryJndiName

    public void setConnectionFactoryJndiName(String connectionFactoryJndiName)

### isJndiDestinations

    public boolean isJndiDestinations()

### setJndiDestinations

    public void setJndiDestinations(boolean jndiDestinations)

### isForceJndiDestinations

    public boolean isForceJndiDestinations()

### setForceJndiDestinations

    public void setForceJndiDestinations(boolean forceJndiDestinations)

### isDisableTemporaryReplyToDestinations

    public boolean isDisableTemporaryReplyToDestinations()

### setDisableTemporaryReplyToDestinations

    public void setDisableTemporaryReplyToDestinations(boolean disableTemporaryReplyToDestinations)

### getConnectionFactoryProperties

    public Map getConnectionFactoryProperties()

  Returns:
    Returns underlying connection factory properties.

### setConnectionFactoryProperties

    public void setConnectionFactoryProperties(Map connectionFactoryProperties)

  Parameters:
    `connectionFactoryProperties` - properties to be set on the underlying ConnectionFactory.

### setNumberOfConsumers

    public void setNumberOfConsumers(int count)

  A synonym for `AbstractConnector.numberOfConcurrentTransactedReceivers`. Note that it affects both transactional and non-transactional scenarios.

  Parameters:
    `count` - number of consumers

### getNumberOfConsumers

    public int getNumberOfConsumers()

  A synonym for `AbstractConnector.numberOfConcurrentTransactedReceivers`.

  Returns:
    number of consumers

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.