serviceBuilder.install(); KnownDeploymentsApi knownDeploymentsApi = context.getAttachment(KNOWN_DEPLOYMENTS_KEY); knownDeploymentsApi.setApplicationSecurityDomainService(service);
/** * Gets any blocking timeout associated with the current context. * * @param context the context. Cannot e {@code null} * @return the blocking timeout. Will not return {@code null} */ public static BlockingTimeout getProxyBlockingTimeout(OperationContext context) { return context.getAttachment(ATTACHMENT_KEY); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { attachment = context.getAttachment(TransformerOperationAttachment.KEY); } }, OperationContext.Stage.RUNTIME); //Use RUNTIME here to make sure that this comes at the end (the collection ops add another step)
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Boolean attachment = context.getAttachment(MANAGEMENT_INTERFACE_KEY); if (attachment == null ||!context.getAttachment(MANAGEMENT_INTERFACE_KEY)) { context.setRollbackOnly(); } } }
private Integer incrementAttachedCounter(OperationContext context, OperationContext.AttachmentKey<Integer> key) { Integer value = context.getAttachment(key); if (value == null) { value = 0; } value = value + 1; context.attach(key, value); return value; }
public static synchronized void addToDontPropagateToServersAttachment(OperationContext context, ModelNode op) { Set<ModelNode> ops = context.getAttachment(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT); if (ops == null) { ops = new HashSet<ModelNode>(); context.attach(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT, ops); } ops.add(op); }
private Integer decrementAttachedCounter(OperationContext context, OperationContext.AttachmentKey<Integer> key) { Integer value = context.getAttachment(key); if (value == null) { return null; } value = value - 1; context.attach(key, value); return value; }
private boolean isDontPropagateToServers(OperationContext context, ModelNode op) { Set<ModelNode> dontPropagate = context.getAttachment(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT); if (dontPropagate != null && dontPropagate.contains(cleanOpForDontPropagate(op))) { return true; } return false; }
private boolean isDontPropagateToServers(OperationContext context, ModelNode op) { Set<ModelNode> dontPropagate = context.getAttachment(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT); if (dontPropagate != null && dontPropagate.contains(cleanOpForDontPropagate(op))) { return true; } return false; }
private void addOrderedChildTypeInfo(OperationContext context, Resource resource, ModelNode operation) { OrderedChildTypesAttachment attachment = context.getAttachment(OrderedChildTypesAttachment.KEY); if (attachment != null) { attachment.addOrderedChildResourceTypes(PathAddress.pathAddress(operation.get(OP_ADDR)), resource); } }
private void addOrderedChildTypeInfo(OperationContext context, Resource resource, ModelNode operation) { OrderedChildTypesAttachment attachment = context.getAttachment(OrderedChildTypesAttachment.KEY); if (attachment != null) { attachment.addOrderedChildResourceTypes(PathAddress.pathAddress(operation.get(OP_ADDR)), resource); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // We only need to report if our response has no failure description already // and if no other verification handler has reported a failure (which they may have done // against a different response object that is invisible to us at this point, // hence the use of the FAILURE_REPORTED_ATTACHMENT) if (!context.hasFailureDescription() && context.getAttachment(FAILURE_REPORTED_ATTACHMENT) == null) { throw new OperationFailedException(ContainerStateMonitor.createChangeReportLogMessage(changeReport, true)); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (context.getAttachment(SERVER_LAUNCH_KEY) != null) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.unsupportedLegacyExtension(extensionName)); } super.execute(context, operation); } }
private static ModelNode getOriginalDomainModel(OperationContext context) { ModelNode model = context.getAttachment(ORIGINAL_DOMAIN_MODEL_ATTACHMENT); if (model == null) { model = Resource.Tools.readModel(context.getOriginalRootResource()); context.attach(ORIGINAL_DOMAIN_MODEL_ATTACHMENT, model); } return model; }
private static ModelNode getDomainModel(OperationContext context) { ModelNode model = context.getAttachment(DOMAIN_MODEL_ATTACHMENT); if (model == null) { model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); context.attach(DOMAIN_MODEL_ATTACHMENT, model); } return model; }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // We only need to report if our response has no failure description already // and if no other verification handler has reported a failure (which they may have done // against a different response object that is invisible to us at this point, // hence the use of the FAILURE_REPORTED_ATTACHMENT) if (!context.hasFailureDescription() && context.getAttachment(FAILURE_REPORTED_ATTACHMENT) == null) { throw new OperationFailedException(ContainerStateMonitor.createChangeReportLogMessage(changeReport, true)); } } }
private static ModelNode getDomainModel(OperationContext context) { ModelNode model = context.getAttachment(DOMAIN_MODEL_ATTACHMENT); if (model == null) { model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); context.attach(DOMAIN_MODEL_ATTACHMENT, model); } return model; }
private static ModelNode getOriginalDomainModel(OperationContext context) { ModelNode model = context.getAttachment(ORIGINAL_DOMAIN_MODEL_ATTACHMENT); if (model == null) { model = Resource.Tools.readModel(context.getOriginalRootResource()); context.attach(ORIGINAL_DOMAIN_MODEL_ATTACHMENT, model); } return model; }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (context.getAttachment(SERVER_LAUNCH_KEY) != null) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.unsupportedLegacyExtension(extensionName)); } super.execute(context, operation); } }
/** * Creates a new {@code TransformationInputs} from the given operation context. * @param context the operation context. Cannot be {@code null} */ public TransformationInputs(OperationContext context) { this.originalModel = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true); this.registration = context.getRootResourceRegistration(); this.processType = context.getProcessType(); this.runningMode = context.getRunningMode(); this.transformerOperationAttachment = context.getAttachment(TransformerOperationAttachment.KEY); }