Search in sources :

Example 1 with BpmPlatformPlugins

use of org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins in project camunda-bpm-platform by camunda.

the class BpmPlatformSubsystemAdd method performBoottime.

/**
 * {@inheritDoc}
 */
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    // add deployment processors
    context.addStep(new AbstractDeploymentChainStep() {

        public void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(ModelConstants.SUBSYSTEM_NAME, Phase.PARSE, ProcessApplicationProcessor.PRIORITY, new ProcessApplicationProcessor());
            processorTarget.addDeploymentProcessor(ModelConstants.SUBSYSTEM_NAME, Phase.DEPENDENCIES, ModuleDependencyProcessor.PRIORITY, new ModuleDependencyProcessor());
            processorTarget.addDeploymentProcessor(ModelConstants.SUBSYSTEM_NAME, Phase.POST_MODULE, ProcessesXmlProcessor.PRIORITY, new ProcessesXmlProcessor());
            processorTarget.addDeploymentProcessor(ModelConstants.SUBSYSTEM_NAME, Phase.INSTALL, ProcessEngineStartProcessor.PRIORITY, new ProcessEngineStartProcessor());
            processorTarget.addDeploymentProcessor(ModelConstants.SUBSYSTEM_NAME, Phase.INSTALL, ProcessApplicationDeploymentProcessor.PRIORITY, new ProcessApplicationDeploymentProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
    // create and register the MSC container delegate.
    final MscRuntimeContainerDelegate processEngineService = new MscRuntimeContainerDelegate();
    final ServiceController<MscRuntimeContainerDelegate> controller = context.getServiceTarget().addService(ServiceNames.forMscRuntimeContainerDelegate(), processEngineService).addListener(verificationHandler).setInitialMode(Mode.ACTIVE).install();
    newControllers.add(controller);
    // discover and register bpm platform plugins
    BpmPlatformPlugins plugins = BpmPlatformPlugins.load(getClass().getClassLoader());
    MscBpmPlatformPlugins managedPlugins = new MscBpmPlatformPlugins(plugins);
    ServiceController<BpmPlatformPlugins> serviceController = context.getServiceTarget().addService(ServiceNames.forBpmPlatformPlugins(), managedPlugins).addListener(verificationHandler).setInitialMode(Mode.ACTIVE).install();
    newControllers.add(serviceController);
}
Also used : MscBpmPlatformPlugins(org.camunda.bpm.container.impl.jboss.service.MscBpmPlatformPlugins) BpmPlatformPlugins(org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins) MscBpmPlatformPlugins(org.camunda.bpm.container.impl.jboss.service.MscBpmPlatformPlugins) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) MscRuntimeContainerDelegate(org.camunda.bpm.container.impl.jboss.service.MscRuntimeContainerDelegate)

Example 2 with BpmPlatformPlugins

use of org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins in project camunda-bpm-platform by camunda.

the class JBossSubsystemXMLTest method testInstallSubsystemXmlPlatformPlugins.

@Test
public void testInstallSubsystemXmlPlatformPlugins() throws Exception {
    String subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_PROCESS_ENGINES_ELEMENT_ONLY);
    KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
    ServiceContainer container = services.getContainer();
    ServiceController<BpmPlatformPlugins> serviceController = (ServiceController<BpmPlatformPlugins>) container.getService(PLATFORM_BPM_PLATFORM_PLUGINS_SERVICE_NAME);
    assertNotNull(serviceController);
    BpmPlatformPlugins platformPlugins = serviceController.getValue();
    assertNotNull(platformPlugins);
    assertEquals(1, platformPlugins.getPlugins().size());
    assertTrue(platformPlugins.getPlugins().get(0) instanceof ExampleBpmPlatformPlugin);
}
Also used : BpmPlatformPlugins(org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins) ServiceContainer(org.jboss.msc.service.ServiceContainer) KernelServices(org.jboss.as.subsystem.test.KernelServices) ServiceController(org.jboss.msc.service.ServiceController) AbstractSubsystemTest(org.jboss.as.subsystem.test.AbstractSubsystemTest) Test(org.junit.Test)

Example 3 with BpmPlatformPlugins

use of org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins in project camunda-bpm-platform by camunda.

the class ProcessApplicationStopService method stop.

@Override
public void stop(StopContext arg0) {
    ManagedReference reference = null;
    try {
        // get the process application component
        ProcessApplicationInterface processApplication = null;
        ComponentView componentView = paComponentViewInjector.getOptionalValue();
        if (componentView != null) {
            reference = componentView.createInstance();
            processApplication = (ProcessApplicationInterface) reference.getInstance();
        } else {
            processApplication = noViewProcessApplication.getValue();
        }
        BpmPlatformPlugins bpmPlatformPlugins = platformPluginsInjector.getValue();
        List<BpmPlatformPlugin> plugins = bpmPlatformPlugins.getPlugins();
        for (BpmPlatformPlugin bpmPlatformPlugin : plugins) {
            bpmPlatformPlugin.postProcessApplicationUndeploy(processApplication);
        }
    } catch (Exception e) {
        LOGGER.log(Level.WARNING, "Exception while invoking BpmPlatformPlugin.postProcessApplicationUndeploy", e);
    } finally {
        if (reference != null) {
            reference.release();
        }
    }
}
Also used : BpmPlatformPlugins(org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins) BpmPlatformPlugin(org.camunda.bpm.container.impl.plugin.BpmPlatformPlugin) ComponentView(org.jboss.as.ee.component.ComponentView) ManagedReference(org.jboss.as.naming.ManagedReference) ProcessApplicationInterface(org.camunda.bpm.application.ProcessApplicationInterface) StartException(org.jboss.msc.service.StartException)

Example 4 with BpmPlatformPlugins

use of org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins in project camunda-bpm-platform by camunda.

the class DiscoverBpmPlatformPluginsStep method performOperationStep.

@Override
public void performOperationStep(DeploymentOperation operationContext) {
    PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    BpmPlatformPlugins plugins = BpmPlatformPlugins.load(getPluginsClassloader());
    JmxManagedBpmPlatformPlugins jmxManagedPlugins = new JmxManagedBpmPlatformPlugins(plugins);
    serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_PLATFORM_PLUGINS, jmxManagedPlugins);
}
Also used : JmxManagedBpmPlatformPlugins(org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins) BpmPlatformPlugins(org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins) JmxManagedBpmPlatformPlugins(org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer)

Aggregations

BpmPlatformPlugins (org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins)4 ProcessApplicationInterface (org.camunda.bpm.application.ProcessApplicationInterface)1 MscBpmPlatformPlugins (org.camunda.bpm.container.impl.jboss.service.MscBpmPlatformPlugins)1 MscRuntimeContainerDelegate (org.camunda.bpm.container.impl.jboss.service.MscRuntimeContainerDelegate)1 JmxManagedBpmPlatformPlugins (org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins)1 BpmPlatformPlugin (org.camunda.bpm.container.impl.plugin.BpmPlatformPlugin)1 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)1 ComponentView (org.jboss.as.ee.component.ComponentView)1 ManagedReference (org.jboss.as.naming.ManagedReference)1 AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)1 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)1 AbstractSubsystemTest (org.jboss.as.subsystem.test.AbstractSubsystemTest)1 KernelServices (org.jboss.as.subsystem.test.KernelServices)1 ServiceContainer (org.jboss.msc.service.ServiceContainer)1 ServiceController (org.jboss.msc.service.ServiceController)1 StartException (org.jboss.msc.service.StartException)1 Test (org.junit.Test)1