org.mule.providers.jms
Class JmsConnector

java.lang.Object
  extended byorg.mule.providers.AbstractConnector
      extended byorg.mule.providers.jms.JmsConnector
All Implemented Interfaces:
org.mule.impl.internal.notifications.ConnectionNotificationListener, org.mule.umo.lifecycle.Disposable, EventListener, ExceptionListener, org.mule.umo.lifecycle.Initialisable, org.mule.umo.lifecycle.Lifecycle, org.mule.impl.ManagementContextAware, org.mule.umo.NamedObject, org.mule.umo.lifecycle.Startable, org.mule.umo.lifecycle.Stoppable, org.mule.umo.provider.UMOConnectable, org.mule.umo.provider.UMOConnector, org.mule.umo.manager.UMOServerNotificationListener, WorkListener
Direct Known Subclasses:
ActiveMQJmsConnector, WeblogicJmsConnector, WebsphereJmsConnector

public class JmsConnector
extends org.mule.providers.AbstractConnector
implements org.mule.impl.internal.notifications.ConnectionNotificationListener

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
 String password
           
 String username
           
 
Fields inherited from class org.mule.providers.AbstractConnector
connected, connecting, connectionStrategy, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatchers, disposed, disposing, exceptionListener, initialised, logger, managementContext, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, started, startOnConnect
 
Fields inherited from interface org.mule.umo.provider.UMOConnector
INT_VALUE_NOT_SET
 
Fields inherited from interface org.mule.umo.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.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 Session
 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 Session 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  void doConnect()
           
protected  void doDisconnect()
           
protected  void doDispose()
           
protected  void doInitialise()
           
protected  void doStart()
           
protected  void doStop()
           
 int getAcknowledgementMode()
           
 String getClientId()
           
 Connection getConnection()
           
 org.mule.util.object.ObjectFactory getConnectionFactory()
           
 String getConnectionFactoryJndiName()
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
protected  org.mule.util.object.ObjectFactory getDefaultConnectionFactory()
          Override this method to provide a default ConnectionFactory for a vendor-specific JMS Connector.
 JmsSupport getJmsSupport()
           
 Context getJndiContext()
           
 String getJndiInitialFactory()
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 Map getJndiProviderProperties()
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 String getJndiProviderUrl()
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 int getMaxRedelivery()
           
 org.mule.umo.provider.UMOMessageAdapter getMessageAdapter(Object message)
           
 String getPassword()
           
 String getProtocol()
           
protected  Object getReceiverKey(org.mule.umo.UMOComponent component, org.mule.umo.endpoint.UMOImmutableEndpoint endpoint)
           
 org.mule.util.object.ObjectFactory getRedeliveryHandler()
           
 org.mule.providers.ReplyToHandler getReplyToHandler()
           
 Session getSession(boolean transacted, boolean topic)
           
 Session getSession(org.mule.umo.endpoint.UMOImmutableEndpoint endpoint)
           
 Session getSessionFromTransaction()
           
 String getSpecification()
           
 JmsTopicResolver getTopicResolver()
          Getter for property 'topicResolver'.
 String getUsername()
           
 boolean isCacheJmsSessions()
           
 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 isRecoverJmsConnections()
           
 boolean isRemoteSyncEnabled()
           
 void onNotification(org.mule.umo.manager.UMOServerNotification 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(org.mule.util.object.ObjectFactory connectionFactory)
           
 void setConnectionFactoryJndiName(String connectionFactoryJndiName)
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 void setDurable(boolean durable)
           
 void setEagerConsumer(boolean eagerConsumer)
          A value of will create a consumer on connect, in contrast to lazy instantiation in the poll loop.
 void setForceJndiDestinations(boolean forceJndiDestinations)
           
 void setHonorQosHeaders(boolean honorQosHeaders)
          Sets 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)
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 void setJndiProviderProperties(Map jndiProviderProperties)
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 void setJndiProviderUrl(String jndiProviderUrl)
          Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.
 void setMaxRedelivery(int maxRedelivery)
           
 void setNoLocal(boolean noLocal)
           
 void setPassword(String password)
           
 void setPersistentDelivery(boolean persistentDelivery)
           
 void setRecoverJmsConnections(boolean recover)
           
 void setRedeliveryHandler(org.mule.util.object.ObjectFactory redeliveryHandler)
           
 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.providers.AbstractConnector
checkDisposed, connect, createReceiver, destroyReceiver, disconnect, dispatch, dispose, disposeDispatchers, disposeReceivers, disposeRequesters, disposeWorkManagers, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getConnectionStrategy, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getExceptionListener, getManagementContext, getMaxDispatchersActive, getMaxRequestersActive, getName, getNumberOfConcurrentTransactedReceivers, getOutputStream, getReceiver, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isDisposing, isEnableMessageEvents, isStarted, isSyncEnabled, lookupReceiver, registerListener, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, send, setConnectionStrategy, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherThreadingProfile, setDynamicNotification, setExceptionListener, setManagementContext, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterThreadingProfile, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, start, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

