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 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
 Queue createQueue(String name)
          Creation of an administered Object Queue and bind it in the registry
 Topic createTopic(String name)
          Creation of an administered Object Topic and bind it in the registry
 ConnectionFactory getConnectionFactory()
          Get the unique ConnectionFactory
 String getConnectionFactoryMode(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
 String getDefaultConnectionFactoryName()
          Management method
 String getDefaultQueueConnectionFactoryName()
          Management method
 String getDefaultTopicConnectionFactoryName()
          Management method
static JmsJmxManagement getJmsJmxManagement()
          Get the JmsJmxManagement.
static JmsManager getJmsManager()
          Get the JmsManager.
 int getPendingMessages(String jndiName)
          Get number of pending messages on a queue
 int getPendingRequests(String jndiName)
          Get number of pending requests on a queue
 Queue getQueue(String name)
          Get Queue (creates it if not exist)
 QueueConnectionFactory getQueueConnectionFactory()
          Get the unique QueueConnectionFactory
 Enumeration getQueuesNames()
          Get Queue Names
 int getSubscriptions(String jndiName)
          Get number of subscriptions on a topic
 Topic getTopic(String name)
          Get Topic (creates it if not exist)
 TopicConnectionFactory getTopicConnectionFactory()
          Get the unique TopicConnectionFactory
 Enumeration getTopicsNames()
          Get Topic Names
static org.objectweb.transaction.jta.TransactionManager getTransactionManager()
          return the Transaction Manager
 XAConnectionFactory getXAConnectionFactory()
          Get Default XAConnectionFactory
 XAQueueConnectionFactory getXAQueueConnectionFactory()
          Get Default XAQueueConnectionFactory
 XATopicConnectionFactory getXATopicConnectionFactory()
          Get Default XATopicConnectionFactory
 void init(Class cl, boolean collocated, String url, org.objectweb.transaction.jta.TransactionManager trm)
          Initialization of the JmsManager
 String removeJmsDestination(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(Class cl,
                 boolean collocated,
                 String url,
                 org.objectweb.transaction.jta.TransactionManager trm)
          throws Exception
Initialization of the JmsManager

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

createQueue

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

Specified by:
createQueue in interface JmsManager
Throws:
Exception

createTopic

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

Specified by:
createTopic in interface JmsManager
Throws:
Exception

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Get the unique ConnectionFactory

Specified by:
getConnectionFactory in interface JmsManager

getTopicConnectionFactory

public TopicConnectionFactory getTopicConnectionFactory()
Get the unique TopicConnectionFactory

Specified by:
getTopicConnectionFactory in interface JmsManager

getQueueConnectionFactory

public QueueConnectionFactory getQueueConnectionFactory()
Get the unique QueueConnectionFactory

Specified by:
getQueueConnectionFactory in interface JmsManager

getXAConnectionFactory

public XAConnectionFactory getXAConnectionFactory()
Get Default XAConnectionFactory

Specified by:
getXAConnectionFactory in interface JmsManager

getXATopicConnectionFactory

public XATopicConnectionFactory getXATopicConnectionFactory()
Get Default XATopicConnectionFactory

Specified by:
getXATopicConnectionFactory in interface JmsManager

getXAQueueConnectionFactory

public XAQueueConnectionFactory getXAQueueConnectionFactory()
Get Default XAQueueConnectionFactory

Specified by:
getXAQueueConnectionFactory in interface JmsManager

getQueue

public Queue getQueue(String name)
               throws Exception
Get Queue (creates it if not exist)

Specified by:
getQueue in interface JmsManager
Throws:
Exception

getTopic

public Topic getTopic(String name)
               throws Exception
Get Topic (creates it if not exist)

Specified by:
getTopic in interface JmsManager
Throws:
Exception

getTopicsNames

public Enumeration getTopicsNames()
Get Topic Names

Specified by:
getTopicsNames in interface JmsManager

getQueuesNames

public Enumeration getQueuesNames()
Get Queue Names

Specified by:
getQueuesNames in interface JmsManager

stop

public void stop()
          throws Exception
Terminate the administering process

Specified by:
stop in interface JmsManager
Throws:
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 String removeJmsDestination(String jndiName)
                            throws Exception
Remove a Jms destination

Specified by:
removeJmsDestination in interface JmsJmxManagement
Parameters:
jndiName - jndi name of the destination
Returns:
the destination type : "queue" or "topic"
Throws:
Exception

getDefaultConnectionFactoryName

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

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

getDefaultQueueConnectionFactoryName

public 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 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 String getConnectionFactoryMode(String jndiName)
                                throws 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:
Exception - failure on calling monitoring operation

getPendingMessages

public int getPendingMessages(String jndiName)
                       throws 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:
Exception - failure on calling monitoring operation

getPendingRequests

public int getPendingRequests(String jndiName)
                       throws 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:
Exception - failure on calling monitoring operation

getSubscriptions

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

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


Copyright © 2007 OW2 Consortium. All Rights Reserved.