use of org.jboss.as.threads.BoundedQueueThreadPoolAdd in project wildfly by wildfly.
the class JcaWorkManagerDefinition method registerSubModels.
static void registerSubModels(ManagementResourceRegistration resourceRegistration, boolean runtimeOnly) {
final BoundedQueueThreadPoolAdd shortRunningThreadPoolAdd = new BoundedQueueThreadPoolAdd(false, ThreadsServices.STANDARD_THREAD_FACTORY_RESOLVER, ThreadsServices.STANDARD_HANDOFF_EXECUTOR_RESOLVER, ThreadsServices.EXECUTOR.append(WORKMANAGER_SHORT_RUNNING)) {
@Override
protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException {
super.populateModel(context, operation, resource);
context.addStep(new OperationStepHandler() {
public void execute(OperationContext oc, ModelNode op) throws OperationFailedException {
checkThreadPool(oc, op, WORKMANAGER_SHORT_RUNNING);
}
}, MODEL);
}
};
resourceRegistration.registerSubModel(new JCAThreadPoolResourceDefinition(false, runtimeOnly, WORKMANAGER_SHORT_RUNNING, ThreadsServices.EXECUTOR.append(WORKMANAGER_SHORT_RUNNING), CommonAttributes.BOUNDED_QUEUE_THREAD_POOL, shortRunningThreadPoolAdd, ReloadRequiredRemoveStepHandler.INSTANCE));
final BoundedQueueThreadPoolAdd longRunningThreadPoolAdd = new BoundedQueueThreadPoolAdd(false, ThreadsServices.STANDARD_THREAD_FACTORY_RESOLVER, ThreadsServices.STANDARD_HANDOFF_EXECUTOR_RESOLVER, ThreadsServices.EXECUTOR.append(WORKMANAGER_LONG_RUNNING)) {
@Override
protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException {
super.populateModel(context, operation, resource);
context.addStep(new OperationStepHandler() {
public void execute(OperationContext oc, ModelNode op) throws OperationFailedException {
checkThreadPool(oc, op, WORKMANAGER_LONG_RUNNING);
}
}, MODEL);
}
};
resourceRegistration.registerSubModel(new JCAThreadPoolResourceDefinition(false, runtimeOnly, WORKMANAGER_LONG_RUNNING, ThreadsServices.EXECUTOR.append(WORKMANAGER_LONG_RUNNING), CommonAttributes.BOUNDED_QUEUE_THREAD_POOL, longRunningThreadPoolAdd, new BoundedQueueThreadPoolRemove(longRunningThreadPoolAdd)));
}
Aggregations