FileDocCategorySizeDatePackage
ConnectorConnectionPoolTest.javaAPI DocGlassfish v2 API4665Fri May 04 22:24:38 BST 2007com.sun.enterprise.config.serverbeans.validation.tests

ConnectorConnectionPoolTest

public class ConnectorConnectionPoolTest extends com.sun.enterprise.config.serverbeans.validation.GenericValidator
Custom Test for Connector Connection Pool Test which calls the Generic Validation before performing custom tests
author
Srinivas Krishnan
version
2.0

Fields Summary
int
maxPoolSize
Constructors Summary
public ConnectorConnectionPoolTest(com.sun.enterprise.config.serverbeans.validation.ValidationDescriptor desc)

    
       
        super(desc);
    
Methods Summary
private final com.sun.enterprise.config.serverbeans.ConnectorConnectionPoolgetConnectorConnectionPool(com.sun.enterprise.config.ConfigContextEvent cce)

        return (ConnectorConnectionPool) cce.getValidationTarget();
    
public com.sun.enterprise.config.serverbeans.validation.Resultvalidate(com.sun.enterprise.config.ConfigContextEvent cce)

        Result result = super.validate(cce); // Before doing custom validation do basic validation
        String choice = cce.getChoice();

        if(choice.equals(StaticTest.UPDATE)) {
            validateAttribute(cce.getName(), (String) cce.getObject(), result);
        }
        return result;
    
public voidvalidateAttribute(java.lang.String name, java.lang.String value, com.sun.enterprise.config.serverbeans.validation.Result result)

        if(value == null || value.equals("")) 
            return;
        if(name.equals(ServerTags.CONNECTION_DEFINITION_NAME)) {
        }
    
public voidvalidateAttribute(java.lang.String name, java.lang.String value, java.lang.String rarName, com.sun.enterprise.config.serverbeans.validation.Result result)

        try {
            String connDefnNames[] = ConnectorRuntime.getRuntime().getConnectionDefinitionNames(rarName);
            boolean available = false;
            for(int i=0;i<connDefnNames.length;i++) {
                if(value.equals(connDefnNames[i])) {
                    available = true;
                    break;
                }
            }
            if(!available)
                    result.failed(smh.getLocalString(getClass().getName() + ".connDefnNotAvl", 
                        "Attribute(conndefn={0}) : Invalid Connection Definition Name", new Object[]{value}));
        } catch(Exception e) {
            _logger.log(Level.FINE, "domainxmlverifier.exception", e);     
        }