Search in sources :

Example 1 with JmxManagedProcessApplication

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

the class UndeployProcessArchivesStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
    final JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
    ensureNotNull("Cannot find process application with name " + processApplication.getName(), "deployedProcessApplication", deployedProcessApplication);
    Map<String, DeployedProcessArchive> deploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
    if (deploymentMap != null) {
        List<ProcessesXml> processesXmls = deployedProcessApplication.getProcessesXmls();
        for (ProcessesXml processesXml : processesXmls) {
            for (ProcessArchiveXml parsedProcessArchive : processesXml.getProcessArchives()) {
                DeployedProcessArchive deployedProcessArchive = deploymentMap.get(parsedProcessArchive.getName());
                if (deployedProcessArchive != null) {
                    operationContext.addStep(new UndeployProcessArchiveStep(deployedProcessApplication, parsedProcessArchive, deployedProcessArchive.getProcessEngineName()));
                }
            }
        }
    }
}
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) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)

Example 2 with JmxManagedProcessApplication

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

the class InjectionUtil method getProcessApplicationInfo.

public static ProcessApplicationInfo getProcessApplicationInfo(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
    JmxManagedProcessApplication managedPa = serviceContainer.getServiceValue(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
    return managedPa.getProcessApplicationInfo();
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)

Example 3 with JmxManagedProcessApplication

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

the class RuntimeContainerDelegateImpl method getProcessApplicationNames.

// process application service implementation /////////////////////////////////
@Override
public Set<String> getProcessApplicationNames() {
    List<JmxManagedProcessApplication> processApplications = serviceContainer.getServiceValuesByType(ServiceTypes.PROCESS_APPLICATION);
    Set<String> processApplicationNames = new HashSet<String>();
    for (JmxManagedProcessApplication jmxManagedProcessApplication : processApplications) {
        processApplicationNames.add(jmxManagedProcessApplication.getProcessApplicationName());
    }
    return processApplicationNames;
}
Also used : JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication) HashSet(java.util.HashSet)

Example 4 with JmxManagedProcessApplication

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

the class StopProcessApplicationsStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    List<JmxManagedProcessApplication> processApplicationsReferences = serviceContainer.getServiceValuesByType(ServiceTypes.PROCESS_APPLICATION);
    for (JmxManagedProcessApplication processApplication : processApplicationsReferences) {
        stopProcessApplication(processApplication.getProcessApplicationReference());
    }
}
Also used : PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)

Example 5 with JmxManagedProcessApplication

use of org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication 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)

Aggregations

JmxManagedProcessApplication (org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)6 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)5 AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)4 ProcessesXml (org.camunda.bpm.application.impl.metadata.spi.ProcessesXml)3 DeployedProcessArchive (org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive)2 URL (java.net.URL)1 HashSet (java.util.HashSet)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)1