Search in sources :

Example 1 with DeploymentOperation

use of org.camunda.bpm.container.impl.spi.DeploymentOperation in project camunda-bpm-platform by camunda.

the class StartManagedThreadPoolStepTest method setUp.

@Before
public void setUp() {
    step = new StartManagedThreadPoolStep();
    deploymentOperation = new DeploymentOperation("name", container, Collections.<DeploymentOperationStep>emptyList());
    jobExecutorXml = new JobExecutorXmlImpl();
    bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutorXml, Collections.<ProcessEngineXml>emptyList());
    deploymentOperation.addAttachment(Attachments.BPM_PLATFORM_XML, bpmPlatformXml);
}
Also used : ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) DeploymentOperationStep(org.camunda.bpm.container.impl.spi.DeploymentOperationStep) DeploymentOperation(org.camunda.bpm.container.impl.spi.DeploymentOperation) BpmPlatformXmlImpl(org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl) Before(org.junit.Before)

Example 2 with DeploymentOperation

use of org.camunda.bpm.container.impl.spi.DeploymentOperation in project camunda-bpm-platform by camunda.

the class MBeanServiceContainer method startService.

public synchronized <S> void startService(String name, PlatformService<S> service) {
    ObjectName serviceName = getObjectName(name);
    if (getService(serviceName) != null) {
        throw new ProcessEngineException("Cannot register service " + serviceName + " with MBeans Container, service with same name already registered.");
    }
    final MBeanServer beanServer = getmBeanServer();
    // call the service-provided start behavior
    service.start(this);
    try {
        beanServer.registerMBean(service, serviceName);
        servicesByName.put(serviceName, service);
        Stack<DeploymentOperation> currentOperationContext = activeDeploymentOperations.get();
        if (currentOperationContext != null) {
            currentOperationContext.peek().serviceAdded(name);
        }
    } catch (Exception e) {
        throw LOG.cannotRegisterService(serviceName, e);
    }
}
Also used : DeploymentOperation(org.camunda.bpm.container.impl.spi.DeploymentOperation) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) ObjectName(javax.management.ObjectName) MBeanServer(javax.management.MBeanServer)

Aggregations

DeploymentOperation (org.camunda.bpm.container.impl.spi.DeploymentOperation)2 MBeanServer (javax.management.MBeanServer)1 ObjectName (javax.management.ObjectName)1 BpmPlatformXmlImpl (org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl)1 JobExecutorXmlImpl (org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl)1 ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)1 DeploymentOperationStep (org.camunda.bpm.container.impl.spi.DeploymentOperationStep)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 Before (org.junit.Before)1