org.apache.servicemix.jbi.container
Class JBIContainer

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.container.JBIContainer
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.api.Container, MBeanInfoProvider
Direct Known Subclasses:
SpringJBIContainer

public class JBIContainer
extends BaseLifeCycle
implements org.apache.servicemix.jbi.api.Container

The main container

Version:
$Revision: 3807 $

Field Summary
protected  AdminCommandsService adminCommandsService
           
protected  AutoDeploymentService autoDeployService
           
protected  boolean autoEnlistInTransaction
           
protected  Broker broker
           
protected  ClientFactory clientFactory
           
protected  EventListener[] configuredListeners
           
static String DEFAULT_NAME
          Default Container name - must be unique if used in a cluster
protected  DeploymentService deploymentService
           
protected  boolean embedded
           
protected  EnvironmentContext environmentContext
           
protected  org.apache.servicemix.executors.ExecutorFactory executorFactory
           
protected  InstallationService installationService
           
protected  EventListenerList listeners
           
protected  ManagementContext managementContext
           
protected  boolean notifyStatistics
           
protected  boolean persistent
           
protected  Registry registry
           
protected  javax.jbi.component.ServiceUnitManager serviceManager
           
protected  BaseSystemService[] services
           
protected  Thread shutdownHook
           
protected  boolean useNewTransactionModel
           
protected  boolean 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
JBIContainer()
          Default Constructor
 
Method Summary
 javax.jbi.component.Component activateComponent(ActivationSpec activationSpec)
          Activates a new component
 ObjectName activateComponent(javax.jbi.component.Component component, ActivationSpec activationSpec)
          Activate A POJO Component
 ObjectName activateComponent(javax.jbi.component.Component component, String componentName)
          Activate a POJO Component
 ObjectName activateComponent(javax.jbi.component.Component component, String description, ActivationSpec activationSpec, boolean pojo, boolean binding, boolean service, String[] sharedLibraries)
           
 ObjectName activateComponent(File installationDir, javax.jbi.component.Component component, String description, ComponentContextImpl context, ActivationSpec activationSpec, boolean pojo, boolean binding, boolean service, String[] sharedLibraries)
           
 ObjectName activateComponent(File installDir, javax.jbi.component.Component component, String description, ComponentContextImpl context, boolean binding, boolean service, String[] sharedLibraries)
          Called by the Installer MBean
 void addListener(EventListener listener)
           
protected  void addShutdownHook()
           
protected  void checkInitialized()
           
protected  void containerShutdown()
          Causes a clean shutdown of the container when the VM is being shut down
protected  javax.jbi.component.Component createComponentAdaptor(javax.jbi.component.ComponentLifeCycle lifeCycle, ActivationSpec activationSpec)
          Factory method to create a new component adaptor from the given lifecycle
protected  javax.jbi.component.Component createComponentAdaptor(org.apache.servicemix.jbi.listener.MessageExchangeListener listener, ActivationSpec activationSpec)
           
protected  String createComponentID()
          Factory method to create a new component ID if none is specified
protected  org.apache.servicemix.executors.ExecutorFactory createExecutorFactory()
           
protected  String createRootDir()
          Creates a new rootDir
 void deactivateComponent(String componentName)
          Used for Simple POJO's
