public class DeploymentService extends ModelSystemService implements DeploymentServiceMBean
mAdminServiceMBeanName, mConfigServiceMBeanName, mDeployServiceMBeanName, mDisplayName, mEnv, mInitialMBeans, mInstallServiceMBeanName, mLifeCycleMBeanName, mLogger, mLoggerImpl, mLoggerMBeanName, mLoggingServiceMBeanName, mMBeanNames, mMBeanServer, mMessageServiceMBeanName, mModelName, mStartMBeans, mStatisticsMBeanNameSTARTED, STOPPEDSTARTED, STOPPED, UNKNOWN| Constructor and Description |
|---|
DeploymentService(ManagementContext anEnv)
Constructs a
DeploymentService. |
| Modifier and Type | Method and Description |
|---|---|
HashMap |
activateConnections(String saName,
boolean xmlMsg)
Activate Service Connections defined in the specified Service Assembly.
|
boolean |
canDeployToComponent(String componentName)
Get the status to see if SU can be deployed based on component state.
|
String |
deploy(String saZipURL)
Deploy a Service Assembly (SA) to the JBI framework.
|
String |
deployFromRepository(String serviceAssemblyName)
Deploy a Service Assembly from the Repository.
|
void |
disableStatistics()
This method is used to disable statistics collection in
deployment service
|
void |
enableStatistics()
This method is used to enable statistics collection in
deployment service
|
ServiceUnitState |
getActualServiceUnitState(String compName,
String suName)
Get the actual state of a service unit.
|
String[] |
getComponentsForDeployedServiceAssembly(String saName)
Returns a list of components(to which SUs are targeted for)
in a Service Assembly.
|
ComponentState |
getComponentState(String compName)
Get the actual state of the component from the ComponentLifeCycleMBean.
|
Element |
getConnectionsElement(String saName)
Get the Connections Element from the Service Assembly Deployment descriptor
|
String[] |
getDeployedServiceAssemblies()
Returns a list of Service Assemblies deployed to the JBI enviroment.
|
String[] |
getDeployedServiceAssembliesForComponent(String componentName)
Returns a list of Service Assemblies that contain SUs
for the given component.
|
String[] |
getDeployedServiceUnitList(String componentName)
Get list of deployed service units to the component.
|
ObjectName |
getLifeCycleMBeanObjectName(String aCompName)
returns the ObjectName for the lifecycle Mbean of this component.
|
Link |
getLinkType(String fromEndpoint,
String saName)
Get the link-type for the Endpoint from the Service Units in the Service Assembly.
|
MBeanServerConnection |
getMBeanServerConnection()
Get the MBean Server
|
String |
getServiceAssemblyDescriptor(String saName)
Returns the descriptor of Service Assembly (SA) deployed.
|
String |
getServiceAssemblyName(String serviceUnitName,
String componentName)
Get the Service Assembly name for a specific service unit deployed to a
specific component.
|
ServiceAssemblyStatistics |
getServiceAssemblyStatistics(String saName)
This method is used to get statistics for the given SA
|
String |
getServiceUnitDescriptor(String saName,
String suName)
Returns the descriptor of Service Unit(SU) deployed.
|
ServiceUnitInfo |
getServiceUnitInfo(String compName,
String suName)
Get framework information on a service unit.
|
String |
getServiceUnitState(String componentName,
String serviceUnitName)
Get the state of a service unit deployed to a component.
|
String |
getState(String serviceAssemblyName) |
protected void |
initModelSystemService(EnvironmentContext anEnv)
local model init - called by constructor - create custom mbeans.
|
boolean |
isDeployedServiceUnit(String componentName,
String serviceUnitName)
Get the status of deployed service unit.
|
boolean |
isStatisticsEnabled()
This method is used to enable statistics collection in
deployment service
|
Iterator |
listServiceAssemblies(String compName) |
String |
registerServiceUnit(String compName,
String saName,
String suName,
String suRootPath) |
void |
removeStatsObject(String saName)
This method is used to remove the statistics object of the given SA.
|
void |
shutDown()
Shut down the DeploymentService.
|
String |
shutDown(String serviceAssemblyName)
Shutdown the service assembly and puts it in
SHUTDOWN state.
|
String |
shutDown(String serviceAssemblyName,
boolean force)
Shut down the service assembly.
|
String |
start(String serviceAssemblyName)
Starts the service assembly and puts it in
STARTED state.
|
void |
startAllServiceAssemblies()
Bring all Service Assemblies to their desired states.
|
String |
stop(String serviceAssemblyName)
Stops the service assembly and puts it in
STOPPED state.
|
String |
undeploy(String saName)
Undeploy a Service Assembly from the JBI framework.
|
String |
undeploy(String serviceAssemblyName,
boolean force)
Undeploys the given Service Assembly from the JBI environment.
|
String |
undeploy(String saName,
boolean force,
boolean keep)
Undeploys the given Service Assembly from the JBI environment.
|
String |
unregisterServiceUnit(String compName,
String suName) |
String |
updateSAState(String saName)
Determines the appropriate state for a service assembly.
|
void |
updateServiceAssemblyConnections(String compName)
Activate the Service Connections if SA state is Started, deactivate the
connections if state is Stopped or Shutdown.
|
addNotificationListener, bootstrap, getComponentQuery, getCurrentState, getNotificationBroadcaster, getNotificationInfo, getRegistry, initModelSystemService, initModelSystemService, removeNotificationListener, removeNotificationListener, start, stoppublic DeploymentService(ManagementContext anEnv) throws JBIException
DeploymentService.anEnv - ManagementContext.JBIExceptionprotected void initModelSystemService(EnvironmentContext anEnv)
public String deploy(String saZipURL) throws Exception
deploy in interface DeploymentServiceMBeansaZipURL - The URL of the Service Assembly.Exception - If failed to deploy an SA.public String undeploy(String saName) throws Exception
undeploy in interface DeploymentServiceMBeansaName - - service assembly nameException - if undeploy fails.public String[] getDeployedServiceUnitList(String componentName) throws Exception
getDeployedServiceUnitList in interface DeploymentServiceMBeancomponentName - The name of the component.Exception - If component throws an exceptionpublic boolean isDeployedServiceUnit(String componentName, String serviceUnitName) throws Exception
isDeployedServiceUnit in interface DeploymentServiceMBeancomponentName - The name of the component.serviceUnitName - name of the service unit.Exception - If component throws an exceptionpublic ServiceUnitInfo getServiceUnitInfo(String compName, String suName)
compName - The ID of the component.suName - The ID of the service unit.public boolean canDeployToComponent(String componentName)
canDeployToComponent in interface DeploymentServiceMBeancomponentName - The name of the component.public ObjectName getLifeCycleMBeanObjectName(String aCompName) throws Exception
aCompName - id of a binding or engine componentException - If failed to lookup object namepublic String[] getDeployedServiceAssemblies() throws Exception
getDeployedServiceAssemblies in interface DeploymentServiceMBeanException - If failed to retrieve SA Idspublic String[] getDeployedServiceAssembliesForComponent(String componentName) throws Exception
getDeployedServiceAssembliesForComponent in interface DeploymentServiceMBeancomponentName - Name of the componentException - If fails to retrieve SA Idspublic String getServiceAssemblyName(String serviceUnitName, String componentName) throws Exception
serviceUnitName - - service unit identifiercomponentName - - component identifierExceptionpublic String[] getComponentsForDeployedServiceAssembly(String saName) throws Exception
getComponentsForDeployedServiceAssembly in interface DeploymentServiceMBeansaName - name of the Service AssemblyException - If fails to retrieve component Idspublic String getServiceAssemblyDescriptor(String saName) throws Exception
getServiceAssemblyDescriptor in interface DeploymentServiceMBeansaName - name of the service assemblyException - If fails to retrieve deployment descriptorpublic String getServiceUnitDescriptor(String saName, String suName) throws UnsupportedOperationException
saName - name of the service assemblysaName - name of the service unitException - If fails to retrieve deployment descriptorUnsupportedOperationExceptionpublic ComponentState getComponentState(String compName)
compName - The ID of the component.public ServiceUnitState getActualServiceUnitState(String compName, String suName)
compName - The ID of the component.suName - The ID of the service unit.public String registerServiceUnit(String compName, String saName, String suName, String suRootPath) throws Exception
Exceptionpublic String unregisterServiceUnit(String compName, String suName) throws Exception
compName - - target component for service unit unregistrationsuName - - name of service unit to unregisterExceptionpublic void shutDown()
throws JBIException
shutDown in interface LifeCycleMBeanshutDown in class ModelSystemServiceJBIException - if the item fails to shut down.public MBeanServerConnection getMBeanServerConnection()
public String start(String serviceAssemblyName) throws Exception
start in interface DeploymentServiceMBeanserviceAssemblyName - - name of the service
assembly.Exception - if operation fails.public String stop(String serviceAssemblyName) throws Exception
stop in interface DeploymentServiceMBeanserviceAssemblyName - - name of the service
assembly.Exception - if operation fails.public String shutDown(String serviceAssemblyName) throws Exception
shutDown in interface DeploymentServiceMBeanserviceAssemblyName - - name of the service
assembly.Exception - if operation fails.public String getState(String serviceAssemblyName) throws Exception
getState in interface DeploymentServiceMBeanExceptionpublic String getServiceUnitState(String componentName, String serviceUnitName) throws JBIException
componentName - - the component nameserviceUnitName - - name of the service unitJBIException - if the component is not installed or if the
service unit is not deployed to the component.DeploymentServiceMBeanpublic String deployFromRepository(String serviceAssemblyName) throws JBIException
serviceAssemblyName - - name of the registered service assembly.JBIException - if the service assembly is not registered or
deploy fails.public String undeploy(String serviceAssemblyName, boolean force) throws Exception
serviceAssemblyName - name of the Service Assembly that is to be
undeployed; must be non-null and non-emptyforce - if this flag is set to true any undeployment errors thrown
from the component will be ignored as the service assembly is forcefully
undeployed.Exception - if compelete undeployment failspublic String undeploy(String saName, boolean force, boolean keep) throws Exception
saName - name of the Service Assembly that is to be
undeployed; must be non-null and non-emptyforce - if this flag is set to true any undeployment errors thrown
from the component will be ignored as the service assembly is forcefully
undeployed.keep - if true the service assembly archive should not be removed
from the domain. If false the archive is removed if the service
assembly is not deployed on any instances. This flag is ignored on
the instance.Exception - if compelete undeployment failspublic String shutDown(String serviceAssemblyName, boolean force) throws Exception
serviceAssemblyName - name of the assembly to be shut down; must be
non-null and non-emptyforce - if this flag is true, the service assembly is shutdown forcefully.
Any exceptions thrown by the component for service unit shutdown are ignored.Exception - if there is no such assemblyException - if the assembly fails to shut downpublic HashMap activateConnections(String saName, boolean xmlMsg) throws Exception
saName - The name of the Service Assembly.xmlMsg - When set to true, requests that error messages
returned in the HashMap be in XML management message format. When set to
false, error messages are in text format.Exception - if an unrecoverable error occurs.public void updateServiceAssemblyConnections(String compName)
public String updateSAState(String saName)
public Element getConnectionsElement(String saName) throws Exception
Exceptionpublic Link getLinkType(String fromEndpoint, String saName) throws Exception
fromEndpoint - - the connection consumer service endpointsaName - - the service assembly nameExceptionpublic void disableStatistics()
public void enableStatistics()
public boolean isStatisticsEnabled()
public ServiceAssemblyStatistics getServiceAssemblyStatistics(String saName) throws RuntimeException
saName - the servie assembly nameRuntimeException - is statistics for this SA are not availablepublic void removeStatsObject(String saName)
saName - the service assembly namepublic void startAllServiceAssemblies()
JBI implementations MUST retain the running state of all service unit
deployments, such that the schemaorg_apache_xmlbeans.system can be restarted from a shutdown or
crash, and all deployments will be restored to their previous running
state. During component restart, the implementation MUST perform the
following to restore a service unit to its previous state:
-
Started. The implementation MUST call init(), followed by start().
-
Stopped. The implementation MUST call init() to restore a service
unit to the stopped state.
-
Shutdown. The implementation MUST call init() followed by shutDown()
to restore a service unit to the shutdown state.
In all cases of state restoration, the implementation MUST call init()
for all service units in the group being restored before any other life
cycle methods for service units in the group are called
In support of the above requirement, this method first initializes ALL
deployed Service Assemblies. After that, all deployed SAs are brought to
their desired states, either "Shutdown", "Stopped", or "Started".Copyright © 2011-2016 OpenESB Community. All Rights Reserved.