Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for the wildlfy subsystem for WF 14 (possibly 12 and 13) #306

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions distro/wildfly/subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<packaging>jar</packaging>

<name>camunda BPM - Wildfly Subsystem</name>

<dependencies>

<dependency>
Expand Down Expand Up @@ -157,6 +157,33 @@
</dependency>
</dependencies>
</profile>
</profiles>
<profile>
<id>wildfly14</id>
<properties>
<version.wildfly14>14.0.0.Final</version.wildfly14>
<version.wildfly14.core>5.0.0.Final</version.wildfly14.core>
</properties>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-web-common</artifactId>
<version>${version.wildfly14}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb3</artifactId>
<version>${version.wildfly14}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-subsystem-test-framework</artifactId>
<version>${version.wildfly14.core}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,88 +10,101 @@

public class SubsystemAttributeDefinitons {

public static final String DEFAULT_DATASOURCE = "java:jboss/datasources/ExampleDS";
public static final String DEFAULT_HISTORY_LEVEL = "audit";
public static final String DEFAULT_PROCESS_ENGINE_CONFIGURATION_CLASS = ManagedJtaProcessEngineConfiguration.class.getName();
public static final String DEFAULT_ACQUISITION_STRATEGY = "SEQUENTIAL";
public static final String DEFAULT_JOB_EXECUTOR_THREADPOOL_NAME = "job-executor-tp";
public static final int DEFAULT_CORE_THREADS = 3;
public static final int DEFAULT_MAX_THREADS = 5;
public static final int DEFAULT_QUEUE_LENGTH = 10;
public static final int DEFAULT_KEEPALIVE_TIME = 10;
public static final boolean DEFAULT_ALLOW_CORE_TIMEOUT = true;

// general
public static final SimpleAttributeDefinition NAME = new SimpleAttributeDefinition(ModelConstants.NAME, new ModelNode("default"), ModelType.STRING, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleMapAttributeDefinition PROPERTIES = new SimpleMapAttributeDefinition.Builder(ModelConstants.PROPERTIES, true)
.setAttributeMarshaller(CustomMarshaller.PROPERTIES_MARSHALLER)
.setRestartAllServices()
.build();

// process engine
public static final SimpleAttributeDefinition DEFAULT = new SimpleAttributeDefinition(ModelConstants.DEFAULT, new ModelNode(false), ModelType.BOOLEAN, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition DATASOURCE = new SimpleAttributeDefinition(ModelConstants.DATASOURCE, new ModelNode(DEFAULT_DATASOURCE), ModelType.STRING, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition HISTORY_LEVEL = new SimpleAttributeDefinition(ModelConstants.HISTORY_LEVEL, new ModelNode(DEFAULT_HISTORY_LEVEL), ModelType.STRING, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition CONFIGURATION = new SimpleAttributeDefinition(ModelConstants.CONFIGURATION, new ModelNode(DEFAULT_PROCESS_ENGINE_CONFIGURATION_CLASS), ModelType.STRING, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);

// job executor
@Deprecated
public static final SimpleAttributeDefinition THREAD_POOL_NAME = new SimpleAttributeDefinition(ModelConstants.THREAD_POOL_NAME, new ModelNode(DEFAULT_JOB_EXECUTOR_THREADPOOL_NAME), ModelType.STRING, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition CORE_THREADS = new SimpleAttributeDefinition(ModelConstants.CORE_THREADS, new ModelNode(DEFAULT_CORE_THREADS), ModelType.INT, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition MAX_THREADS = new SimpleAttributeDefinition(ModelConstants.MAX_THREADS, new ModelNode(DEFAULT_MAX_THREADS), ModelType.INT, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition QUEUE_LENGTH = new SimpleAttributeDefinition(ModelConstants.QUEUE_LENGTH, new ModelNode(DEFAULT_QUEUE_LENGTH), ModelType.INT, false, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition KEEPALIVE_TIME = new SimpleAttributeDefinition(ModelConstants.KEEPALIVE_TIME, new ModelNode(DEFAULT_KEEPALIVE_TIME), ModelType.INT, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
public static final SimpleAttributeDefinition ALLOW_CORE_TIMEOUT = new SimpleAttributeDefinition(ModelConstants.ALLOW_CORE_TIMEOUT, new ModelNode(DEFAULT_ALLOW_CORE_TIMEOUT), ModelType.BOOLEAN, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);
@Deprecated
public static final SimpleAttributeDefinition ACQUISITION_STRATEGY = new SimpleAttributeDefinition(ModelConstants.ACQUISITION_STRATEGY, new ModelNode(DEFAULT_ACQUISITION_STRATEGY), ModelType.STRING, true, AttributeAccess.Flag.RESTART_ALL_SERVICES);

public static final SimpleAttributeDefinition PLUGIN_CLASS = SimpleAttributeDefinitionBuilder.create(ModelConstants.PLUGIN_CLASS, ModelType.STRING, true)
.setAttributeMarshaller(CustomMarshaller.ATTRIBUTE_AS_ELEMENT)
.build();

public static final AttributeDefinition[] PLUGIN_ATTRIBUTES = new AttributeDefinition[] {
PLUGIN_CLASS,
PROPERTIES
};

public static final FixedObjectTypeAttributeDefinition PLUGIN = FixedObjectTypeAttributeDefinition.Builder.of(ModelConstants.PLUGIN, PLUGIN_ATTRIBUTES)
.setAttributeMarshaller(CustomMarshaller.OBJECT_AS_ELEMENT)
.setAttributeParser(AttributeParser.LIST)
.setRequires(ModelConstants.PLUGIN_CLASS)
.setAllowNull(true)
.setRestartAllServices()
.build();

public static final ObjectListAttributeDefinition PLUGINS = ObjectListAttributeDefinition.Builder.of(ModelConstants.PLUGINS, PLUGIN)
.setAttributeMarshaller(CustomMarshaller.OBJECT_LIST)
.setAllowNull(true)
.setAllowExpression(true)
.setRestartAllServices()
.build();

public static final AttributeDefinition[] JOB_EXECUTOR_ATTRIBUTES = new AttributeDefinition[] {
THREAD_POOL_NAME,
CORE_THREADS,
MAX_THREADS,
QUEUE_LENGTH,
KEEPALIVE_TIME,
ALLOW_CORE_TIMEOUT
};

public static final AttributeDefinition[] JOB_ACQUISITION_ATTRIBUTES = new AttributeDefinition[] {
NAME,
ACQUISITION_STRATEGY,
PROPERTIES
};

public static final AttributeDefinition[] PROCESS_ENGINE_ATTRIBUTES = new AttributeDefinition[] {
NAME,
DEFAULT,
DATASOURCE,
HISTORY_LEVEL,
CONFIGURATION,
PROPERTIES,
PLUGINS
};
public static final String DEFAULT_DATASOURCE = "java:jboss/datasources/ExampleDS";
public static final String DEFAULT_HISTORY_LEVEL = "audit";
public static final String DEFAULT_PROCESS_ENGINE_CONFIGURATION_CLASS =
ManagedJtaProcessEngineConfiguration.class.getName();
public static final String DEFAULT_ACQUISITION_STRATEGY = "SEQUENTIAL";
public static final String DEFAULT_JOB_EXECUTOR_THREADPOOL_NAME = "job-executor-tp";
public static final int DEFAULT_CORE_THREADS = 3;
public static final int DEFAULT_MAX_THREADS = 5;
public static final int DEFAULT_QUEUE_LENGTH = 10;
public static final int DEFAULT_KEEPALIVE_TIME = 10;
public static final boolean DEFAULT_ALLOW_CORE_TIMEOUT = true;

// general
public static final SimpleAttributeDefinition NAME =
new SimpleAttributeDefinitionBuilder(ModelConstants.NAME, ModelType.STRING, false)
.setDefaultValue(new ModelNode("default")).setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.build();
public static final SimpleMapAttributeDefinition PROPERTIES =
new SimpleMapAttributeDefinition.Builder(ModelConstants.PROPERTIES, true)
.setAttributeMarshaller(CustomMarshaller.PROPERTIES_MARSHALLER).setRestartAllServices().build();

// process engine
public static final SimpleAttributeDefinition DEFAULT =
new SimpleAttributeDefinitionBuilder(ModelConstants.DEFAULT, ModelType.BOOLEAN, true)
.setDefaultValue(new ModelNode(false)).setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition DATASOURCE =
new SimpleAttributeDefinitionBuilder(ModelConstants.DATASOURCE, ModelType.STRING, false)
.setDefaultValue(new ModelNode(DEFAULT_DATASOURCE))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition HISTORY_LEVEL =
new SimpleAttributeDefinitionBuilder(ModelConstants.HISTORY_LEVEL, ModelType.STRING, true)
.setDefaultValue(new ModelNode(DEFAULT_HISTORY_LEVEL))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition CONFIGURATION =
new SimpleAttributeDefinitionBuilder(ModelConstants.CONFIGURATION, ModelType.STRING, true)
.setDefaultValue(new ModelNode(DEFAULT_PROCESS_ENGINE_CONFIGURATION_CLASS))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();

// job executor
@Deprecated
public static final AttributeDefinition THREAD_POOL_NAME =
new SimpleAttributeDefinitionBuilder(ModelConstants.THREAD_POOL_NAME, ModelType.STRING, true)
.setDefaultValue(new ModelNode(DEFAULT_JOB_EXECUTOR_THREADPOOL_NAME))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition CORE_THREADS =
new SimpleAttributeDefinitionBuilder(ModelConstants.CORE_THREADS, ModelType.INT, false)
.setDefaultValue(new ModelNode(DEFAULT_CORE_THREADS))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition MAX_THREADS =
new SimpleAttributeDefinitionBuilder(ModelConstants.MAX_THREADS, ModelType.INT, false)
.setDefaultValue(new ModelNode(DEFAULT_MAX_THREADS))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition QUEUE_LENGTH =
new SimpleAttributeDefinitionBuilder(ModelConstants.QUEUE_LENGTH, ModelType.INT, false)
.setDefaultValue(new ModelNode(DEFAULT_QUEUE_LENGTH))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)

.build();
public static final AttributeDefinition KEEPALIVE_TIME =
new SimpleAttributeDefinitionBuilder(ModelConstants.KEEPALIVE_TIME, ModelType.INT, true)
.setDefaultValue(new ModelNode(DEFAULT_KEEPALIVE_TIME))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
public static final AttributeDefinition ALLOW_CORE_TIMEOUT =
new SimpleAttributeDefinitionBuilder(ModelConstants.ALLOW_CORE_TIMEOUT, ModelType.BOOLEAN, true)
.setDefaultValue(new ModelNode(DEFAULT_ALLOW_CORE_TIMEOUT))
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();
@Deprecated
public static final AttributeDefinition ACQUISITION_STRATEGY =
new SimpleAttributeDefinitionBuilder(ModelConstants.ACQUISITION_STRATEGY, ModelType.STRING, true)
.setDefaultValue(new ModelNode(true)).setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES).build();


public static final SimpleAttributeDefinition PLUGIN_CLASS =
SimpleAttributeDefinitionBuilder.create(ModelConstants.PLUGIN_CLASS, ModelType.STRING, true)
.setAttributeMarshaller(CustomMarshaller.ATTRIBUTE_AS_ELEMENT).build();

public static final AttributeDefinition[] PLUGIN_ATTRIBUTES =
new AttributeDefinition[] { PLUGIN_CLASS, PROPERTIES };

public static final FixedObjectTypeAttributeDefinition PLUGIN = FixedObjectTypeAttributeDefinition.Builder
.of(ModelConstants.PLUGIN, PLUGIN_ATTRIBUTES).setAttributeMarshaller(CustomMarshaller.OBJECT_AS_ELEMENT)
.setAttributeParser(AttributeParser.OBJECT_LIST_PARSER).setRequires(ModelConstants.PLUGIN_CLASS)
.setAllowNull(true).setRestartAllServices().build();

public static final ObjectListAttributeDefinition PLUGINS = ObjectListAttributeDefinition.Builder
.of(ModelConstants.PLUGINS, PLUGIN).setAttributeMarshaller(CustomMarshaller.OBJECT_LIST).setAllowNull(true)
.setAllowExpression(true).setRestartAllServices().build();

public static final AttributeDefinition[] JOB_EXECUTOR_ATTRIBUTES = new AttributeDefinition[] { THREAD_POOL_NAME,
CORE_THREADS, MAX_THREADS, QUEUE_LENGTH, KEEPALIVE_TIME, ALLOW_CORE_TIMEOUT };

public static final AttributeDefinition[] JOB_ACQUISITION_ATTRIBUTES =
new AttributeDefinition[] { NAME, ACQUISITION_STRATEGY, PROPERTIES };

public static final AttributeDefinition[] PROCESS_ENGINE_ATTRIBUTES =
new AttributeDefinition[] { NAME, DEFAULT, DATASOURCE, HISTORY_LEVEL, CONFIGURATION, PROPERTIES, PLUGINS };

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.server.deployment.Phase;
Expand All @@ -50,8 +49,7 @@ private BpmPlatformSubsystemAdd() {

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

// add deployment processors
context.addStep(new AbstractDeploymentChainStep() {
Expand All @@ -69,23 +67,17 @@ public void execute(DeploymentProcessorTarget processorTarget) {

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ private JobAcquisitionAdd() {
}

@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model,
ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers)
throws OperationFailedException {
protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {

String acquisitionName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();

Expand All @@ -63,12 +61,8 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod
ServiceController<RuntimeContainerJobExecutor> serviceController = context.getServiceTarget().addService(ServiceNames.forMscRuntimeContainerJobExecutorService(acquisitionName), mscRuntimeContainerJobExecutor)
.addDependency(ServiceNames.forMscRuntimeContainerDelegate())
.addDependency(ServiceNames.forMscExecutorService())
.addListener(verificationHandler)
.setInitialMode(Mode.ACTIVE)
.install();

newControllers.add(serviceController);

}

}
Loading