Class MBeanServiceContainer
- java.lang.Object
-
- org.camunda.bpm.container.impl.jmx.MBeanServiceContainer
-
- All Implemented Interfaces:
PlatformServiceContainer
public class MBeanServiceContainer extends java.lang.Object implements PlatformServiceContainer
A simple Service Container that delegates to the JVM's
MBeanServer
.- Author:
- Daniel Meyer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.camunda.bpm.container.impl.spi.PlatformServiceContainer
PlatformServiceContainer.ServiceType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ThreadLocal<java.util.Stack<DeploymentOperation>>
activeDeploymentOperations
set if the current thread is performing a composite deployment operationprotected javax.management.MBeanServer
mBeanServer
static java.lang.String
SERVICE_NAME_EXECUTOR
protected java.util.Map<javax.management.ObjectName,PlatformService<?>>
servicesByName
-
Constructor Summary
Constructors Constructor Description MBeanServiceContainer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
composeLocalName(PlatformServiceContainer.ServiceType type, java.lang.String localName)
DeploymentOperation.DeploymentOperationBuilder
createDeploymentOperation(java.lang.String name)
protected javax.management.MBeanServer
createOrLookupMbeanServer()
DeploymentOperation.DeploymentOperationBuilder
createUndeploymentOperation(java.lang.String name)
void
executeDeploymentOperation(DeploymentOperation operation)
javax.management.MBeanServer
getmBeanServer()
static javax.management.ObjectName
getObjectName(java.lang.String serviceName)
<S> S
getService(javax.management.ObjectName name)
get a specific service by name or null if no such Service exists.<S> S
getService(PlatformServiceContainer.ServiceType type, java.lang.String localName)
get a specific service by name or null if no such Service exists.java.util.Set<java.lang.String>
getServiceNames(PlatformServiceContainer.ServiceType type)
<S> java.util.List<PlatformService<S>>
getServicesByType(PlatformServiceContainer.ServiceType type)
<S> S
getServiceValue(javax.management.ObjectName name)
get the service value for a specific service by name or null if no such Service exists.<S> S
getServiceValue(PlatformServiceContainer.ServiceType type, java.lang.String localName)
get the service value for a specific service by name or null if no such Service exists.<S> java.util.List<S>
getServiceValuesByType(PlatformServiceContainer.ServiceType type)
void
setmBeanServer(javax.management.MBeanServer mBeanServer)
<S> void
startService(java.lang.String name, PlatformService<S> service)
<S> void
startService(PlatformServiceContainer.ServiceType serviceType, java.lang.String localName, PlatformService<S> service)
void
stopService(java.lang.String name)
void
stopService(PlatformServiceContainer.ServiceType serviceType, java.lang.String localName)
-
-
-
Field Detail
-
mBeanServer
protected javax.management.MBeanServer mBeanServer
-
servicesByName
protected java.util.Map<javax.management.ObjectName,PlatformService<?>> servicesByName
-
activeDeploymentOperations
protected java.lang.ThreadLocal<java.util.Stack<DeploymentOperation>> activeDeploymentOperations
set if the current thread is performing a composite deployment operation
-
SERVICE_NAME_EXECUTOR
public static final java.lang.String SERVICE_NAME_EXECUTOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
startService
public <S> void startService(PlatformServiceContainer.ServiceType serviceType, java.lang.String localName, PlatformService<S> service)
- Specified by:
startService
in interfacePlatformServiceContainer
-
startService
public <S> void startService(java.lang.String name, PlatformService<S> service)
- Specified by:
startService
in interfacePlatformServiceContainer
-
getObjectName
public static javax.management.ObjectName getObjectName(java.lang.String serviceName)
-
composeLocalName
public static java.lang.String composeLocalName(PlatformServiceContainer.ServiceType type, java.lang.String localName)
-
stopService
public void stopService(PlatformServiceContainer.ServiceType serviceType, java.lang.String localName)
- Specified by:
stopService
in interfacePlatformServiceContainer
-
stopService
public void stopService(java.lang.String name)
- Specified by:
stopService
in interfacePlatformServiceContainer
-
createDeploymentOperation
public DeploymentOperation.DeploymentOperationBuilder createDeploymentOperation(java.lang.String name)
- Specified by:
createDeploymentOperation
in interfacePlatformServiceContainer
-
createUndeploymentOperation
public DeploymentOperation.DeploymentOperationBuilder createUndeploymentOperation(java.lang.String name)
- Specified by:
createUndeploymentOperation
in interfacePlatformServiceContainer
-
executeDeploymentOperation
public void executeDeploymentOperation(DeploymentOperation operation)
- Specified by:
executeDeploymentOperation
in interfacePlatformServiceContainer
-
getService
public <S> S getService(PlatformServiceContainer.ServiceType type, java.lang.String localName)
get a specific service by name or null if no such Service exists.- Specified by:
getService
in interfacePlatformServiceContainer
-
getService
public <S> S getService(javax.management.ObjectName name)
get a specific service by name or null if no such Service exists.
-
getServiceValue
public <S> S getServiceValue(javax.management.ObjectName name)
get the service value for a specific service by name or null if no such Service exists.
-
getServiceValue
public <S> S getServiceValue(PlatformServiceContainer.ServiceType type, java.lang.String localName)
get the service value for a specific service by name or null if no such Service exists.- Specified by:
getServiceValue
in interfacePlatformServiceContainer
-
getServicesByType
public <S> java.util.List<PlatformService<S>> getServicesByType(PlatformServiceContainer.ServiceType type)
- Specified by:
getServicesByType
in interfacePlatformServiceContainer
- Returns:
- all services for a specific
PlatformServiceContainer.ServiceType
-
getServiceNames
public java.util.Set<java.lang.String> getServiceNames(PlatformServiceContainer.ServiceType type)
- Specified by:
getServiceNames
in interfacePlatformServiceContainer
- Returns:
- the service names (
ObjectName
) for all services for a given type
-
getServiceValuesByType
public <S> java.util.List<S> getServiceValuesByType(PlatformServiceContainer.ServiceType type)
- Specified by:
getServiceValuesByType
in interfacePlatformServiceContainer
- Returns:
- the values of all services for a specific
PlatformServiceContainer.ServiceType
-
getmBeanServer
public javax.management.MBeanServer getmBeanServer()
-
setmBeanServer
public void setmBeanServer(javax.management.MBeanServer mBeanServer)
-
createOrLookupMbeanServer
protected javax.management.MBeanServer createOrLookupMbeanServer()
-
-