org.objectweb.jonas_jms
Class JmsManagerImpl

java.lang.Object
  extended by org.objectweb.jonas_jms.JmsManagerImpl
All Implemented Interfaces:
JmsManager, JmsJmxManagement

public class JmsManagerImpl
extends java.lang.Object
implements JmsManager, JmsJmxManagement

JmsManager implementation This singleton class must exist in each JOnAS server that want to use JMS

Author:
Laurent Chauvirey, Frederic Maistre, Nicolas Tachker Contributor(s):

Christophe Ney: for making easier Enhydra integration

Philippe Durieux

Jeff Mesnil: for JORAM 3.0 integration

Philippe Coq: for JORAM 3.1 (JMS 1.1) integration

Adriana Danes : update with support of JMS resource monitoring


Method Summary
 javax.jms.Queue createQueue(java.lang.String name)
          Creation of an administered Object Queue and bind it in the registry
 javax.jms.Topic createTopic(java.lang.String name)
          Creation of an administered Object Topic and bind it in the registry
 javax.jms.ConnectionFactory getConnectionFactory()
          Get the unique ConnectionFactory
 java.lang.String getConnectionFactoryMode(java.lang.String jndiName)
          Get the messaging mode a connection factory belongs to
 int getCurrentNumberOfJmsConnectionFactory()
          Management method
 int getCurrentNumberOfJmsQueueConnectionFactory()
          Management method
 int getCurrentNumberOfJmsQueueDestination()
          Management method
 int getCurrentNumberOfJmsTopicConnectionFactory()
          Management method
 int getCurrentNumberOfJmsTopicDestination()
          Management method
 java.lang.String getDefaultConnectionFactoryName()
          Management method
 java.lang.String getDefaultQueueConnectionFactoryName()
          Management method
 java.lang.String getDefaultTopicConnectionFactoryName()
          Management method
static JmsJmxManagement getJmsJmxManagement()
          Get the JmsJmxManagement.
static JmsManager getJmsManager()
          Get the JmsManager.
 int getPendingMessages(java.lang.String jndiName)
          Get number of pending messages on a queue
 int getPendingRequests(java.lang.String jndiName)
          Get number of pending requests on a queue
 javax.jms.Queue getQueue(java.lang.String name)
          Get Queue (creates it if not exist)
 javax.jms.QueueConnectionFactory getQueueConnectionFactory()
          Get the unique QueueConnectionFactory
 java.util.Enumeration getQueuesNames()
          Get Queue Names
 int getSubscriptions(java.lang.String jndiName)
          Get number of subscriptions on a topic
 javax.jms.Topic getTopic(java.lang.String name)
          Get Topic (creates it if not exist)
 javax.jms.TopicConnectionFactory getTopicConnectionFactory()
          Get the unique TopicConnectionFactory
 java.util.Enumeration getTopicsNames()
          Get Topic Names
static org.objectweb.transaction.jta.TransactionManager getTransactionManager()
          return the Transaction Manager
 javax.jms.XAConnectionFactory getXAConnectionFactory()
          Get Default XAConnectionFactory
 javax.jms.XAQueueConnectionFactory getXAQueueConnectionFactory()
          Get Default XAQueueConnectionFactory
 javax.jms.XATopicConnectionFactory getXATopicConnectionFactory()
          Get Default XATopicConnectionFactory
 void init(java.lang.Class cl, boolean collocated, java.lang.String url, org.objectweb.transaction.jta.TransactionManager trm)
          Initialization of the JmsManager
 java.lang.String removeJmsDestination(java.lang.String jndiName)
          Remove a Jms destination
 void stop()
          Terminate the administering process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJmsManager

public static JmsManager getJmsManager()
Get the JmsManager.


getJmsJmxManagement

public static JmsJmxManagement getJmsJmxManagement()
Get the JmsJmxManagement.


getTransactionManager

public static org.objectweb.transaction.jta.TransactionManager getTransactionManager()
return the Transaction Manager


init

public void init(java.lang.Class cl,
                 boolean collocated,
                 java.lang.String url,
                 org.objectweb.transaction.jta.TransactionManager trm)
          throws java.lang.Exception
Initialization of the JmsManager

Specified by:
init in interface JmsManager
Parameters:
class - JmsAdministration class .
boolean - true for launchin the MOM inside the JOnAS server.
String - url connexion that must be used as soon as we don't use the default value of a3server.xml
Throws:
java.lang.Exception - must be thrown if the MOM is unreachable

createQueue

public javax.jms.Queue createQueue(java.lang.String name)
                            throws java.lang.Exception
Creation of an administered Object Queue and bind it in the registry

Specified by:
createQueue in interface JmsManager
Throws:
java.lang.Exception

createTopic

public javax.jms.Topic createTopic(java.lang.String name)
                            throws java.lang.Exception
Creation of an administered Object Topic and bind it in the registry

Specified by:
createTopic in interface JmsManager
Throws:
java.lang.Exception

getConnectionFactory

public javax.jms.ConnectionFactory getConnectionFactory()
Get the unique ConnectionFactory

Specified by:
getConnectionFactory in interface JmsManager

getTopicConnectionFactory

public javax.jms.TopicConnectionFactory getTopicConnectionFactory()
Get the unique TopicConnectionFactory

Specified by:
getTopicConnectionFactory in interface JmsManager

getQueueConnectionFactory

public javax.jms.QueueConnectionFactory getQueueConnectionFactory()
Description copied from interface: JmsManager
Get the unique QueueConnectionFactory

