Search in sources :

Example 1 with JmxManagedProcessEngine

use of org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngine in project camunda-bpm-platform by camunda.

the class StartProcessEngineStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    ClassLoader classLoader = null;
    if (processApplication != null) {
        classLoader = processApplication.getProcessApplicationClassloader();
    }
    String configurationClassName = processEngineXml.getConfigurationClass();
    if (configurationClassName == null || configurationClassName.isEmpty()) {
        configurationClassName = StandaloneProcessEngineConfiguration.class.getName();
    }
    // create & instantiate configuration class
    Class<? extends ProcessEngineConfigurationImpl> configurationClass = loadClass(configurationClassName, classLoader, ProcessEngineConfigurationImpl.class);
    ProcessEngineConfigurationImpl configuration = createInstance(configurationClass);
    // set UUid generator
    // TODO: move this to configuration and use as default?
    ProcessEngineConfigurationImpl configurationImpl = configuration;
    configurationImpl.setIdGenerator(new StrongUuidGenerator());
    // set configuration values
    String name = processEngineXml.getName();
    configuration.setProcessEngineName(name);
    String datasourceJndiName = processEngineXml.getDatasource();
    configuration.setDataSourceJndiName(datasourceJndiName);
    // apply properties
    Map<String, String> properties = processEngineXml.getProperties();
    setJobExecutorActivate(configuration, properties);
    PropertyHelper.applyProperties(configuration, properties);
    // instantiate plugins:
    configurePlugins(configuration, processEngineXml, classLoader);
    if (processEngineXml.getJobAcquisitionName() != null && !processEngineXml.getJobAcquisitionName().isEmpty()) {
        JobExecutor jobExecutor = getJobExecutorService(serviceContainer);
        ensureNotNull("Cannot find referenced job executor with name '" + processEngineXml.getJobAcquisitionName() + "'", "jobExecutor", jobExecutor);
        // set JobExecutor on process engine
        configurationImpl.setJobExecutor(jobExecutor);
    }
    // start the process engine inside the container.
    JmxManagedProcessEngine managedProcessEngineService = createProcessEngineControllerInstance(configuration);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, configuration.getProcessEngineName(), managedProcessEngineService);
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) JmxManagedProcessEngine(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngine) StandaloneProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JobExecutor(org.camunda.bpm.engine.impl.jobexecutor.JobExecutor) StrongUuidGenerator(org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 2 with JmxManagedProcessEngine

use of org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngine in project camunda-bpm-platform by camunda.

the class RuntimeContainerDelegateImpl method registerProcessEngine.

// runtime container delegate implementation ///////////////////////////////////////////////
@Override
public void registerProcessEngine(ProcessEngine processEngine) {
    ensureNotNull("Cannot register process engine in Jmx Runtime Container", "process engine", processEngine);
    String processEngineName = processEngine.getName();
    // build and start the service.
    JmxManagedProcessEngine managedProcessEngine = new JmxManagedProcessEngine(processEngine);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, processEngineName, managedProcessEngine);
}
Also used : JmxManagedProcessEngine(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngine)

Aggregations

JmxManagedProcessEngine (org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngine)2 AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)1 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)1 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)1 StrongUuidGenerator (org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator)1