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; }
private void parsePools(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case BEAN_INSTANCE_POOLS: { this.parseBeanInstancePools(reader, operations); break; } default: { throw unexpectedElement(reader); } } } }
case MDB: { this.parseMDB(reader, operations, ejb3SubsystemAddOperation); break; this.parsePools(reader, operations); break; this.parseSessionBean(reader, operations, ejb3SubsystemAddOperation); break; parseTimerService(reader, operations); break;
private void parseSessionBean(final XMLExtendedStreamReader reader, final List<ModelNode> operations, ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case STATELESS: { this.parseStatelessBean(reader, operations, ejb3SubsystemAddOperation); break; } default: { throw unexpectedElement(reader); } } } }
private void parseBeanInstancePools(final XMLExtendedStreamReader reader, List<ModelNode> operations) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case STRICT_MAX_POOL: { this.parseStrictMaxPool(reader, operations); break; } default: { throw unexpectedElement(reader); } } } }
operations.add(this.createAddStrictMaxBeanInstancePoolOperation(poolName, maxPoolSize, timeout, unit));
private void parseSessionBean(final XMLExtendedStreamReader reader, final List<ModelNode> operations, ModelNode ejb3SubsystemAddOperation) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case STATELESS: { this.parseStatelessBean(reader, operations, ejb3SubsystemAddOperation); break; } default: { throw unexpectedElement(reader); } } } }
private void parseBeanInstancePools(final XMLExtendedStreamReader reader, List<ModelNode> operations) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case STRICT_MAX_POOL: { this.parseStrictMaxPool(reader, operations); break; } default: { throw unexpectedElement(reader); } } } }
operations.add(this.createAddStrictMaxBeanInstancePoolOperation(poolName, maxPoolSize, timeout, unit));
case MDB: { this.parseMDB(reader, operations, ejb3SubsystemAddOperation); break; this.parsePools(reader, operations); break; this.parseSessionBean(reader, operations, ejb3SubsystemAddOperation); break; parseTimerService(reader, operations); break;
private void parsePools(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException { // no attributes expected requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { switch (EJB3SubsystemXMLElement.forName(reader.getLocalName())) { case BEAN_INSTANCE_POOLS: { this.parseBeanInstancePools(reader, operations); break; } default: { throw unexpectedElement(reader); } } } }
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; }