/** * Sets the address of the specified operation. * @param operation an operation * @param address a path address */ public static void setPathAddress(ModelNode operation, PathAddress address) { operation.get(ModelDescriptionConstants.OP_ADDR).set(address.toModelNode()); }
private ModelNode createAddStrictMaxBeanInstancePoolOperation(final String name, final Integer maxPoolSize, final Long timeout, final String timeoutUnit) { // create /subsystem=ejb3/strict-max-bean-instance-pool=name:add(...) final ModelNode addStrictMaxPoolOperation = new ModelNode(); addStrictMaxPoolOperation.get(OP).set(ADD); // set the address for this operation final PathAddress address = this.getEJB3SubsystemAddress().append(PathElement.pathElement(STRICT_MAX_BEAN_INSTANCE_POOL, name)); addStrictMaxPoolOperation.get(OP_ADDR).set(address.toModelNode()); // set the params for the operation if (maxPoolSize != null) { addStrictMaxPoolOperation.get(MAX_POOL_SIZE).set(maxPoolSize); } if (timeout != null) { addStrictMaxPoolOperation.get(INSTANCE_ACQUISITION_TIMEOUT).set(timeout); } if (timeoutUnit != null) { addStrictMaxPoolOperation.get(INSTANCE_ACQUISITION_TIMEOUT_UNIT).set(timeoutUnit); } return addStrictMaxPoolOperation; }
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> ops) throws XMLStreamException { final ThreadsParser threadsParser = ThreadsParser.getInstance(); final PathAddress subsystemAddress = PathAddress.pathAddress(BatchSubsystemDefinition.SUBSYSTEM_PATH); ops.add(subsystemAddOp); } else if (element == Element.THREAD_POOL) { threadsParser.parseUnboundedQueueThreadPool(reader, namespace.getUriString(), THREADS_1_1, subsystemAddress.toModelNode(), ops, BatchThreadPoolResourceDefinition.NAME, null); requiredElements.remove(Element.THREAD_POOL); } else if (element == Element.THREAD_FACTORY) { threadsParser.parseThreadFactory(reader, namespace.getUriString(), THREADS_1_1, subsystemAddress.toModelNode(), ops, BatchSubsystemDefinition.THREAD_FACTORY, null); } else {
@SuppressWarnings("deprecation") @Override public ModelNode transformOperation(ModelNode operation) { PathAddress address = Operations.getPathAddress(operation); PathAddress stackAddress = address.getParent(); ModelNode addProtocolOp = operation.clone(); addProtocolOp.get(ModelDescriptionConstants.OP_ADDR).set(stackAddress.toModelNode()); addProtocolOp.get(ModelDescriptionConstants.OP).set("add-protocol"); addProtocolOp = new LegacyPropertyAddOperationTransformer(op -> Operations.getPathAddress(op).append(pathElement(op.get(AbstractProtocolResourceDefinition.DeprecatedAttribute.TYPE.getName()).asString()))).transformOperation(addProtocolOp); return addProtocolOp; } };
@Override public ModelNode transformOperation(final ModelNode operation) { operation.get(ModelDescriptionConstants.OP_ADDR).set(LEGACY_ADDRESS_TRANSFORMER.transform(Operations.getPathAddress(operation)).toModelNode()); return new LegacyPropertyAddOperationTransformer().transformOperation(operation); } })).inheritResourceAttributeDefinitions();
PathAddress pa = PathAddress.pathAddress(op.get(OP_ADDR)); if (pa.size() == 1 && EXTENSION.equals(pa.getElement(0).getKey()) && BEAN_VALIDATION_MODULE.equals(pa.getElement(0).getValue())) { final ModelNode addBeanValidationExtensionOp = new ModelNode(); addBeanValidationExtensionOp.get(OP).set(ADD); PathAddress beanValidationExtensionAddress = PathAddress.pathAddress(PathElement.pathElement(EXTENSION, BEAN_VALIDATION_MODULE)); addBeanValidationExtensionOp.get(OP_ADDR).set(beanValidationExtensionAddress.toModelNode()); addBeanValidationExtensionOp.get(MODULE).set(BEAN_VALIDATION_MODULE); otherBootOperations.add(addBeanValidationExtensionOp); final ModelNode addBeanValidationSubsystemOp = new ModelNode(); addBeanValidationSubsystemOp.get(OP).set(ADD); PathAddress beanValidationSubsystemAddress = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, BEAN_VALIDATION_SUBSYSTEM)); addBeanValidationSubsystemOp.get(OP_ADDR).set(beanValidationSubsystemAddress.toModelNode()); legacyEEOps.add(addBeanValidationSubsystemOp);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource existing = context.readResource(PathAddress.EMPTY_ADDRESS); OperationStepHandler addHandler = context.getResourceRegistration().getSubModel(PathAddress.EMPTY_ADDRESS.append(newKeyName)).getOperationHandler(PathAddress.EMPTY_ADDRESS, "add"); oldAttribute.validateOperation(operation); List<ModelNode> modules = new ArrayList<ModelNode>(operation.get(oldAttribute.getName()).asList()); Collections.reverse(modules); //need to reverse it to make sure they are added in proper order for (ModelNode module : modules) { ModelNode addModuleOp = module.clone(); String code = addModuleOp.get(Constants.CODE).asString(); PathElement relativePath = PathElement.pathElement(newKeyName, code); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(relativePath); addModuleOp.get(OP_ADDR).set(address.toModelNode()); addModuleOp.get(OP).set(ADD); context.addStep(new ModelNode(), addModuleOp, addHandler, OperationContext.Stage.MODEL, true); } //remove on the end to make sure it is executed first for (Resource.ResourceEntry entry : existing.getChildren(newKeyName)) { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(entry.getPathElement()); ModelNode removeModuleOp = Util.createRemoveOperation(address); context.addStep(new ModelNode(), removeModuleOp, new SecurityDomainReloadRemoveHandler(), OperationContext.Stage.MODEL, true); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Resource existing = context.readResource(PathAddress.EMPTY_ADDRESS); OperationStepHandler addHandler = context.getResourceRegistration().getSubModel(PathAddress.EMPTY_ADDRESS.append(newKeyName)).getOperationHandler(PathAddress.EMPTY_ADDRESS, "add"); ModelNode value = operation.get(VALUE); if (value.isDefined()) { List<ModelNode> modules = new ArrayList<ModelNode>(value.asList()); Collections.reverse(modules); //need to reverse it to make sure they are added in proper order for (ModelNode module : modules) { ModelNode addModuleOp = module.clone(); String code = addModuleOp.get(Constants.CODE).asString(); PathElement relativePath = PathElement.pathElement(newKeyName, code); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(relativePath); addModuleOp.get(OP_ADDR).set(address.toModelNode()); addModuleOp.get(OP).set(ADD); context.addStep(new ModelNode(), addModuleOp, addHandler, OperationContext.Stage.MODEL, true); } } //remove on the end to make sure it is executed first for (Resource.ResourceEntry entry : existing.getChildren(newKeyName)) { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)).append(entry.getPathElement()); ModelNode removeModuleOp = Util.createRemoveOperation(address); context.addStep(new ModelNode(), removeModuleOp, new SecurityDomainReloadRemoveHandler(), OperationContext.Stage.MODEL, true); } } }
String name = null; final ModelNode bindingAdd = Util.createAddOperation(); bindingAdd.get(BINDING_TYPE).set(LOOKUP); final EnumSet<NamingSubsystemXMLAttribute> required = EnumSet.of(NamingSubsystemXMLAttribute.NAME, NamingSubsystemXMLAttribute.LOOKUP); for (int i = 0; i < attCount; i++) { bindingAdd.get(OP_ADDR).set(parentAddress.append(BINDING, name).toModelNode()); operations.add(bindingAdd);
String name = null; final ModelNode bindingAdd = Util.createAddOperation(); bindingAdd.get(BINDING_TYPE).set(LOOKUP); final EnumSet<NamingSubsystemXMLAttribute> required = EnumSet.of(NamingSubsystemXMLAttribute.NAME, NamingSubsystemXMLAttribute.LOOKUP); for (int i = 0; i < attCount; i++) { bindingAdd.get(OP_ADDR).set(parentAddress.append(BINDING, name).toModelNode()); operations.add(bindingAdd);
private void parseSimpleBinding(final XMLExtendedStreamReader reader, List<ModelNode> operations, PathAddress parentAddress) throws XMLStreamException { String name = null; final ModelNode bindingAdd = Util.createAddOperation(); bindingAdd.get(BINDING_TYPE).set(SIMPLE); final EnumSet<NamingSubsystemXMLAttribute> required = EnumSet.of(NamingSubsystemXMLAttribute.NAME, NamingSubsystemXMLAttribute.VALUE); for (int i = 0; i < reader.getAttributeCount(); i++) { final PathAddress address = parentAddress.append(BINDING, name); bindingAdd.get(OP_ADDR).set(address.toModelNode()); operations.add(bindingAdd);
private void parseSimpleBinding(final XMLExtendedStreamReader reader, List<ModelNode> operations, PathAddress parentAddress) throws XMLStreamException { String name = null; final ModelNode bindingAdd = Util.createAddOperation(); bindingAdd.get(BINDING_TYPE).set(SIMPLE); final EnumSet<NamingSubsystemXMLAttribute> required = EnumSet.of(NamingSubsystemXMLAttribute.NAME, NamingSubsystemXMLAttribute.VALUE); for (int i = 0; i < reader.getAttributeCount(); i++) { final PathAddress address = parentAddress.append(BINDING, name); bindingAdd.get(OP_ADDR).set(address.toModelNode()); operations.add(bindingAdd);
final PathAddress address = subsystemPathAddress.append(EESubsystemModel.CONTEXT_SERVICE, name); addOperation.get(OP_ADDR).set(address.toModelNode()); operations.add(addOperation);
final PathAddress address = subsystemPathAddress.append(EESubsystemModel.CONTEXT_SERVICE, name); addOperation.get(OP_ADDR).set(address.toModelNode()); operations.add(addOperation);
operation.get(ADDRESS).set(address.append(EJB3SubsystemModel.CHANNEL_CREATION_OPTIONS, optionName).toModelNode()); operations.add(operation);
final PathAddress address = subsystemPathAddress.append(EESubsystemModel.MANAGED_THREAD_FACTORY, name); addOperation.get(OP_ADDR).set(address.toModelNode()); operations.add(addOperation);
final PathAddress address = subsystemPathAddress.append(EESubsystemModel.MANAGED_THREAD_FACTORY, name); addOperation.get(OP_ADDR).set(address.toModelNode()); operations.add(addOperation);
elytronTLSEntityAddOperation.get(OP_ADDR).set(subsystemPath.append(elytronTLSEntityPath).toModelNode()); operations.add(elytronTLSEntityAddOperation); requireNoContent(reader);
elytronRealmAddOperation.get(OP_ADDR).set(subsystemPath.append(elytronRealmPath).toModelNode()); operations.add(elytronRealmAddOperation); requireNoContent(reader);
String name = null; final ModelNode bindingAdd = Util.createAddOperation(); bindingAdd.get(BINDING_TYPE).set(OBJECT_FACTORY); final EnumSet<NamingSubsystemXMLAttribute> required = EnumSet.of(NamingSubsystemXMLAttribute.NAME, NamingSubsystemXMLAttribute.MODULE, NamingSubsystemXMLAttribute.CLASS); for (int i = 0; i < attCount; i++) { throw missingRequired(reader, required); bindingAdd.get(OP_ADDR).set(parentAddress.append(BINDING, name).toModelNode()); operations.add(bindingAdd);