Search in sources :

Example 6 with AbstractProcessApplication

use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.

the class TypedValueField method getCurrentPaSerializers.

protected static VariableSerializers getCurrentPaSerializers() {
    if (Context.getCurrentProcessApplication() != null) {
        ProcessApplicationReference processApplicationReference = Context.getCurrentProcessApplication();
        try {
            ProcessApplicationInterface processApplicationInterface = processApplicationReference.getProcessApplication();
            ProcessApplicationInterface rawPa = processApplicationInterface.getRawObject();
            if (rawPa instanceof AbstractProcessApplication) {
                return ((AbstractProcessApplication) rawPa).getVariableSerializers();
            } else {
                return null;
            }
        } catch (ProcessApplicationUnavailableException e) {
            throw LOG.cannotDeterminePaDataformats(e);
        }
    } else {
        return null;
    }
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) ProcessApplicationUnavailableException(org.camunda.bpm.application.ProcessApplicationUnavailableException) AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessApplicationInterface(org.camunda.bpm.application.ProcessApplicationInterface)

Example 7 with AbstractProcessApplication

use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.

the class PaLocalScriptEngineEnabledCacheTest method shouldCacheScriptEngine.

@Test
public void shouldCacheScriptEngine() {
    AbstractProcessApplication processApplication = (AbstractProcessApplication) getProcessApplication();
    assertEquals(processApplication.getScriptEngineForName(SCRIPT_FORMAT, true), processApplication.getScriptEngineForName(SCRIPT_FORMAT, true));
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) Test(org.junit.Test)

Example 8 with AbstractProcessApplication

use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.

the class StartProcessApplicationServiceStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    final Map<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
    final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    ProcessApplicationInfoImpl processApplicationInfo = createProcessApplicationInfo(processApplication, processArchiveDeploymentMap);
    // create service
    JmxManagedProcessApplication mbean = new JmxManagedProcessApplication(processApplicationInfo, processApplication.getReference());
    mbean.setProcessesXmls(new ArrayList<ProcessesXml>(processesXmls.values()));
    mbean.setDeploymentMap(processArchiveDeploymentMap);
    // start service
    serviceContainer.startService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName(), mbean);
    notifyBpmPlatformPlugins(serviceContainer, processApplication);
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) DeployedProcessArchive(org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive) ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) ProcessApplicationInfoImpl(org.camunda.bpm.application.impl.ProcessApplicationInfoImpl) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication) URL(java.net.URL)

Example 9 with AbstractProcessApplication

use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.

the class StopProcessApplicationServiceStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
    // remove the service
    serviceContainer.stopService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer)

Example 10 with AbstractProcessApplication

use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.

the class StartJobAcquisitionStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    ClassLoader configurationClassloader = null;
    if (processApplication != null) {
        configurationClassloader = processApplication.getProcessApplicationClassloader();
    } else {
        configurationClassloader = ProcessEngineConfiguration.class.getClassLoader();
    }
    String configurationClassName = jobAcquisitionXml.getJobExecutorClassName();
    if (configurationClassName == null || configurationClassName.isEmpty()) {
        configurationClassName = RuntimeContainerJobExecutor.class.getName();
    }
    // create & instantiate the job executor class
    Class<? extends JobExecutor> jobExecutorClass = loadJobExecutorClass(configurationClassloader, configurationClassName);
    JobExecutor jobExecutor = instantiateJobExecutor(jobExecutorClass);
    // apply properties
    Map<String, String> properties = jobAcquisitionXml.getProperties();
    PropertyHelper.applyProperties(jobExecutor, properties);
    // construct service for job executor
    JmxManagedJobExecutor jmxManagedJobExecutor = new JmxManagedJobExecutor(jobExecutor);
    // deploy the job executor service into the container
    serviceContainer.startService(ServiceTypes.JOB_EXECUTOR, jobAcquisitionXml.getName(), jmxManagedJobExecutor);
}
Also used : JmxManagedJobExecutor(org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor) AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JobExecutor(org.camunda.bpm.engine.impl.jobexecutor.JobExecutor) JmxManagedJobExecutor(org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor) RuntimeContainerJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor) RuntimeContainerJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor)

Aggregations

AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)17 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)9 ProcessesXml (org.camunda.bpm.application.impl.metadata.spi.ProcessesXml)4 JmxManagedProcessApplication (org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)4 ProcessApplicationInterface (org.camunda.bpm.application.ProcessApplicationInterface)3 ProcessApplicationUnavailableException (org.camunda.bpm.application.ProcessApplicationUnavailableException)3 DeployedProcessArchive (org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 URL (java.net.URL)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)2 Test (org.junit.Test)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)1 JmxManagedBpmPlatformPlugins (org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins)1