1 23 24 package com.sun.enterprise.config.serverbeans.validation.tests; 25 26 27 import com.sun.enterprise.config.ConfigContextEvent; 28 import com.sun.enterprise.config.ConfigException; 29 import com.sun.enterprise.config.serverbeans.LifecycleModule; 30 import com.sun.enterprise.config.serverbeans.ServerBeansFactory; 31 import com.sun.enterprise.config.serverbeans.ServerTags; 32 import com.sun.enterprise.config.serverbeans.validation.Result; 33 import com.sun.enterprise.config.serverbeans.validation.ValidationDescriptor; 34 import com.sun.enterprise.config.serverbeans.validation.GenericValidator; 35 import java.util.Set ; 36 37 43 44 public class LifecycleModuleTest extends GenericValidator { 45 46 public LifecycleModuleTest(ValidationDescriptor desc) { 47 super(desc); 48 } 49 50 public Result validate(final ConfigContextEvent cce) { 51 final Result result = super.validate(cce); if(cce.getChoice().equals(StaticTest.UPDATE) || cce.getChoice().equals(StaticTest.VALIDATE)) { 53 validateAttribute(cce.getName(), (String ) cce.getObject(), result); 54 } 55 return result; 56 } 57 58 private void validateAttribute(String name, String value, Result result) { 59 if(value == null || value.equals("")) 60 return; 61 if(name.equals(ServerTags.CLASSPATH)) { 62 if(!StaticTest.isClassPathValid(value)) { 63 result.failed(smh.getLocalString(getClass().getName() + ".invalidClasspath", 64 "Classpath contains invalid path : Check the path")); 65 } 66 } 67 } 68 } 69 | Popular Tags |