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

DeployableAppTest

public abstract class DeployableAppTest extends com.sun.enterprise.config.serverbeans.validation.GenericValidator
Instances of this class represent applications taht can be deployed. They provide a deeper validation by supplying the ability to validate their object type attribute - updates and deletions are only allowed if this attribute has the value 'user'

Fields Summary
Constructors Summary
DeployableAppTest(com.sun.enterprise.config.serverbeans.validation.ValidationDescriptor desc)

        super(desc);
    
Methods Summary
private com.sun.enterprise.config.ConfigBeangetApp(com.sun.enterprise.config.ConfigContextEvent cce)

        return (ConfigBean) cce.getValidationTarget();
    
protected abstract java.lang.StringgetObjectType(com.sun.enterprise.config.ConfigBean app)
Return the object type given the config bean of the deployable app.

param
app the application whose object type we want
return
the value of the object-type attribute

private java.lang.StringgetObjectType(com.sun.enterprise.config.ConfigContextEvent cce)
Return the object type from the receiver's class object.

        return getObjectType(getApp(cce));
    
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
        try{
            if(cce.getChoice().equals(StaticTest.UPDATE) || cce.getChoice().equals(StaticTest.DELETE)) { 
            
                if(!getObjectType(cce).equals("user"))
                    result.failed(smh.getLocalString(getClass().getName()+".systemAppNotChangeable",
                                                     "System Application, Attribute Not Changeable"));
            }
        }
        catch (final ConfigException ce){
            _logger.log(Level.WARNING, "domainxmlverifier.exception", ce);
        }
        return result;