@Override public <T> T attachIfAbsent(final AttachmentKey<T> key, final T value) { return primaryContext.attachIfAbsent(key, value); }
public static void addToDontPropagateToServersAttachment(OperationContext context, ModelNode op) { ModelNode cleanOp = cleanOpForDontPropagate(op); Set<ModelNode> ops = Collections.synchronizedSet(new HashSet<ModelNode>(Collections.singleton(cleanOp))); Set<ModelNode> existing = context.attachIfAbsent(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT, ops); if (existing != null){ existing.add(cleanOp); } }
public static void addToDontPropagateToServersAttachment(OperationContext context, ModelNode op) { ModelNode cleanOp = cleanOpForDontPropagate(op); Set<ModelNode> ops = Collections.synchronizedSet(new HashSet<ModelNode>(Collections.singleton(cleanOp))); Set<ModelNode> existing = context.attachIfAbsent(DONT_PROPAGATE_TO_SERVERS_ATTACHMENT, ops); if (existing != null){ existing.add(cleanOp); } }
public static TransformerOperationAttachment getOrCreate(OperationContext context) { assert !context.isBooting() : "Only usable once booted"; TransformerOperationAttachment attachment = new TransformerOperationAttachment(); TransformerOperationAttachment original = context.attachIfAbsent(KEY, attachment); return original == null ? attachment : original; }
public static TransformerOperationAttachment getOrCreate(OperationContext context) { assert !context.isBooting() : "Only usable once booted"; TransformerOperationAttachment attachment = new TransformerOperationAttachment(); TransformerOperationAttachment original = context.attachIfAbsent(KEY, attachment); return original == null ? attachment : original; }
public static void validateAtBoot(OperationContext context, ModelNode operation) { assert !context.getProcessType().isServer() : "Not a host controller"; assert context.isBooting() : "Should only be called at boot"; assert operation.require(OP).asString().equals("validate"); //Should only be called by the domain controller service //Only validate once if (context.attachIfAbsent(KEY, DomainModelIncludesValidator.INSTANCE) == null) { context.addStep(DomainModelIncludesValidator.INSTANCE, OperationContext.Stage.MODEL); } }
public static void validateAtBoot(OperationContext context, ModelNode operation) { assert !context.getProcessType().isServer() : "Not a host controller"; assert context.isBooting() : "Should only be called at boot"; assert operation.require(OP).asString().equals("validate"); //Should only be called by the domain controller service //Only validate once if (context.attachIfAbsent(KEY, DomainModelIncludesValidator.INSTANCE) == null) { context.addStep(DomainModelIncludesValidator.INSTANCE, OperationContext.Stage.MODEL); } }
public static void addValidationStep(OperationContext context, ModelNode operation) { assert !context.getProcessType().isServer() : "Not a host controller"; if (!context.isBooting()) { // This does not need to get executed on boot the domain controller service does that once booted // by calling validateAtBoot(). Otherwise we get issues with the testsuite, which only partially sets up the model if (context.attachIfAbsent(KEY, DomainModelIncludesValidator.INSTANCE) == null) { context.addStep(DomainModelIncludesValidator.INSTANCE, OperationContext.Stage.MODEL); } } }
public static void addValidationStep(OperationContext context, ModelNode operation) { assert !context.getProcessType().isServer() : "Not a host controller"; if (!context.isBooting()) { // This does not need to get executed on boot the domain controller service does that once booted // by calling validateAtBoot(). Otherwise we get issues with the testsuite, which only partially sets up the model if (context.attachIfAbsent(KEY, DomainModelIncludesValidator.INSTANCE) == null) { context.addStep(DomainModelIncludesValidator.INSTANCE, OperationContext.Stage.MODEL); } } }
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);
@Override public void handleResult(final ResultAction resultAction, final OperationContext context, final ModelNode operation) { if (resultAction == ResultAction.KEEP) { configurationPersistence.commit(); if (!LoggingProfileOperations.isLoggingProfileAddress(getAddress(operation))) { // Write once if (context.getAttachment(WRITTEN_KEY) == null) { context.attachIfAbsent(WRITTEN_KEY, Boolean.TRUE); if (persistConfig) { configurationPersistence.writeConfiguration(context); } } } } else if (resultAction == ResultAction.ROLLBACK) { configurationPersistence.rollback(); } } });
@Override public void handleResult(final ResultAction resultAction, final OperationContext context, final ModelNode operation) { if (resultAction == ResultAction.KEEP) { configurationPersistence.commit(); if (!LoggingProfileOperations.isLoggingProfileAddress(context.getCurrentAddress())) { // Write once if (context.getAttachment(WRITTEN_KEY) == null) { context.attachIfAbsent(WRITTEN_KEY, Boolean.TRUE); if (persistConfig) { configurationPersistence.writeConfiguration(context); } } } } else if (resultAction == ResultAction.ROLLBACK) { configurationPersistence.rollback(); } } });
@Override public void handleResult(final ResultAction resultAction, final OperationContext context, final ModelNode operation) { if (resultAction == ResultAction.KEEP) { configurationPersistence.commit(); if (!LoggingProfileOperations.isLoggingProfileAddress(context.getCurrentAddress())) { // Write once if (context.getAttachment(WRITTEN_KEY) == null) { context.attachIfAbsent(WRITTEN_KEY, Boolean.TRUE); if (persistConfig) { configurationPersistence.writeConfiguration(context); } } } } else if (resultAction == ResultAction.ROLLBACK) { configurationPersistence.rollback(); } } });
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);
context.attachIfAbsent(CompositeOperationHandler.DOMAIN_EXECUTION_KEY, Boolean.TRUE);