username

public String username

password

public String password
Constructor Detail

JmsConnector

public JmsConnector()
Method Detail

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface org.mule.umo.provider.UMOConnector

doInitialise

protected void doInitialise()
                     throws org.mule.umo.lifecycle.InitialisationException
Throws:
org.mule.umo.lifecycle.InitialisationException

getDefaultConnectionFactory

protected org.mule.util.object.ObjectFactory getDefaultConnectionFactory()
Override this method to provide a default ConnectionFactory for a vendor-specific JMS Connector.


doDispose

protected void doDispose()

createConnection

protected Connection createConnection()
                               throws NamingException,
                                      JMSException,
                                      org.mule.umo.lifecycle.InitialisationException
Throws:
NamingException
JMSException
org.mule.umo.lifecycle.InitialisationException

doConnect

protected void doConnect()
                  throws org.mule.providers.ConnectException
Throws:
org.mule.providers.ConnectException

doDisconnect

protected void doDisconnect()
                     throws org.mule.providers.ConnectException
Throws:
org.mule.providers.ConnectException

getMessageAdapter

public org.mule.umo.provider.UMOMessageAdapter getMessageAdapter(Object message)
                                                          throws org.mule.umo.MessagingException
Specified by:
getMessageAdapter in interface org.mule.umo.provider.UMOConnector
Throws:
org.mule.umo.MessagingException

getReceiverKey

protected Object getReceiverKey(org.mule.umo.UMOComponent component,
                                org.mule.umo.endpoint.UMOImmutableEndpoint endpoint)

getSessionFromTransaction

public Session getSessionFromTransaction()

getSession

public Session getSession(org.mule.umo.endpoint.UMOImmutableEndpoint endpoint)
                   throws JMSException
Throws:
JMSException

getSession

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

doStart

protected void doStart()
                throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

doStop

protected void doStop()
               throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

getReplyToHandler

public org.mule.providers.ReplyToHandler getReplyToHandler()

onNotification

public void onNotification(org.mule.umo.manager.UMOServerNotification notification)
Specified by:
onNotification in interface org.mule.umo.manager.UMOServerNotificationListener

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 Session

Parameters:
session -
Throws:
JMSException

closeQuietly

public void closeQuietly(Session session)
Closes the Session 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)

setRecoverJmsConnections

public void setRecoverJmsConnections(boolean recover)

isRecoverJmsConnections

public boolean isRecoverJmsConnections()

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)

isRemoteSyncEnabled

public boolean isRemoteSyncEnabled()
Specified by:
isRemoteSyncEnabled in interface org.mule.umo.provider.UMOConnector

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 .

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

setEagerConsumer

public void setEagerConsumer(boolean eagerConsumer)
A value of 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:

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

isCacheJmsSessions

public boolean isCacheJmsSessions()

setCacheJmsSessions

public void setCacheJmsSessions(boolean cacheJmsSessions)

getConnectionFactory

public org.mule.util.object.ObjectFactory getConnectionFactory()

setConnectionFactory

public void setConnectionFactory(org.mule.util.object.ObjectFactory connectionFactory)

getRedeliveryHandler

public org.mule.util.object.ObjectFactory getRedeliveryHandler()

setRedeliveryHandler

public void setRedeliveryHandler(org.mule.util.object.ObjectFactory redeliveryHandler)

isJndiDestinations

public boolean isJndiDestinations()

setJndiDestinations

public void setJndiDestinations(boolean jndiDestinations)

getJndiContext

public Context getJndiContext()

setJndiContext

public void setJndiContext(Context jndiContext)

isForceJndiDestinations

public boolean isForceJndiDestinations()

setForceJndiDestinations

public void setForceJndiDestinations(boolean forceJndiDestinations)

setHonorQosHeaders

public void setHonorQosHeaders(boolean honorQosHeaders)
Sets 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.

getConnectionFactoryJndiName

public String getConnectionFactoryJndiName()
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
, JndiObjectFactory

setConnectionFactoryJndiName

public void setConnectionFactoryJndiName(String connectionFactoryJndiName)
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

getJndiInitialFactory

public String getJndiInitialFactory()
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

setJndiInitialFactory

public void setJndiInitialFactory(String jndiInitialFactory)
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

getJndiProviderUrl

public String getJndiProviderUrl()
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

setJndiProviderUrl

public void setJndiProviderUrl(String jndiProviderUrl)
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

getJndiProviderProperties

public Map getJndiProviderProperties()
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory

setJndiProviderProperties

public void setJndiProviderProperties(Map jndiProviderProperties)
Deprecated. Mule 2.x configs should use Spring's or Mule's JndiObjectFactory instead.

See Also:
http://www.springframework.org/docs/reference/xsd-config.html#xsd-config-body-schemas-jee, JndiObjectFactory


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