org.figure8.join.core.messaging
Class ConfigurableJencksContainer

java.lang.Object
  extended by org.jencks.JCAContainer
      extended by org.figure8.join.core.messaging.ConfigurableJencksContainer
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class ConfigurableJencksContainer
extends org.jencks.JCAContainer

This is an extension of Jencks JCAContainer that can be further configured depending on ApplicationConfig and using extra properties provided by a ActiveMQConfigurator instance.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux
See Also:
ApplicationConfig, ActiveMQConfigurator

Constructor Summary
ConfigurableJencksContainer()
           
 
Method Summary
 void activateJMSConsumerBean(JMSConsumerBeanInfo info)
          Activate a JMS consumer within container using a JCA connector.
 void afterPropertiesSet()
          Override of method from Jencks JCAContainer.
protected  org.activemq.ra.ActiveMQActivationSpec createActivationSpec(JMSConsumerBeanInfo info)
          Create corresponding JCA ActivationSpec for a JMS consumer.
protected  javax.resource.spi.endpoint.MessageEndpointFactory createMessageEndpointFactory(JMSConsumerBeanInfo info)
          Create a JCA MessageEndpointFactory for a JMS consumer.
protected  void createResourceAdapter()
          Create a ResourceAdapter and assign it to this Jencks JCA container.
 void deactivateJMSConsumerBean(JMSConsumerBeanInfo info)
          Deactivate a JMS consumer within container using the corresponding JCA connector.
 void setActiveMQConfigurator(ActiveMQConfigurator configurator)
           
 void setTransactionManager(javax.transaction.TransactionManager transactionManager)
           
 
Methods inherited from class org.jencks.JCAContainer
addConnector, destroy, getBeanFactory, getBootstrapContext, getResourceAdapter, isLazyLoad, setBeanFactory, setBootstrapContext, setLazyLoad, setResourceAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurableJencksContainer

public ConfigurableJencksContainer()
Method Detail

setActiveMQConfigurator

public void setActiveMQConfigurator(ActiveMQConfigurator configurator)
Parameters:
configurator - Helper for configuring connection factory

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager transactionManager)
Parameters:
transactionManager - TransactionManager for creating inbound connectors

activateJMSConsumerBean

public void activateJMSConsumerBean(JMSConsumerBeanInfo info)
                             throws javax.resource.ResourceException
Activate a JMS consumer within container using a JCA connector.

Parameters:
info - The bean wrapping informations on a JMS consumer
Throws:
javax.resource.ResourceException - if consumer cannot be activated into JCA resource adapter

deactivateJMSConsumerBean

public void deactivateJMSConsumerBean(JMSConsumerBeanInfo info)
Deactivate a JMS consumer within container using the corresponding JCA connector.

Parameters:
info - The bean wrapping informations on a JMS consumer

createResourceAdapter

protected void createResourceAdapter()
Create a ResourceAdapter and assign it to this Jencks JCA container. This method implementation creates an ActiveMQ resource adapter.


createActivationSpec

protected org.activemq.ra.ActiveMQActivationSpec createActivationSpec(JMSConsumerBeanInfo info)
                                                               throws javax.resource.ResourceException
Create corresponding JCA ActivationSpec for a JMS consumer. This method implementations creates an ActiveMQ activation spec.

Parameters:
info - The bean wrapping informations on a JMS consumer
Returns:
The newly created ActivationSpec
Throws:
javax.resource.ResourceException - if spec cannot be activated with JCA resource adapter

createMessageEndpointFactory

protected javax.resource.spi.endpoint.MessageEndpointFactory createMessageEndpointFactory(JMSConsumerBeanInfo info)
Create a JCA MessageEndpointFactory for a JMS consumer. This method implementations creates a JMSConsumerEndpointFactory.

Parameters:
info - The bean wrapping informations on a JMS consumer
Returns:
The newly created MessageEndpointFactory

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Override of method from Jencks JCAContainer. This implementation dynamically creates an ActiveMQ ResourceAdapter depending on informations provided by ActiveMQConfigurator object.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class org.jencks.JCAContainer
Throws:
java.lang.Exception - IllegalArgumentException if Jencks container is not well configured


Copyright © 2005-2008 Join. All Rights Reserved.