Source:
<code>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 { checkThreadPool(context, operation, WORKMANAGER_SHORT_RUNNING); super.populateModel(context, operation, resource); } }; resourceRegistration.registerSubModel( new JCAThreadPoolResourceDefinition(false, runtimeOnly, WORKMANAGER_SHORT_RUNNING, ThreadsServices.EXECUTOR.append(WORKMANAGER_SHORT_RUNNING), CommonAttributes.BOUNDED_QUEUE_THREAD_POOL, shortRunningThreadPoolAdd, new BoundedQueueThreadPoolRemove(shortRunningThreadPoolAdd))); 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 { <START> checkThreadPool(context, operation, WORKMANAGER_LONG_RUNNING); <END> super.populateModel(context, operation, resource); } }; resourceRegistration.registerSubModel( new JCAThreadPoolResourceDefinition(false, runtimeOnly, WORKMANAGER_LONG_RUNNING, ThreadsServices.EXECUTOR.append(WORKMANAGER_LONG_RUNNING), CommonAttributes.BOUNDED_QUEUE_THREAD_POOL, longRunningThreadPoolAdd, new BoundedQueueThreadPoolRemove(longRunningThreadPoolAdd))); }</code><technical_language>this done a validator attribute</technical_language>

Target:
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, new BoundedQueueThreadPoolRemove(shortRunningThreadPoolAdd))); 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))); }