@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
@Override protected boolean requiresRuntime(OperationContext context) { return !context.isBooting() && context.isDefaultRequiresRuntime(); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (context.isDefaultRequiresRuntime()) { context.addStep((ctx, op) -> { final KnownDeploymentsApi knownDeploymentsApi = context.getCapabilityRuntimeAPI( CAPABILITY_APPLICATION_SECURITY_DOMAIN_KNOWN_DEPLOYMENTS, ctx.getCurrentAddressValue(), KnownDeploymentsApi.class); ModelNode deploymentList = new ModelNode(); for (String current : knownDeploymentsApi.getKnownDeployments()) { deploymentList.add(current); } context.getResult().set(deploymentList); }, OperationContext.Stage.RUNTIME); } }
@Override protected Resource createResource(OperationContext context, ModelNode operation) { if (context.isDefaultRequiresRuntime()) { // Wrap a standard Resource impl in our custom variant that understands runtime-only children Resource delegate = Resource.Factory.create(); Resource result = new ModClusterResource(delegate, context.getCurrentAddressValue()); context.addResource(PathAddress.EMPTY_ADDRESS, result); return result; } else { return super.createResource(context, operation); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (context.isDefaultRequiresRuntime()) { context.addStep((ctx, op) -> { RuntimeCapability<Void> runtimeCapability = APPLICATION_SECURITY_DOMAIN_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue()); ServiceName serviceName = runtimeCapability.getCapabilityServiceName(ApplicationSecurityDomain.class); ServiceRegistry serviceRegistry = context.getServiceRegistry(false); ServiceController<?> controller = serviceRegistry.getRequiredService(serviceName); ModelNode deploymentList = new ModelNode(); if (controller.getState() == State.UP) { Service service = controller.getService(); if (service instanceof ApplicationSecurityDomainService) { for (String current : ((ApplicationSecurityDomainService) service).getDeployments()) { deploymentList.add(current); } } } context.getResult().set(deploymentList); }, OperationContext.Stage.RUNTIME); } } }
assert capabilitySet.isEmpty(); if (context.isDefaultRequiresRuntime()) { context.addStep(new OperationStepHandler() { @Override
if (context.isDefaultRequiresRuntime()) { context.addStep(new OperationStepHandler() { public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); } }
@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
/** * Gets whether a {@link org.jboss.as.controller.OperationContext.Stage#RUNTIME} step should be added to call * {@link #performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)}}. * This default implementation will return {@code true} for a normal server running in normal (non admin-only) mode. * If running on a host controller, it will return {@code true} if it is the active copy of the host controller subsystem. * Subclasses that perform no runtime update could override and return {@code false}. This method is * invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}. * * @param context operation context * @return {@code true} if {@code performRuntime} should be invoked; {@code false} otherwise. */ protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
@Override protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
@Override protected boolean requiresRuntime(OperationContext context) { return !context.isBooting() && context.isDefaultRequiresRuntime(); }
/** * Gets whether a {@link OperationContext.Stage#RUNTIME} handler should be added. This default implementation * returns true if the process is a {@link OperationContext#isNormalServer() normal server} and the process * is not {@link OperationContext#isBooting() booting}. The rationale for the latter check is if the process is * booting, the resource being modified will have been added as a previous step in the same context, and * the Stage.RUNTIME handling for that add will see a model the reflects the changes made by this handler and * will apply them to the runtime. * * @param context operation context * @return {@code true} if a runtime stage handler should be added; {@code false} otherwise. */ protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime() && !context.isBooting(); }
/** * Gets whether a {@link OperationContext.Stage#RUNTIME} handler should be added. This default implementation * returns true if the process is a {@link OperationContext#isNormalServer() normal server} and the process * is not {@link OperationContext#isBooting() booting}. The rationale for the latter check is if the process is * booting, the resource being modified will have been added as a previous step in the same context, and * the Stage.RUNTIME handling for that add will see a model the reflects the changes made by this handler and * will apply them to the runtime. * * @param context operation context * @return {@code true} if a runtime stage handler should be added; {@code false} otherwise. */ protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime() && !context.isBooting(); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (context.isDefaultRequiresRuntime()) { context.addStep((ctx, op) -> { final KnownDeploymentsApi knownDeploymentsApi = context.getCapabilityRuntimeAPI( CAPABILITY_APPLICATION_SECURITY_DOMAIN_KNOWN_DEPLOYMENTS, ctx.getCurrentAddressValue(), KnownDeploymentsApi.class); ModelNode deploymentList = new ModelNode(); for (String current : knownDeploymentsApi.getKnownDeployments()) { deploymentList.add(current); } context.getResult().set(deploymentList); }, OperationContext.Stage.RUNTIME); } }
@Override protected Resource createResource(OperationContext context, ModelNode operation) { if (context.isDefaultRequiresRuntime()) { // Wrap a standard Resource impl in our custom variant that understands runtime-only children Resource delegate = Resource.Factory.create(); Resource result = new ModClusterResource(delegate, context.getCurrentAddressValue()); context.addResource(PathAddress.EMPTY_ADDRESS, result); return result; } else { return super.createResource(context, operation); } } }
@Override protected Resource createResource(OperationContext context, ModelNode operation) { if (context.isDefaultRequiresRuntime()) { // Wrap a standard Resource impl in our custom variant that understands runtime-only children Resource delegate = Resource.Factory.create(); Resource result = new ModClusterResource(delegate, context.getCurrentAddressValue()); context.addResource(PathAddress.EMPTY_ADDRESS, result); return result; } else { return super.createResource(context, operation); } } }