org.objectweb.jonas.jms
Class JmsServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.objectweb.jonas.management.ReconfigDispatcher
          extended by org.objectweb.jonas.service.AbsServiceImpl
              extended by org.objectweb.jonas.jms.JmsServiceImpl
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, JmsService, JmsServiceImplMBean, ReconfigDispatcherMBean, Service

public class JmsServiceImpl
extends AbsServiceImpl
implements JmsService, JmsServiceImplMBean

JMS Service implementation.

Author:
Philippe Coq Contributor(s): Adriana Danes: highlight configuration properties 03.05.27 - Add support for monitoring of JMS destinations

Field Summary
static java.lang.String CLASS
           
static java.lang.String COLLOCATED
           
static java.lang.String DESTINATIONS
           
static java.lang.String MOM
           
static java.lang.String QUEUES
           
static java.lang.String SERVICE_NAME
           
static java.lang.String TOPICS
           
static java.lang.String URL
           
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
JmsServiceImpl()
           
 
Method Summary
 void createJmsQueueDestination(java.lang.String jndiName)
          MBean method Create a new Jms queue destination
 void createJmsTopicDestination(java.lang.String jndiName)
          MBean method Create a new Jms topic destination
 void doInit(javax.naming.Context ctx)
          Init the Service.
 void doStart()
          Start the Service Initialization of the service is already done.
 void doStop()
          Stop the JMS Service
 java.util.Set getAllJmsConnectionFactoryNames()
          MBean method return Set of Connection Factory Names
 java.util.Set getAllJmsQueueConnectionFactoryNames()
          MBean method return Set of Queue Connection Factory Names
 java.util.Set getAllJmsQueueDestinationNames()
          MBean method return Set of Queue Destinations Names
 java.util.Set getAllJmsTopicConnectionFactoryNames()
          MBean method return Set of Topic Connection Factory Names
 java.util.Set getAllJmsTopicDestinationNames()
          MBean method return Set of Topic Destination Names
 java.lang.String getConnectionFactoryMode(java.lang.String jndiName)
          Get the messaging mode a connection factory belongs to
 java.lang.Integer getCurrentNumberOfJmsConnectionFactory()
          MBean method
 java.lang.Integer getCurrentNumberOfJmsQueueConnectionFactory()
          MBean method
 java.lang.Integer getCurrentNumberOfJmsQueueDestination()
          MBean method
 java.lang.Integer getCurrentNumberOfJmsTopicConnectionFactory()
          MBean method
 java.lang.Integer getCurrentNumberOfJmsTopicDestination()
          MBean method
 java.lang.String getDefaultConnectionFactoryName()
           
 java.lang.String getDefaultQueueConnectionFactoryName()
          MBean method
 java.lang.String getDefaultTopicConnectionFactoryName()
          MBean method
 JmsManager getJmsManager()
           
 java.lang.String getMom()
           
 java.lang.Integer getPendingMessages(java.lang.String jndiName)
          Get number of pending messages on a queue
 java.lang.Integer getPendingRequests(java.lang.String jndiName)
          Get number of pending requests on a queue
 java.lang.Integer getSubscriptions(java.lang.String jndiName)
          Get number of subscriptions on a topic
 java.lang.String getUrl()
           
 java.lang.Boolean isMomLocal()
           
 void removeJmsDestination(java.lang.String jndiName)
          Remove a Jms destination
 void removeJmsQueueDestination(java.lang.String jndiName)
          MBean method Remove a Jms destination
 void removeJmsTopicDestination(java.lang.String jndiName)
          MBean method Remove a Jms destination
 void saveConfig()
          MBean method: save updated configuration
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
handleNotification, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values

COLLOCATED

public static final java.lang.String COLLOCATED
See Also:
Constant Field Values

MOM

public static final java.lang.String MOM
See Also:
Constant Field Values

TOPICS

public static final java.lang.String TOPICS
See Also:
Constant Field Values

QUEUES

public static final java.lang.String QUEUES
See Also:
Constant Field Values

DESTINATIONS

public static final java.lang.String DESTINATIONS
See Also:
Constant Field Values

URL

public static final java.lang.String URL
See Also:
Constant Field Values

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values
Constructor Detail

JmsServiceImpl

public JmsServiceImpl()
Method Detail

doInit

public void doInit(javax.naming.Context ctx)
            throws ServiceException
Init the Service. Configuration information is passed thru a Context object.

Specified by:
doInit in class AbsServiceImpl
Parameters:
ctx - configuration of the service
Throws:
ServiceException - service initialization failed

doStart

public void doStart()
             throws ServiceException
Start the Service Initialization of the service is already done. For administrating objects we use the class specified in the jms.provider property by default we use the Joram implementation

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - service start-up failed

doStop

public void doStop()
            throws ServiceException
Stop the JMS Service

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - service stopping failed

getJmsManager