Specified by:
getQueueConnectionFactory in interface JmsManager

getXAConnectionFactory

public javax.jms.XAConnectionFactory getXAConnectionFactory()
Get Default XAConnectionFactory

Specified by:
getXAConnectionFactory in interface JmsManager

getXATopicConnectionFactory

public javax.jms.XATopicConnectionFactory getXATopicConnectionFactory()
Get Default XATopicConnectionFactory

Specified by:
getXATopicConnectionFactory in interface JmsManager

getXAQueueConnectionFactory

public javax.jms.XAQueueConnectionFactory getXAQueueConnectionFactory()
Get Default XAQueueConnectionFactory

Specified by:
getXAQueueConnectionFactory in interface JmsManager

getQueue

public javax.jms.Queue getQueue(java.lang.String name)
                         throws java.lang.Exception
Get Queue (creates it if not exist)

Specified by:
getQueue in interface JmsManager
Throws:
java.lang.Exception

getTopic

public javax.jms.Topic getTopic(java.lang.String name)
                         throws java.lang.Exception
Get Topic (creates it if not exist)

Specified by:
getTopic in interface JmsManager
Throws:
java.lang.Exception

getTopicsNames

public java.util.Enumeration getTopicsNames()
Get Topic Names

Specified by:
getTopicsNames in interface JmsManager

getQueuesNames

public java.util.Enumeration getQueuesNames()
Get Queue Names

Specified by:
getQueuesNames in interface JmsManager

stop

public void stop()
          throws java.lang.Exception
Terminate the administering process

Specified by:
stop in interface JmsManager
Throws:
java.lang.Exception

getCurrentNumberOfJmsConnectionFactory

public int getCurrentNumberOfJmsConnectionFactory()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getCurrentNumberOfJmsConnectionFactory in interface JmsJmxManagement
Returns:
the current number of Jms Connection Factory

getCurrentNumberOfJmsTopicConnectionFactory

public int getCurrentNumberOfJmsTopicConnectionFactory()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getCurrentNumberOfJmsTopicConnectionFactory in interface JmsJmxManagement
Returns:
the current number of Topic Jms Connection Factory

getCurrentNumberOfJmsQueueConnectionFactory

public int getCurrentNumberOfJmsQueueConnectionFactory()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getCurrentNumberOfJmsQueueConnectionFactory in interface JmsJmxManagement
Returns:
the current number of Queue Jms Connection Factory

getCurrentNumberOfJmsTopicDestination

public int getCurrentNumberOfJmsTopicDestination()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getCurrentNumberOfJmsTopicDestination in interface JmsJmxManagement
Returns:
the current number of Topic Jms Destination

getCurrentNumberOfJmsQueueDestination

public int getCurrentNumberOfJmsQueueDestination()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getCurrentNumberOfJmsQueueDestination in interface JmsJmxManagement
Returns:
the current number of Queue Jms Destination

removeJmsDestination

public java.lang.String removeJmsDestination(java.lang.String jndiName)
                                      throws java.lang.Exception
Remove a Jms destination

Specified by:
removeJmsDestination in interface JmsJmxManagement
Parameters:
String - jndi name
Returns:
the destination type : "queue" or "topic"
Throws:
java.lang.Exception

getDefaultConnectionFactoryName

public java.lang.String getDefaultConnectionFactoryName()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getDefaultConnectionFactoryName in interface JmsJmxManagement
Returns:
String name of default Connection factory

getDefaultQueueConnectionFactoryName

public java.lang.String getDefaultQueueConnectionFactoryName()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getDefaultQueueConnectionFactoryName in interface JmsJmxManagement
Returns:
String name of default Queue Connection factory

getDefaultTopicConnectionFactoryName

public java.lang.String getDefaultTopicConnectionFactoryName()
Description copied from interface: JmsJmxManagement
Management method

Specified by:
getDefaultTopicConnectionFactoryName in interface JmsJmxManagement
Returns:
String name of default Topic Connection factory

getConnectionFactoryMode

public java.lang.String getConnectionFactoryMode(java.lang.String jndiName)
                                          throws java.lang.Exception
Get the messaging mode a connection factory belongs to

Specified by:
getConnectionFactoryMode in interface JmsJmxManagement
Parameters:
jndiName - connection factory name
Returns:
messaging mode
Throws:
failure - on calling monitoring operation
java.lang.Exception

getPendingMessages

public int getPendingMessages(java.lang.String jndiName)
                       throws java.lang.Exception
Get number of pending messages on a queue

Specified by:
getPendingMessages in interface JmsJmxManagement
Parameters:
name - the queue's jndi name
Returns:
number of pending messages
Throws:
failure - on calling monitoring operation
java.lang.Exception

getPendingRequests

public int getPendingRequests(java.lang.String jndiName)
                       throws java.lang.Exception
Get number of pending requests on a queue

Specified by:
getPendingRequests in interface JmsJmxManagement
Parameters:
jndiName - queue name
Returns:
number of pending requests
Throws:
failure - on calling monitoring operation
java.lang.Exception

getSubscriptions

public int getSubscriptions(java.lang.String jndiName)
                     throws java.lang.Exception
Get number of subscriptions on a topic

Specified by:
getSubscriptions in interface JmsJmxManagement
Parameters:
jndiName - topic name
Returns:
number of subscriptions
Throws:
failure - on calling monitoring operation
java.lang.Exception