org.apache.servicemix.jbi.container
Class SpringJBIContainer

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.container.JBIContainer
          extended by org.apache.servicemix.jbi.container.SpringJBIContainer
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.api.Container, MBeanInfoProvider, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class SpringJBIContainer
extends JBIContainer
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.ApplicationContextAware

An enhanced JBI container which adds some Spring helper methods for easier configuration through spring's XML configuration file.

Version:
$Revision: 594535 $

Field Summary
 
Fields inherited from class org.apache.servicemix.jbi.container.JBIContainer
adminCommandsService, autoDeployService, autoEnlistInTransaction, broker, clientFactory, configuredListeners, DEFAULT_NAME, deploymentService, embedded, environmentContext, executorFactory, installationService, listeners, managementContext, notifyStatistics, persistent, registry, serviceManager, services, shutdownHook, useNewTransactionModel, useShutdownHook
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
SpringJBIContainer()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 ActivationSpec[] getActivationSpecs()
           
 org.springframework.context.ApplicationContext getApplicationContext()
           
 Object getBean(String id)
          Returns the compoment or POJO registered with the given component ID.
 org.springframework.beans.factory.BeanFactory getBeanFactory()
           
 String[] getComponentNames()
           
 Map getComponents()
           
 String[] getDeployArchives()
           
 DeploySupport[] getDeployments()
           
 Map getEndpoints()
           
protected  Object lookupBean(String componentName)
           
 void onShutDown(Runnable runnable)
          Set a Runnable which can handle the shutdown of the container
 void setActivationSpecs(ActivationSpec[] activationSpecs)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setComponentNames(String[] componentNames)
           
 void setComponents(Map components)
           
 void setDeployArchives(String[] deployArchives)
           
 void setDeployments(DeploySupport[] deployments)
           
 void setEndpoints(Map endpoints)
           
 void shutDown()
          After a shutdown the container will require an init before a start ...
 void stop()
          stop the container from processing
 
Methods inherited from class org.apache.servicemix.jbi.container.JBIContainer
activateComponent, activateComponent, activateComponent, activateComponent, activateComponent, activateComponent, addListener, addShutdownHook, checkInitialized, containerShutdown, createComponentAdaptor, createComponentAdaptor, createComponentID, createExecutorFactory, createRootDir, deactivateComponent, defaultComponentServiceAndEndpoint, deleteComponent, deregisterExternalEndpoint, getAdminCommandsService, getAutoDeploymentService, getBroker, getClientFactory, getComponent, getDefaultBroker, getDeploymentDirPath, getDeploymentExtensions, getDeploymentService, getDescription, getEndpoint, getEndpoints, getEndpointsForService, getEnvironmentContext, getExecutorFactory, getExternalEndpoints, getExternalEndpointsForService, getFlow, getFlowName, getFlowNames, getFlows, getForceShutdown, getGeneratedRootDirPrefix, getInstallationDirPath, getInstallationService, getListeners, getLocalComponentConnectors, getLogger, getManagementContext, getMBeanServer, getMonitorInterval, getName, getNamingContext, getRegistry, getRmiPort, getRootDir, getServices, getSubscriptionFlowName, getTransactionManager, init, installArchive, isAutoEnlistInTransaction, isCreateJmxConnector, isCreateMBeanServer, isEmbedded, isGenerateRootDir, isMonitorDeploymentDirectory, isMonitorInstallationDirectory, isNotifyStatistics, isPersistent, isUseMBeanServer, isUseNewTransactionModel, isUseShutdownHook, registerExternalEndpoint, removeListener, removeShutdownHook, resendExchange, resolveEndpointReference, sendExchange, setAutoEnlistInTransaction, setBroker, setCreateJmxConnector, setCreateMBeanServer, setDeploymentDirPath, setDeploymentExtensions, setEmbedded, setExecutorFactory, setFlow, setFlowName, setFlowNames, setFlows, setForceShutdown, setGeneratedRootDirPrefix, setGenerateRootDir, setInstallationDirPath, setListeners, setMBeanServer, setMonitorDeploymentDirectory, setMonitorInstallationDirectory, setMonitorInterval, setName, setNamingContext, setNotifyStatistics, setPersistent, setRmiPort, setRootDir, setServices, setSubscriptionFlowName, setTransactionManager, setUseMBeanServer, setUseNewTransactionModel, setUseShutdownHook, start, updateExternalArchive, updateExternalArchive
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getObjectToManage, getOperationInfos, getSubType, getType, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringJBIContainer

public SpringJBIContainer()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

stop

public void stop()
          throws javax.jbi.JBIException
Description copied from class: JBIContainer
stop the container from processing

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class JBIContainer
Throws:
javax.jbi.JBIException - if the item fails to stop.

getBean

public Object getBean(String id)
Returns the compoment or POJO registered with the given component ID.

Parameters:
id -
Returns:
the Component

getBeanFactory

public org.springframework.beans.factory.BeanFactory getBeanFactory()

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

getComponentNames

public String[] getComponentNames()

setComponentNames

public void setComponentNames(String[] componentNames)

getActivationSpecs

public ActivationSpec[] getActivationSpecs()

setActivationSpecs

public void setActivationSpecs(ActivationSpec[] activationSpecs)
                        throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getDeployArchives

public String[] getDeployArchives()

setDeployArchives

public void setDeployArchives(String[] deployArchives)

getDeployments

public DeploySupport[] getDeployments()

setDeployments

public void setDeployments(DeploySupport[] deployments)

lookupBean

protected Object lookupBean(String componentName)

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()
Returns:

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Description copied from class: JBIContainer
After a shutdown the container will require an init before a start ...

Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Overrides:
shutDown in class JBIContainer
Throws:
javax.jbi.JBIException - if the item fails to shut down.

onShutDown

public void onShutDown(Runnable runnable)
Set a Runnable which can handle the shutdown of the container

Parameters:
runnable - the shutdown handler

getComponents

public Map getComponents()

setComponents

public void setComponents(Map components)

getEndpoints

public Map getEndpoints()

setEndpoints

public void setEndpoints(Map endpoints)


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.