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);
}
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);
}
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();
}
}
}
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);
}
Aggregations