|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.jbi.management.BaseLifeCycle
org.apache.servicemix.jbi.container.JBIContainer
public class JBIContainer
The main container
| 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(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)
|
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/ |
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 |
|---|
public static final String DEFAULT_NAME
protected Broker broker
protected javax.jbi.component.ServiceUnitManager serviceManager
protected ManagementContext managementContext
protected EnvironmentContext environmentContext
protected InstallationService installationService
protected DeploymentService deploymentService
protected AutoDeploymentService autoDeployService
protected AdminCommandsService adminCommandsService
protected BaseSystemService[] services
protected ClientFactory clientFactory
protected Registry registry
protected boolean autoEnlistInTransaction
protected boolean persistent
protected boolean embedded
protected boolean notifyStatistics
protected EventListenerList listeners
protected EventListener[] configuredListeners
protected boolean useShutdownHook
protected boolean useNewTransactionModel
protected transient Thread shutdownHook
protected org.apache.servicemix.executors.ExecutorFactory executorFactory
| Constructor Detail |
|---|
public JBIContainer()
| Method Detail |
|---|
public String getName()
BaseLifeCycle
getName in interface MBeanInfoProvidergetName in class BaseLifeCyclepublic void setName(String name)
name - The name to set (must be unique within a cluster)public String getDescription()
getDescription in interface MBeanInfoProviderpublic String getFlowName()
public void setFlowName(String flowName)
flowName - The flow to set.public String getFlowNames()
public void setFlowNames(String flowNames)
flowNames - The flows to set.public String getSubscriptionFlowName()
public void setSubscriptionFlowName(String subscriptionFlowName)
subscriptionFlowName - public void setFlow(Flow flow)
flow - public Flow getFlow()
public void setFlows(Flow[] flows)
flows - public Flow[] getFlows()
public boolean isUseShutdownHook()
public void setUseShutdownHook(boolean useShutdownHook)
public boolean isUseNewTransactionModel()
public void setUseNewTransactionModel(boolean useNewTransactionModel)
useNewTransactionModel - public BaseSystemService[] getServices()
public void setServices(BaseSystemService[] services)
services - the services to setpublic ManagementContext getManagementContext()
public EnvironmentContext getEnvironmentContext()
public Registry getRegistry()
public DefaultBroker getDefaultBroker()
public Broker getBroker()
public void setBroker(Broker broker)
public boolean isCreateMBeanServer()
public void setCreateMBeanServer(boolean enableJMX)
enableJMX - public boolean isUseMBeanServer()
public void setUseMBeanServer(boolean useMBeanServer)
useMBeanServer - The useMBeanServer to set.public boolean isCreateJmxConnector()
public void setCreateJmxConnector(boolean createJmxConnector)
createJmxConnector - The createJmxConnector to set.public boolean isMonitorInstallationDirectory()
public void setMonitorInstallationDirectory(boolean monitorInstallationDirectory)
monitorInstallationDirectory - The monitorInstallationDirectory to set.public boolean isMonitorDeploymentDirectory()
public void setMonitorDeploymentDirectory(boolean monitorDeploymentDirectory)
monitorDeploymentDirectory - The monitorDeploymentDirectory to set.public String getInstallationDirPath()
public void setInstallationDirPath(String installationDir)
installationDir - public String getDeploymentDirPath()
public void setDeploymentDirPath(String deploymentDir)
deploymentDir - The deploymentDir to set.public int getMonitorInterval()
public void setMonitorInterval(int monitorInterval)
monitorInterval - The monitorInterval to set (in secs).public String getDeploymentExtensions()
public void setDeploymentExtensions(String deploymentExtensions)
deploymentExtensions - the deploymentExtensions to set
public void installArchive(String url)
throws javax.jbi.management.DeploymentException
url -
javax.jbi.management.DeploymentException
public void updateExternalArchive(String location,
boolean autoStart)
throws javax.jbi.management.DeploymentException
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
javax.jbi.management.DeploymentException
public void updateExternalArchive(String location)
throws javax.jbi.management.DeploymentException
location - - can either be a url or filename (if relative - must be relative to the container)
javax.jbi.management.DeploymentExceptionpublic DeploymentService getDeploymentService()
public InstallationService getInstallationService()
public AutoDeploymentService getAutoDeploymentService()
public AdminCommandsService getAdminCommandsService()
public ClientFactory getClientFactory()
getClientFactory in interface org.apache.servicemix.jbi.api.Containerpublic String getGeneratedRootDirPrefix()
public void setGeneratedRootDirPrefix(String generatedRootDirPrefix)
generatedRootDirPrefix - the prefix used to auto-create the
rootDirsetRootDir(String),
setGeneratedRootDirPrefix(String)public boolean isGenerateRootDir()
public long getForceShutdown()
public void setForceShutdown(long forceShutdown)
forceShutdown - the timeout in mspublic void setGenerateRootDir(boolean generateRootDir)
generateRootDir - if true this will enable the auto-generation of the rootDir
if the rootDir property is not configuredsetRootDir(String),
setGeneratedRootDirPrefix(String)
public void init()
throws javax.jbi.JBIException
init in class BaseLifeCyclejavax.jbi.JBIException
public void start()
throws javax.jbi.JBIException
start in interface javax.jbi.management.LifeCycleMBeanstart in class BaseLifeCyclejavax.jbi.JBIException
public void stop()
throws javax.jbi.JBIException
stop in interface javax.jbi.management.LifeCycleMBeanstop in class BaseLifeCyclejavax.jbi.JBIException
public void shutDown()
throws javax.jbi.JBIException
shutDown in interface javax.jbi.management.LifeCycleMBeanshutDown in class BaseLifeCyclejavax.jbi.JBIExceptionprotected void addShutdownHook()
protected void removeShutdownHook()
protected void containerShutdown()
public MBeanServer getMBeanServer()
public void setMBeanServer(MBeanServer mbs)
mbs - public InitialContext getNamingContext()
public void setNamingContext(InitialContext ic)
ic - public Object getTransactionManager()
public void setTransactionManager(Object tm)
tm - public String getRootDir()
public void setRootDir(String root)
root -
public void sendExchange(MessageExchangeImpl exchange)
throws javax.jbi.messaging.MessagingException
exchange -
javax.jbi.messaging.MessagingException
public void registerExternalEndpoint(ComponentNameSpace cns,
javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
throws javax.jbi.JBIException
context - externalEndpoint -
javax.jbi.JBIException
public void deregisterExternalEndpoint(ComponentNameSpace cns,
javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
throws javax.jbi.JBIException
context - externalEndpoint -
javax.jbi.JBIException
public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(ComponentContextImpl context,
DocumentFragment epr)
context - epr -
public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(ComponentContextImpl context,
QName service,
String endpointName)
context - service - endpointName -
public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(ComponentContextImpl context,
QName interfaceName)
context - interfaceName -
public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(ComponentContextImpl context,
QName serviceName)
context - serviceName -
public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(ComponentContextImpl context,
QName interfaceName)
context - interfaceName -
public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(ComponentContextImpl context,
QName serviceName)
context - serviceName -
public Logger getLogger(String suffix,
String resourceBundleName)
throws MissingResourceException,
javax.jbi.JBIException
suffix - resourceBundleName -
MissingResourceException
javax.jbi.JBIException
public void deactivateComponent(String componentName)
throws javax.jbi.JBIException
componentName - - the unique component ID
javax.jbi.JBIException
public void deleteComponent(String id)
throws javax.jbi.JBIException
id -
javax.jbi.JBIExceptionpublic ComponentMBeanImpl getComponent(String componentName)
componentName -
public Collection getLocalComponentConnectors()
public javax.jbi.component.Component activateComponent(ActivationSpec activationSpec)
throws javax.jbi.JBIException
activationSpec -
javax.jbi.JBIException
public ObjectName activateComponent(javax.jbi.component.Component component,
String componentName)
throws javax.jbi.JBIException
component - componentName -
javax.jbi.JBIException
public ObjectName activateComponent(javax.jbi.component.Component component,
ActivationSpec activationSpec)
throws javax.jbi.JBIException
component - activationSpec -
javax.jbi.JBIException
public ObjectName activateComponent(File installDir,
javax.jbi.component.Component component,
String description,
ComponentContextImpl context,
boolean binding,
boolean service,
String[] sharedLibraries)
throws javax.jbi.JBIException
installDir - component - description - context - binding - service -
javax.jbi.JBIException
public ObjectName activateComponent(javax.jbi.component.Component component,
String description,
ActivationSpec activationSpec,
boolean pojo,
boolean binding,
boolean service,
String[] sharedLibraries)
throws javax.jbi.JBIException
component - description - activationSpec - pojo - binding - service -
javax.jbi.JBIException
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
installationDir - component - description - context - activationSpec - pojo - binding - service -
javax.jbi.JBIException
protected void defaultComponentServiceAndEndpoint(PojoSupport component,
ActivationSpec activationSpec)
component - activationSpec -
protected org.apache.servicemix.executors.ExecutorFactory createExecutorFactory()
throws javax.jbi.JBIException
javax.jbi.JBIException
protected javax.jbi.component.Component createComponentAdaptor(javax.jbi.component.ComponentLifeCycle lifeCycle,
ActivationSpec activationSpec)
lifeCycle - activationSpec -
protected javax.jbi.component.Component createComponentAdaptor(MessageExchangeListener listener,
ActivationSpec activationSpec)
protected String createComponentID()
protected void checkInitialized()
throws javax.jbi.JBIException
javax.jbi.JBIExceptionpublic boolean isAutoEnlistInTransaction()
public void setAutoEnlistInTransaction(boolean autoEnlistInTransaction)
true and a transaction
is running when sending / receiving an exchange, this operation will
automatically be done in the current transaction.
autoEnlistInTransaction - public boolean isPersistent()
public void setPersistent(boolean persistent)
persistent - public void addListener(EventListener listener)
public void removeListener(EventListener listener)
public Object[] getListeners(Class lc)
public void setListeners(EventListener[] listeners)
public void resendExchange(javax.jbi.messaging.MessageExchange exchange)
throws javax.jbi.JBIException
javax.jbi.JBIExceptionpublic boolean isEmbedded()
public void setEmbedded(boolean embedded)
public void setRmiPort(int portNum)
public int getRmiPort()
public boolean isNotifyStatistics()
public void setNotifyStatistics(boolean notifyStatistics)
notifyStatistics - The notifyStatistics to set.public org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
public void setExecutorFactory(org.apache.servicemix.executors.ExecutorFactory executorFactory)
executorFactory - the executorFactory to setprotected String createRootDir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||