Skip to content

Commit

Permalink
chore(jboss): improve JBoss AS 7.2 Support
Browse files Browse the repository at this point in the history
- use new ResourceBuilder Factory API to describe subsystem resources
- remove legacy DESCRIBE operation
- add profile 'jboss-domain' to run integrationtest against domain cluster
- some cleanup & housekeeping

related to #CAM-1334
  • Loading branch information
meyerdan committed Nov 20, 2013
1 parent 4719582 commit 9de80e6
Show file tree
Hide file tree
Showing 19 changed files with 1,900 additions and 569 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ camunda BPM platform is a flexible framework for workflow and process automation
Components
----------

camunda BPM platform provides a rich set of components centered around the BPM lifecycle.
camunda BPM platform provides a rich set of components centered around the BPM lifecycle.

#### Process Implementation and Execution
* camunda engine - The core component responsible for executing BPMN 2.0 processes.
Expand All @@ -31,7 +31,7 @@ camunda BPM platform provides a rich set of components centered around the BPM l

#### Human Task Management
* camunda tasklist - Simple web application demonstrating how the process engine task API can be used.

#### And there's more...

* [camunda-bpmn.js](https://github.com/camunda/camunda-bpmn.js) - We have started building a complete BPMN toolkit for Java Script (Parser, Process Engine, Renderer)
Expand Down Expand Up @@ -59,25 +59,30 @@ This will build all the modules that make up the camunda BPM platform but will n

distro/tomcat/distro/target (Apache Tomcat 7 Distribution)
distro/gf31/distro/target (Glassfish 3 Distribution)
distro/jbossas7/distro/target (JBoss AS 7 Distribution)
distro/jbossas7/distro/target (JBoss AS 7 Distribution)

Running Integration Tests
----------
The integration testsuites are located under `qa/`. There you'll find a folder named XX-runtime for each server runtime we support. These projects are responsible for taking a runtime container distribution (ie. Apache Tomcat, JBoss AS ...) and configuring it for integration testing. The actual integration tests are located in the `qa/integration-tests-engine` and `qa/integration-tests-webapps` modules.
The integration testsuites are located under `qa/`. There you'll find a folder named XX-runtime for each server runtime we support. These projects are responsible for taking a runtime container distribution (ie. Apache Tomcat, JBoss AS ...) and configuring it for integration testing. The actual integration tests are located in the `qa/integration-tests-engine` and `qa/integration-tests-webapps` modules.
* *integration-tests-engine*: This module contains an extensive testsuite that test the integration of the process engine within a particular runtime container. For example, such tests will ensure that if you use the Job Executor Service inside a Java EE Container, you get a proper CDI request context spanning multiple EJB invocations or that EE resource injection works as expected. These integration tests are executed in-container, using [JBoss Arquillian](http:https://arquillian.org/).
* *integration-tests-webapps*: This module tests the camunda BPM webapplications inside the runtime containers. These integration tests run inside a client / server setting: the webapplication is deployed to the runtime container, the runtime container is started and the tests running inside a client VM perform requests against the deployed applications.

In order to run the integration tests, first perform a full install build. Then navigate to the `qa` folder.
In order to run the integration tests, first perform a full install build. Then navigate to the `qa` folder.

We have different maven profiles for selecting
We have different maven profiles for selecting
* *Runtime containers & environments*: jboss, glassfish, tomcat
* *The testsuite*: engine-integration, webapps-integration
* *The database*: h2,h2-xa,db2,db2-xa,mssql,mssql-xa,oracle,oracle-xa,postgres,postgres-xa,mysql,mysql-xa (XA is only supprted on JBoss & Glassfish ATM)

In order to configure the build, compose the profiles for runtime container, testsuite, database. Example:

mvn clean install -Pengine-integration,jboss,h2

You can select multiple testsuites but only a single database and a single runtime container. This is valid:

mvn clean install -Pengine-integration,webapps-integration,tomcat,db2

There is a special profile for JBoss Application Server:

* Domain mode: `mvn clean install -Pengine-integration,h2,jboss-domain`

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,67 +15,83 @@
*/
package org.camunda.bpm.container.impl.jboss.extension;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;
import static org.camunda.bpm.container.impl.jboss.extension.ModelConstants.SUBSYSTEM_NAME;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;

import org.camunda.bpm.container.impl.jboss.extension.handler.BpmPlatformSubsystemDescribe;
import org.camunda.bpm.container.impl.jboss.extension.resource.BpmPlatformSubsystemRootResourceDefinition;
import org.camunda.bpm.container.impl.jboss.extension.resource.JobAcquisitionResourceDefinition;
import org.camunda.bpm.container.impl.jboss.extension.resource.JobExecutorResourceDefinition;
import org.camunda.bpm.container.impl.jboss.extension.resource.ProcessEnginesResourceDefinition;
import org.camunda.bpm.container.impl.jboss.extension.handler.BpmPlatformSubsystemAdd;
import org.camunda.bpm.container.impl.jboss.extension.handler.BpmPlatformSubsystemRemove;
import org.camunda.bpm.container.impl.jboss.extension.handler.JobAcquisitionAdd;
import org.camunda.bpm.container.impl.jboss.extension.handler.JobAcquisitionRemove;
import org.camunda.bpm.container.impl.jboss.extension.handler.JobExecutorAdd;
import org.camunda.bpm.container.impl.jboss.extension.handler.JobExecutorRemove;
import org.camunda.bpm.container.impl.jboss.extension.handler.ProcessEngineAdd;
import org.camunda.bpm.container.impl.jboss.extension.handler.ProcessEngineRemove;
import org.jboss.as.controller.Extension;
import org.jboss.as.controller.ExtensionContext;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.ResourceBuilder;
import org.jboss.as.controller.ResourceDefinition;
import org.jboss.as.controller.SubsystemRegistration;
import org.jboss.as.controller.descriptions.ResourceDescriptionResolver;
import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver;
import org.jboss.as.controller.parsing.ExtensionParsingContext;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.as.controller.registry.OperationEntry;
import org.jboss.msc.service.ServiceName;



/**
* Defines the bpm-platform subsystem for jboss application server
*
*
* @author Daniel Meyer
*/
public class BpmPlatformExtension implements Extension {

public static final int FOX_PLATFORM_SUBSYSTEM_MAJOR_VERSION = 1;
public static final int FOX_PLATFORM_SUBSYSTEM_MINOR_VERSION = 1;
public static final int BPM_PLATFORM_SUBSYSTEM_MAJOR_VERSION = 1;
public static final int BPM_PLATFORM_SUBSYSTEM_MINOR_VERSION = 1;

/** The parser used for parsing our subsystem */
private final BpmPlatformParser parser = new BpmPlatformParser();

public static final String RESOURCE_NAME = BpmPlatformExtension.class.getPackage().getName() + ".LocalDescriptions";

private static final PathElement SUBSYSTEM_PATH = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME);
private static final PathElement PROCESS_ENGINES_PATH = PathElement.pathElement(ModelConstants.PROCESS_ENGINES);
private static final PathElement JOB_EXECUTOR_PATH = PathElement.pathElement(ModelConstants.JOB_EXECUTOR);
private static final PathElement JOB_ACQUISTIONS_PATH = PathElement.pathElement(ModelConstants.JOB_ACQUISITIONS);


public void initialize(ExtensionContext context) {
// Register the subsystem and operation handlers
SubsystemRegistration subsystem = context.registerSubsystem(ModelConstants.SUBSYSTEM_NAME, FOX_PLATFORM_SUBSYSTEM_MAJOR_VERSION, FOX_PLATFORM_SUBSYSTEM_MINOR_VERSION);
SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, BPM_PLATFORM_SUBSYSTEM_MAJOR_VERSION, BPM_PLATFORM_SUBSYSTEM_MINOR_VERSION);
subsystem.registerXMLElementWriter(parser);

// Root resource
final ManagementResourceRegistration rootRegistration = subsystem.registerSubsystemModel(BpmPlatformSubsystemRootResourceDefinition.INSTANCE);
rootRegistration.registerOperationHandler(DESCRIBE, BpmPlatformSubsystemDescribe.INSTANCE, BpmPlatformSubsystemDescribe.INSTANCE, false, OperationEntry.EntryType.PRIVATE);

// Process Engine
rootRegistration.registerSubModel(new ProcessEnginesResourceDefinition());

// Job Executor
ManagementResourceRegistration jobExecutorRegistration = rootRegistration.registerSubModel(new JobExecutorResourceDefinition());
//Job acquisition
jobExecutorRegistration.registerSubModel(new JobAcquisitionResourceDefinition());


// build resource definitions

ResourceBuilder processEnginesResource = ResourceBuilder.Factory.create(PROCESS_ENGINES_PATH, getResourceDescriptionResolver(ModelConstants.PROCESS_ENGINES))
.setAddOperation(ProcessEngineAdd.INSTANCE)
.setRemoveOperation(ProcessEngineRemove.INSTANCE);

ResourceBuilder jobAcquisitionResource = ResourceBuilder.Factory.create(JOB_ACQUISTIONS_PATH, getResourceDescriptionResolver(ModelConstants.JOB_ACQUISITIONS))
.setAddOperation(JobAcquisitionAdd.INSTANCE)
.setRemoveOperation(JobAcquisitionRemove.INSTANCE);

ResourceBuilder jobExecutorResource = ResourceBuilder.Factory.create(JOB_EXECUTOR_PATH, getResourceDescriptionResolver(ModelConstants.JOB_EXECUTOR))
.setAddOperation(JobExecutorAdd.INSTANCE)
.setRemoveOperation(JobExecutorRemove.INSTANCE)
.pushChild(jobAcquisitionResource).pop();

ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(SUBSYSTEM_NAME), BpmPlatformSubsystemAdd.INSTANCE, BpmPlatformSubsystemRemove.INSTANCE)
.pushChild(processEnginesResource).pop()
.pushChild(jobExecutorResource).pop()
.build();

subsystem.registerSubsystemModel(subsystemResource);

}

public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(ModelConstants.SUBSYSTEM_NAME, Namespace.CAMUNDA_BPM_PLATFORM_1_1.getUriString(), parser);
}

public static ServiceName getPlatformServiceType() {
return ServiceName.of("org").append("camunda").append("bpm").append("platform");
}

public static ResourceDescriptionResolver getResourceDescriptionResolver(String keyPrefix) {
public static StandardResourceDescriptionResolver getResourceDescriptionResolver(String keyPrefix) {
return new StandardResourceDescriptionResolver(keyPrefix, RESOURCE_NAME, BpmPlatformExtension.class.getClassLoader(), true, true);
}

Expand Down
Loading

0 comments on commit 9de80e6

Please sign in to comment.