protected  void defaultComponentServiceAndEndpoint(PojoSupport component, ActivationSpec activationSpec)
          Allow the service and endpoint name to be configured from the registration, to reduce the amount of XML which is required to configure a ServiceMix component
 void deleteComponent(String id)
          Delete a Component
 void deregisterExternalEndpoint(ComponentNameSpace cns, javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
           
protected  void forceShutdown(Exception e)
          Force a container shutdown by canceling all pending exchanges
 AdminCommandsService getAdminCommandsService()
           
 AutoDeploymentService getAutoDeploymentService()
           
 Broker getBroker()
           
 ClientFactory getClientFactory()
           
 ComponentMBeanImpl getComponent(String componentName)
          Get the component associated with the given component ID
 DefaultBroker getDefaultBroker()
          Return the DefaultBroker instance
 String getDeploymentDirPath()
           
 String getDeploymentExtensions()
           
 DeploymentService getDeploymentService()
           
 String getDescription()
          Get the description
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint(ComponentContextImpl context, QName service, String endpointName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(ComponentContextImpl context, QName interfaceName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(ComponentContextImpl context, QName serviceName)
           
 EnvironmentContext getEnvironmentContext()
           
 org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
           
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(ComponentContextImpl context, QName interfaceName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(ComponentContextImpl context, QName serviceName)
           
 Flow getFlow()
           
 String getFlowName()
           
 String getFlowNames()
           
 Flow[] getFlows()
           
 long getForceShutdown()
           
 String getGeneratedRootDirPrefix()
           
 String getInstallationDirPath()
           
 InstallationService getInstallationService()
           
 Object[] getListeners(Class lc)
           
 Collection getLocalComponentConnectors()
           
 Logger getLogger(String suffix, String resourceBundleName)
           
 ManagementContext getManagementContext()
          Get the ManagementContext
 MBeanServer getMBeanServer()
           
 int getMonitorInterval()
           
 String getName()
          Get the name of the item
 InitialContext getNamingContext()
           
 Registry getRegistry()
           
 int getRmiPort()
           
 String getRootDir()
           
 BaseSystemService[] getServices()
           
 String getSubscriptionFlowName()
           
 Object getTransactionManager()
           
 void init()
          light weight initialization - default values for mbeanServer, TransactionManager etc are null
 void installArchive(String url)
          Install an component from a url
 boolean isAutoEnlistInTransaction()
          Retrieve the value for automatic transaction enlistment.
 boolean isCreateJmxConnector()
           
 boolean isCreateMBeanServer()
           
 boolean isEmbedded()
           
 boolean isGenerateRootDir()
           
 boolean isMonitorDeploymentDirectory()
           
 boolean isMonitorInstallationDirectory()
           
 boolean isNotifyStatistics()
           
 boolean isPersistent()
           
 boolean isUseMBeanServer()
           
 boolean isUseNewTransactionModel()
           
 boolean isUseShutdownHook()
           
 void registerExternalEndpoint(ComponentNameSpace cns, javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
           
 void removeListener(EventListener listener)
           
protected  void removeShutdownHook()
           
 void resendExchange(javax.jbi.messaging.MessageExchange exchange)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(ComponentContextImpl context, DocumentFragment epr)
           
 void sendExchange(MessageExchangeImpl exchange)
          Route an ExchangePacket to a destination
 void setAutoEnlistInTransaction(boolean autoEnlistInTransaction)
          Set the new value for automatic transaction enlistment.
 void setBroker(Broker broker)
          Set the Broker to use
 void setCreateJmxConnector(boolean createJmxConnector)
           
 void setCreateMBeanServer(boolean enableJMX)
          Set the flag to create own MBeanServer if none supplied
 void setDeploymentDirPath(String deploymentDir)
           
 void setDeploymentExtensions(String deploymentExtensions)
           
 void setEmbedded(boolean embedded)
           
 void setExecutorFactory(org.apache.servicemix.executors.ExecutorFactory executorFactory)
           
 void setFlow(Flow flow)
          Set the broker message flow
 void setFlowName(String flowName)
           
 void setFlowNames(String flowNames)
           
 void setFlows(Flow[] flows)
          Set the broker message flows
 void setForceShutdown(long forceShutdown)
          Set the timeout (in ms) before a shutdown is forced by cancelling all pending exchanges.
 void setGeneratedRootDirPrefix(String generatedRootDirPrefix)
          Sets the prefix used when auto-creating a rootDir property value which is useful for integration testing inside JUnit test cases letting each test case create its own empty servicemix install
 void setGenerateRootDir(boolean generateRootDir)
          Creates an auto-generated rootDir which is useful for integration testing in JUnit test cases allowing installations of deployments inside an empty installation of ServiceMix
 void setInstallationDirPath(String installationDir)
          Set the installationDir - rge default location is root//installation
 void setListeners(EventListener[] listeners)
           
 void setMBeanServer(MBeanServer mbs)
          Set the MBeanServer
 void setMonitorDeploymentDirectory(boolean monitorDeploymentDirectory)
           
 void setMonitorInstallationDirectory(boolean monitorInstallationDirectory)
           
 void setMonitorInterval(int monitorInterval)
           
 void setName(String name)
           
 void setNamingContext(InitialContext ic)
          Set the naming context
 void setNotifyStatistics(boolean notifyStatistics)
           
 void setPersistent(boolean persistent)
          Set the new default value for exchange persistence.
 void setRmiPort(int portNum)
           
 void setRootDir(String root)
          Set the workspace root
 void setServices(BaseSystemService[] services)
           
 void setSubscriptionFlowName(String subscriptionFlowName)
          Set the subscription flow name
 void setTransactionManager(Object tm)
          Set the transaction manager
 void setUseMBeanServer(boolean useMBeanServer)
           
 void setUseNewTransactionModel(boolean useNewTransactionModel)
          Sets whether the new transaction model should be used.
 void setUseShutdownHook(boolean useShutdownHook)
          Sets whether or not we should use a shutdown handler to close down the broker cleanly if the JVM is terminated.
 void shutDown()
          After a shutdown the container will require an init before a start ...
 void start()
          start processing
 void stop()
          stop the container from processing
 void updateExternalArchive(String location)
          load an archive from an external location and starts it The archive can be a Component, Service Assembly or Shared Library.
 void updateExternalArchive(String location, boolean autoStart)
          load an archive from an external location.
 
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
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
Default Container name - must be unique if used in a cluster

See Also:
Constant Field Values

broker

protected Broker broker

serviceManager

protected javax.jbi.component.ServiceUnitManager serviceManager

managementContext

protected ManagementContext managementContext

environmentContext

protected EnvironmentContext environmentContext

installationService

protected InstallationService installationService

deploymentService

protected DeploymentService deploymentService

autoDeployService

protected AutoDeploymentService autoDeployService

adminCommandsService

protected AdminCommandsService adminCommandsService

services

protected BaseSystemService[] services

clientFactory

protected ClientFactory clientFactory

registry

protected Registry registry

autoEnlistInTransaction

protected boolean autoEnlistInTransaction

persistent

protected boolean persistent

embedded

protected boolean embedded

notifyStatistics

protected boolean notifyStatistics

listeners

protected EventListenerList listeners

configuredListeners

protected EventListener[] configuredListeners

useShutdownHook

protected boolean useShutdownHook

useNewTransactionModel

protected boolean useNewTransactionModel

shutdownHook

protected transient Thread shutdownHook

executorFactory

protected org.apache.servicemix.executors.ExecutorFactory executorFactory
Constructor Detail

JBIContainer

public JBIContainer()
Default Constructor

Method Detail

getName

public String getName()
Description copied from class: BaseLifeCycle
Get the name of the item

Specified by:
getName in interface MBeanInfoProvider
Overrides:
getName in class BaseLifeCycle
Returns:
Returns the unique nam for the Container

setName

public void setName(String name)
Parameters:
name - The name to set (must be unique within a cluster)

getDescription

public String getDescription()
Get the description

Specified by:
getDescription in interface MBeanInfoProvider
Returns:
descrption

getFlowName

public String getFlowName()
Returns:
Returns the flowName.

setFlowName

public void setFlowName(String flowName)
Parameters:
flowName - The flow to set.

getFlowNames

public String getFlowNames()
Returns:
Returns the flowNames.

setFlowNames

public void setFlowNames(String flowNames)
Parameters:
flowNames - The flows to set.

getSubscriptionFlowName

public String getSubscriptionFlowName()
Returns:
the subscriptionFlowName

setSubscriptionFlowName

public void setSubscriptionFlowName(String subscriptionFlowName)
Set the subscription flow name

Parameters:
subscriptionFlowName -

setFlow

public void setFlow(Flow flow)
Set the broker message flow

Parameters:
flow -

getFlow

public Flow getFlow()
Returns:
the broker message Flow

setFlows

public void setFlows(Flow[] flows)
Set the broker message flows

Parameters:
flows -

getFlows

public Flow[] getFlows()
Returns:
the broker message Flows

isUseShutdownHook

public boolean isUseShutdownHook()

setUseShutdownHook

public void setUseShutdownHook(boolean useShutdownHook)
Sets whether or not we should use a shutdown handler to close down the broker cleanly if the JVM is terminated. It is recommended you leave this enabled.


isUseNewTransactionModel

public boolean isUseNewTransactionModel()

setUseNewTransactionModel

public void setUseNewTransactionModel(boolean useNewTransactionModel)
Sets whether the new transaction model should be used.

Parameters:
useNewTransactionModel -

getServices

public BaseSystemService[] getServices()
Returns:
the services

setServices

public void setServices(BaseSystemService[] services)
Parameters:
services - the services to set

getManagementContext

public ManagementContext getManagementContext()
Get the ManagementContext

Returns:
the ManagementContext

getEnvironmentContext

public EnvironmentContext getEnvironmentContext()
Returns:
Return the EnvironmentContext

getRegistry

public Registry getRegistry()
Returns:
Return the registry

getDefaultBroker

public DefaultBroker getDefaultBroker()
Return the DefaultBroker instance


getBroker

public Broker getBroker()
Returns:
Return the NMR broker

setBroker

public void setBroker(Broker broker)
Set the Broker to use


isCreateMBeanServer

public boolean isCreateMBeanServer()
Returns:
true if creates own MBeanServer if none supplied

setCreateMBeanServer

public void setCreateMBeanServer(boolean enableJMX)
Set the flag to create own MBeanServer if none supplied

Parameters:
enableJMX -

isUseMBeanServer

public boolean isUseMBeanServer()
Returns:
Returns the useMBeanServer.

setUseMBeanServer

public void setUseMBeanServer(boolean useMBeanServer)
Parameters:
useMBeanServer - The useMBeanServer to set.

isCreateJmxConnector

public boolean isCreateJmxConnector()
Returns:
Returns the useMBeanServer.

setCreateJmxConnector

public void setCreateJmxConnector(boolean createJmxConnector)
Parameters:
createJmxConnector - The createJmxConnector to set.

isMonitorInstallationDirectory

public boolean isMonitorInstallationDirectory()
Returns:
Returns the monitorInstallationDirectory.

setMonitorInstallationDirectory

public void setMonitorInstallationDirectory(boolean monitorInstallationDirectory)
Parameters:
monitorInstallationDirectory - The monitorInstallationDirectory to set.

isMonitorDeploymentDirectory

public boolean isMonitorDeploymentDirectory()
Returns:
Returns the monitorDeploymentDirectory.

setMonitorDeploymentDirectory

public void setMonitorDeploymentDirectory(boolean monitorDeploymentDirectory)
Parameters:
monitorDeploymentDirectory - The monitorDeploymentDirectory to set.

getInstallationDirPath

public String getInstallationDirPath()
Returns:
Returns the installationDir.

setInstallationDirPath

public void setInstallationDirPath(String installationDir)
Set the installationDir - rge default location is root//installation

Parameters:
installationDir -

getDeploymentDirPath

public String getDeploymentDirPath()
Returns:
Returns the deploymentDir.

setDeploymentDirPath

public void setDeploymentDirPath(String deploymentDir)
Parameters:
deploymentDir - The deploymentDir to set.

getMonitorInterval

public int getMonitorInterval()
Returns:
Returns the monitorInterval (in secs).

setMonitorInterval

public void setMonitorInterval(int monitorInterval)
Parameters:
monitorInterval - The monitorInterval to set (in secs).

getDeploymentExtensions

public String getDeploymentExtensions()
Returns:
the deploymentExtensions

setDeploymentExtensions

public void setDeploymentExtensions(String deploymentExtensions)
Parameters:
deploymentExtensions - the deploymentExtensions to set

installArchive

public void installArchive(String url)
                    throws javax.jbi.management.DeploymentException
Install an component from a url

Parameters:
url -
Throws:
javax.jbi.management.DeploymentException

updateExternalArchive

public void updateExternalArchive(String location,
                                  boolean autoStart)
                           throws javax.jbi.management.DeploymentException
load an archive from an external location. The archive can be a Component, Service Assembly or Shared Library.

Parameters:
location - - can either be a url or filename (if relative - must be relative to the container)
autoStart - - if true will start the component/service assembly
Throws:
javax.jbi.management.DeploymentException

updateExternalArchive

public void updateExternalArchive(String location)
                           throws javax.jbi.management.DeploymentException
load an archive from an external location and starts it The archive can be a Component, Service Assembly or Shared Library.

Parameters:
location - - can either be a url or filename (if relative - must be relative to the container)
Throws:
javax.jbi.management.DeploymentException

getDeploymentService

public DeploymentService getDeploymentService()
Returns:
Returns the deploymentService.

getInstallationService

public InstallationService getInstallationService()
Returns:
Returns the installationService.

getAutoDeploymentService

public AutoDeploymentService getAutoDeploymentService()
Returns:
the AutomDeploymentService

getAdminCommandsService

public AdminCommandsService getAdminCommandsService()
Returns:
the AdminCommandsService

getClientFactory

public ClientFactory getClientFactory()
Specified by:
getClientFactory in interface org.apache.servicemix.jbi.api.Container

getGeneratedRootDirPrefix

public String getGeneratedRootDirPrefix()

setGeneratedRootDirPrefix

public void setGeneratedRootDirPrefix(String generatedRootDirPrefix)
Sets the prefix used when auto-creating a rootDir property value which is useful for integration testing inside JUnit test cases letting each test case create its own empty servicemix install

Parameters:
generatedRootDirPrefix - the prefix used to auto-create the rootDir
See Also:
setRootDir(String), setGeneratedRootDirPrefix(String)

isGenerateRootDir

public boolean isGenerateRootDir()

getForceShutdown

public long getForceShutdown()

setForceShutdown

public void setForceShutdown(long forceShutdown)
Set the timeout (in ms) before a shutdown is forced by cancelling all pending exchanges. The default value is 0 -- no forced shutdown

Parameters:
forceShutdown - the timeout in ms

setGenerateRootDir

public void setGenerateRootDir(boolean generateRootDir)
Creates an auto-generated rootDir which is useful for integration testing in JUnit test cases allowing installations of deployments inside an empty installation of ServiceMix

Parameters:
generateRootDir - if true this will enable the auto-generation of the rootDir if the rootDir property is not configured
See Also:
setRootDir(String), setGeneratedRootDirPrefix(String)

init

public void init()
          throws javax.jbi.JBIException
light weight initialization - default values for mbeanServer, TransactionManager etc are null

Overrides:
init in class BaseLifeCycle
Throws:
javax.jbi.JBIException

start

public void start()
           throws javax.jbi.JBIException
start processing

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class BaseLifeCycle
Throws:
javax.jbi.JBIException

stop

public void stop()
          throws javax.jbi.JBIException
stop the container from processing

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class BaseLifeCycle
Throws:
javax.jbi.JBIException

shutDown

public void shutDown()
              throws javax.jbi.JBIException
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 BaseLifeCycle
Throws:
javax.jbi.JBIException

forceShutdown

protected void forceShutdown(Exception e)
Force a container shutdown by canceling all pending exchanges

Parameters:
e - the exception that caused the forced container shutdown

addShutdownHook

protected void addShutdownHook()

removeShutdownHook

protected void removeShutdownHook()

containerShutdown

protected void containerShutdown()
Causes a clean shutdown of the container when the VM is being shut down


getMBeanServer

public MBeanServer getMBeanServer()
Returns:
theMBean server assocated with the JBI

setMBeanServer

public void setMBeanServer(MBeanServer mbs)
Set the MBeanServer

Parameters:
mbs -

getNamingContext

public InitialContext getNamingContext()
Returns:
the naming context

setNamingContext

public void setNamingContext(InitialContext ic)
Set the naming context

Parameters:
ic -

getTransactionManager

public Object getTransactionManager()
Returns:
the TransactionManager for this implementation

setTransactionManager

public void setTransactionManager(Object tm)
Set the transaction manager

Parameters:
tm -

getRootDir

public String getRootDir()
Returns:
the root directory path

setRootDir

public void setRootDir(String root)
Set the workspace root

Parameters:
root -

sendExchange

public void sendExchange(MessageExchangeImpl exchange)
                  throws javax.jbi.messaging.MessagingException
Route an ExchangePacket to a destination

Parameters:
exchange -
Throws:
javax.jbi.messaging.MessagingException

registerExternalEndpoint

public void registerExternalEndpoint(ComponentNameSpace cns,
                                     javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                              throws javax.jbi.JBIException
Parameters:
context -
externalEndpoint -
Throws:
javax.jbi.JBIException

deregisterExternalEndpoint

public void deregisterExternalEndpoint(ComponentNameSpace cns,
                                       javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                                throws javax.jbi.JBIException
Parameters:
context -
externalEndpoint -
Throws:
javax.jbi.JBIException

resolveEndpointReference

public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(ComponentContextImpl context,
                                                                      DocumentFragment epr)
Parameters:
context -
epr -
Returns:
matching endpoint or null

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(ComponentContextImpl context,
                                                         QName service,
                                                         String endpointName)
Parameters:
context -
service -
endpointName -
Returns:
the matching endpoint

getEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(ComponentContextImpl context,
                                                            QName interfaceName)
Parameters:
context -
interfaceName -
Returns:
endpoints that match the interface name

getEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(ComponentContextImpl context,
                                                                      QName serviceName)
Parameters:
context -
serviceName -
Returns:
endpoints for a given service

getExternalEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(ComponentContextImpl context,
                                                                    QName interfaceName)
Parameters:
context -
interfaceName -
Returns:
endpoints matching the interface name

getExternalEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(ComponentContextImpl context,
                                                                              QName serviceName)
Parameters:
context -
serviceName -
Returns:
external endpoints

getLogger

public Logger getLogger(String suffix,
                        String resourceBundleName)
                 throws MissingResourceException,
                        javax.jbi.JBIException
Parameters:
suffix -
resourceBundleName -
Returns:
the Logger
Throws:
MissingResourceException
javax.jbi.JBIException

deactivateComponent

public void deactivateComponent(String componentName)
                         throws javax.jbi.JBIException
Used for Simple POJO's

Parameters:
componentName - - the unique component ID
Throws:
javax.jbi.JBIException

deleteComponent

public void deleteComponent(String id)
                     throws javax.jbi.JBIException
Delete a Component

Parameters:
id -
Throws:
javax.jbi.JBIException

getComponent

public ComponentMBeanImpl getComponent(String componentName)
Get the component associated with the given component ID

Parameters:
componentName -
Returns:
the component

getLocalComponentConnectors

public Collection getLocalComponentConnectors()
Returns:
all local ComponentConnectors

activateComponent

public javax.jbi.component.Component activateComponent(ActivationSpec activationSpec)
                                                throws javax.jbi.JBIException
Activates a new component

Parameters:
activationSpec -
Returns:
Component
Throws:
javax.jbi.JBIException

activateComponent

public ObjectName activateComponent(javax.jbi.component.Component component,
                                    String componentName)
                             throws javax.jbi.JBIException
Activate a POJO Component

Parameters:
component -
componentName -
Returns:
the ObjectName of the MBean for the Component
Throws:
javax.jbi.JBIException

activateComponent

public ObjectName activateComponent(javax.jbi.component.Component component,
                                    ActivationSpec activationSpec)
                             throws javax.jbi.JBIException
Activate A POJO Component

Parameters:
component -
activationSpec -
Returns:
the ObjectName of the MBean for the Component
Throws:
javax.jbi.JBIException

activateComponent

public ObjectName activateComponent(File installDir,
                                    javax.jbi.component.Component component,
                                    String description,
                                    ComponentContextImpl context,
                                    boolean binding,
                                    boolean service,
                                    String[] sharedLibraries)
                             throws javax.jbi.JBIException
Called by the Installer MBean

Parameters:
installDir -
component -
description -
context -
binding -
service -
Returns:
the ObjectName of the Component's MBean
Throws:
javax.jbi.JBIException

activateComponent

public ObjectName activateComponent(javax.jbi.component.Component component,
                                    String description,
                                    ActivationSpec activationSpec,
                                    boolean pojo,
                                    boolean binding,
                                    boolean service,
                                    String[] sharedLibraries)
                             throws javax.jbi.JBIException
Parameters:
component -
description -
activationSpec -
pojo -
binding -
service -
Returns:
the ObjectName of the Component's MBean
Throws:
javax.jbi.JBIException

activateComponent

public ObjectName activateComponent(File installationDir,
                                    javax.jbi.component.Component component,
                                    String description,
                                    ComponentContextImpl context,
                                    ActivationSpec activationSpec,
                                    boolean pojo,
                                    boolean binding,
                                    boolean service,
                                    String[] sharedLibraries)
                             throws javax.jbi.JBIException
Parameters:
installationDir -
component -
description -
context -
activationSpec -
pojo -
binding -
service -
Returns:
the ObjectName of the Component's MBean
Throws:
javax.jbi.JBIException

defaultComponentServiceAndEndpoint

protected void defaultComponentServiceAndEndpoint(PojoSupport component,
                                                  ActivationSpec activationSpec)
Allow the service and endpoint name to be configured from the registration, to reduce the amount of XML which is required to configure a ServiceMix component

Parameters:
component -
activationSpec -

createExecutorFactory

protected org.apache.servicemix.executors.ExecutorFactory createExecutorFactory()
                                                                         throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

createComponentAdaptor

protected javax.jbi.component.Component createComponentAdaptor(javax.jbi.component.ComponentLifeCycle lifeCycle,
                                                               ActivationSpec activationSpec)
Factory method to create a new component adaptor from the given lifecycle

Parameters:
lifeCycle -
activationSpec -
Returns:
Component

createComponentAdaptor

protected javax.jbi.component.Component createComponentAdaptor(org.apache.servicemix.jbi.listener.MessageExchangeListener listener,
                                                               ActivationSpec activationSpec)

createComponentID

protected String createComponentID()
Factory method to create a new component ID if none is specified

Returns:
uniqueId

checkInitialized

protected void checkInitialized()
                         throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

isAutoEnlistInTransaction

public boolean isAutoEnlistInTransaction()
Retrieve the value for automatic transaction enlistment.

Returns:

setAutoEnlistInTransaction

public void setAutoEnlistInTransaction(boolean autoEnlistInTransaction)
Set the new value for automatic transaction enlistment. When this parameter is set to true and a transaction is running when sending / receiving an exchange, this operation will automatically be done in the current transaction.

Parameters:
autoEnlistInTransaction -

isPersistent

public boolean isPersistent()

setPersistent

public void setPersistent(boolean persistent)
Set the new default value for exchange persistence. This value will be the default if none is configured on the activation spec of the component or on the message.

Parameters:
persistent -

addListener

public void addListener(EventListener listener)

removeListener

public void removeListener(EventListener listener)

getListeners

public Object[] getListeners(Class lc)

setListeners

public void setListeners(EventListener[] listeners)

resendExchange

public void resendExchange(javax.jbi.messaging.MessageExchange exchange)
                    throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

isEmbedded

public boolean isEmbedded()

setEmbedded

public void setEmbedded(boolean embedded)

setRmiPort

public void setRmiPort(int portNum)

getRmiPort

public int getRmiPort()

isNotifyStatistics

public boolean isNotifyStatistics()
Returns:
Returns the notifyStatistics.

setNotifyStatistics

public void setNotifyStatistics(boolean notifyStatistics)
Parameters:
notifyStatistics - The notifyStatistics to set.

getExecutorFactory

public org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
Returns:
the executorFactory

setExecutorFactory

public void setExecutorFactory(org.apache.servicemix.executors.ExecutorFactory executorFactory)
Parameters:
executorFactory - the executorFactory to set

createRootDir

protected String createRootDir()
Creates a new rootDir



Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.