@Override public void handleRollback(OperationContext context, ModelNode operation) { pool.setMaxSize(oldSize); } });
protected void executeWriteAttribute(String attributeName, OperationContext context, ModelNode operation, T component, PathAddress address) throws OperationFailedException { if (componentType.hasPool() && POOL_MAX_SIZE.getName().equals(attributeName)) { int newSize = POOL_MAX_SIZE.resolveValue(context, operation.get(VALUE)).asInt(); final Pool<?> pool = componentType.getPool(component); final int oldSize = pool.getMaxSize(); componentType.getPool(component).setMaxSize(newSize); context.completeStep(new OperationContext.RollbackHandler() { @Override public void handleRollback(OperationContext context, ModelNode operation) { pool.setMaxSize(oldSize); } }); } else { // Bug; we were registered for an attribute but there is no code for handling it throw EjbLogger.ROOT_LOGGER.unknownAttribute(attributeName); } }
@Override public void handleRollback(OperationContext context, ModelNode operation) { pool.setMaxSize(oldSize); } });
protected void executeWriteAttribute(String attributeName, OperationContext context, ModelNode operation, T component, PathAddress address) throws OperationFailedException { if (componentType.hasPool() && POOL_MAX_SIZE.getName().equals(attributeName)) { int newSize = POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt(); final Pool<?> pool = componentType.getPool(component); final int oldSize = pool.getMaxSize(); componentType.getPool(component).setMaxSize(newSize); context.completeStep(new OperationContext.RollbackHandler() { @Override public void handleRollback(OperationContext context, ModelNode operation) { pool.setMaxSize(oldSize); } }); } else { // Bug; we were registered for an attribute but there is no code for handling it throw MESSAGES.unknownAttribute(attributeName); } }