示例#1
0
 @Override
 public void updateModel(
     OperationContext context,
     ModelNode model,
     AttributeDefinition attributeDefinition,
     ModelNode attribute)
     throws OperationFailedException {
   if (attribute.getType() != ModelType.LIST
       && attributeDefinition.getType() != ModelType.LIST) {
     throw ControllerLogger.MGMT_OP_LOGGER.attributeIsWrongType(
         attributeDefinition.getName(), ModelType.LIST, attributeDefinition.getType());
   }
   updateModel(context, model, attribute);
 }
 @Override
 public void execute(OperationContext context, ModelNode operation)
     throws OperationFailedException {
   String targetAttributeName = JDBCStoreResourceDefinition.Attribute.DATA_SOURCE.getName();
   if (!operation.hasDefined(targetAttributeName)) {
     ModelNode jndiName =
         JDBCStoreResourceDefinition.DeprecatedAttribute.DATASOURCE.resolveModelAttribute(
             context, operation);
     if (jndiName.isDefined()) {
       // Translate JNDI name into pool name
       String poolName = findPoolName(context, jndiName.asString());
       operation.get(targetAttributeName).set(poolName);
     } else {
       throw ControllerLogger.MGMT_OP_LOGGER.validationFailedRequiredParameterNotPresent(
           JDBCStoreResourceDefinition.Attribute.DATA_SOURCE.getDefinition().getName(),
           operation.toString());
     }
   }
 }