public JmsManager getJmsManager()
Specified by:
getJmsManager in interface JmsService

getCurrentNumberOfJmsConnectionFactory

public java.lang.Integer getCurrentNumberOfJmsConnectionFactory()
MBean method

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

getCurrentNumberOfJmsTopicConnectionFactory

public java.lang.Integer getCurrentNumberOfJmsTopicConnectionFactory()
MBean method

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

getCurrentNumberOfJmsQueueConnectionFactory

public java.lang.Integer getCurrentNumberOfJmsQueueConnectionFactory()
MBean method

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

getCurrentNumberOfJmsTopicDestination

public java.lang.Integer getCurrentNumberOfJmsTopicDestination()
MBean method

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

getCurrentNumberOfJmsQueueDestination

public java.lang.Integer getCurrentNumberOfJmsQueueDestination()
MBean method

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

createJmsQueueDestination

public void createJmsQueueDestination(java.lang.String jndiName)
MBean method Create a new Jms queue destination

Specified by:
createJmsQueueDestination in interface JmsServiceImplMBean
Parameters:
String - jndi Name not yet implement with a remote host

createJmsTopicDestination

public void createJmsTopicDestination(java.lang.String jndiName)
MBean method Create a new Jms topic destination

Specified by:
createJmsTopicDestination in interface JmsServiceImplMBean
Parameters:
String - jndi Name not yet implement with a remote host

removeJmsTopicDestination

public void removeJmsTopicDestination(java.lang.String jndiName)
MBean method Remove a Jms destination

Specified by:
removeJmsTopicDestination in interface JmsServiceImplMBean
Parameters:
String - jndi name

removeJmsQueueDestination

public void removeJmsQueueDestination(java.lang.String jndiName)
MBean method Remove a Jms destination

Specified by:
removeJmsQueueDestination in interface JmsServiceImplMBean
Parameters:
String - jndi name

removeJmsDestination

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

Specified by:
removeJmsDestination in interface JmsServiceImplMBean
Parameters:
String - jndi name

getAllJmsQueueDestinationNames

public java.util.Set getAllJmsQueueDestinationNames()
MBean method return Set of Queue Destinations Names

Specified by:
getAllJmsQueueDestinationNames in interface JmsServiceImplMBean

getAllJmsTopicDestinationNames

public java.util.Set getAllJmsTopicDestinationNames()
MBean method return Set of Topic Destination Names

Specified by:
getAllJmsTopicDestinationNames in interface JmsServiceImplMBean

getAllJmsConnectionFactoryNames

public java.util.Set getAllJmsConnectionFactoryNames()
MBean method return Set of Connection Factory Names

Specified by:
getAllJmsConnectionFactoryNames in interface JmsServiceImplMBean

getAllJmsQueueConnectionFactoryNames

public java.util.Set getAllJmsQueueConnectionFactoryNames()
MBean method return Set of Queue Connection Factory Names

Specified by:
getAllJmsQueueConnectionFactoryNames in interface JmsServiceImplMBean

getAllJmsTopicConnectionFactoryNames

public java.util.Set getAllJmsTopicConnectionFactoryNames()
MBean method return Set of Topic Connection Factory Names

Specified by:
getAllJmsTopicConnectionFactoryNames in interface JmsServiceImplMBean

getDefaultQueueConnectionFactoryName

public java.lang.String getDefaultQueueConnectionFactoryName()
MBean method

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

getDefaultTopicConnectionFactoryName

public java.lang.String getDefaultTopicConnectionFactoryName()
MBean method

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

getDefaultConnectionFactoryName

public java.lang.String getDefaultConnectionFactoryName()
Specified by:
getDefaultConnectionFactoryName in interface JmsServiceImplMBean
Returns:
String name of default Connection factory

saveConfig

public void saveConfig()
MBean method: save updated configuration

Specified by:
saveConfig in interface JmsServiceImplMBean

getConnectionFactoryMode

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

Specified by:
getConnectionFactoryMode in interface JmsServiceImplMBean
Parameters:
jndiName - connection factory name
Returns:
messaging mode

getPendingMessages

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

Specified by:
getPendingMessages in interface JmsServiceImplMBean
Parameters:
jndiName - queue name
Returns:
number of pending messages

getPendingRequests

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

Specified by:
getPendingRequests in interface JmsServiceImplMBean
Parameters:
jndiName - queue name
Returns:
number of pending requests. If nb null, could not get this information.

getSubscriptions

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

Specified by:
getSubscriptions in interface JmsServiceImplMBean
Parameters:
jndiName - topic name
Returns:
number of subscriptions

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface JmsServiceImplMBean
Returns:
the MOM's URL if distant or "" if collocated

getMom

public java.lang.String getMom()
Specified by:
getMom in interface JmsServiceImplMBean

isMomLocal

public java.lang.Boolean isMomLocal()
Specified by:
isMomLocal in interface JmsServiceImplMBean