org.figure8.join.core.messaging
Class DefaultJMSConsumerBeanManager

java.lang.Object
  extended by org.figure8.join.core.messaging.DefaultJMSConsumerBeanManager
All Implemented Interfaces:
JMSConsumerBeanManager

public class DefaultJMSConsumerBeanManager
extends java.lang.Object
implements JMSConsumerBeanManager

This is the default implementation of JMSConsumerBeanManager. It uses a ConfigurableJencksContainer as a JCA container for activating / deactivating JMS consumers (Message Driven POJO style !)

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Constructor Summary
DefaultJMSConsumerBeanManager()
          Creates a new DefaultJMSConsumerBeanManager.
 
Method Summary
 JMSConsumerBeanInfo getConsumerBeanInfo(java.lang.String name)
          Retrieve the info object having the spoecified name.
 java.util.List getConsumerBeanInfos()
          Retrieve the info object corresponding to available JMSConsumerBeans.
 void removeConsumerBeanInfo(JMSConsumerBeanInfo info)
          Remove a JMSConsumerBean infos from datastore.
 void saveConsumerBeanInfo(JMSConsumerBeanInfo info)
          Save a JMSConsumerBean infos within datastore.
 void setConsumerDao(JMSConsumerBeanInfoDao consumerDao)
           
 void setContainer(ConfigurableJencksContainer container)
           
protected  void startConsumer(JMSConsumerBeanInfo info)
           
 void startConsumers()
          Starts all the already saved and registered consumers.
protected  void stopConsumer(JMSConsumerBeanInfo info)
           
 void stopConsumers()
          Stop all the already saved and registered consumers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJMSConsumerBeanManager

public DefaultJMSConsumerBeanManager()
Creates a new DefaultJMSConsumerBeanManager.

Method Detail

setConsumerDao

public void setConsumerDao(JMSConsumerBeanInfoDao consumerDao)
Parameters:
consumerDao - The consumer info dao implementation to use

setContainer

public void setContainer(ConfigurableJencksContainer container)
Parameters:
container - The configurable JCA container instance to use

saveConsumerBeanInfo

public void saveConsumerBeanInfo(JMSConsumerBeanInfo info)
                          throws DuplicateEntityException,
                                 InfrastructureException
Save a JMSConsumerBean infos within datastore. This method should also control the status of eventually existing consumers, depending on active attribute of the info bean.

Specified by:
saveConsumerBeanInfo in interface JMSConsumerBeanManager
Parameters:
info - The info on a JMSConsumerBean to save
Throws:
DuplicateEntityException - if another consumer with same name already exists.
InfrastructureException - if wrapped JCA container cannot activate consumer.

removeConsumerBeanInfo

public void removeConsumerBeanInfo(JMSConsumerBeanInfo info)
Remove a JMSConsumerBean infos from datastore. This method should also stop existing consumer instances before removing the related informations.

Specified by:
removeConsumerBeanInfo in interface JMSConsumerBeanManager
Parameters:
info - The info on a JMSConsumerBean to remove

getConsumerBeanInfo

public JMSConsumerBeanInfo getConsumerBeanInfo(java.lang.String name)
Retrieve the info object having the spoecified name.

Specified by:
getConsumerBeanInfo in interface JMSConsumerBeanManager
Parameters:
name - Name of the consumer bean info object to retrieve
Returns:
The JMSConsumerBeanInfo having this name, or null if none

getConsumerBeanInfos

public java.util.List getConsumerBeanInfos()
Retrieve the info object corresponding to available JMSConsumerBeans.

Specified by:
getConsumerBeanInfos in interface JMSConsumerBeanManager
Returns:
A List of org.figure8.join.core.messaging.JMSConsumerBeanInfo

startConsumers

public void startConsumers()
                    throws InfrastructureException
Starts all the already saved and registered consumers. This method should be called on startup.

Specified by:
startConsumers in interface JMSConsumerBeanManager
Throws:
InfrastructureException - if wrapped JCA container cannot activate consumer.

stopConsumers

public void stopConsumers()
Stop all the already saved and registered consumers. This method should be called on shutdown.

Specified by:
stopConsumers in interface JMSConsumerBeanManager

startConsumer

protected void startConsumer(JMSConsumerBeanInfo info)
                      throws InfrastructureException
Parameters:
info - The bean wrapping information on JMS consumer to start
Throws:
InfrastructureException - if wrapped JCA container cannot activate consumer.

stopConsumer

protected void stopConsumer(JMSConsumerBeanInfo info)
Parameters:
info - The bean wrapping information on JMS consumer to stop


Copyright © 2005-2008 Join. All Rights Reserved.