1 23 24 25 package com.sun.enterprise.tools.verifier.tests.ejb.timer; 26 27 import com.sun.enterprise.deployment.EjbDescriptor; 28 import com.sun.enterprise.deployment.EjbEntityDescriptor; 29 import com.sun.enterprise.deployment.EjbSessionDescriptor; 30 import com.sun.enterprise.tools.verifier.Result; 31 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 32 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 33 34 40 public class ImplementsTimedObjectTest extends EjbTest { 41 42 ComponentNameConstructor compName = null; 43 50 public Result check(EjbDescriptor descriptor) { 51 Result result = getInitializedResult(); 52 ComponentNameConstructor compName = 53 getVerifierContext().getComponentNameConstructor(); 54 boolean isEjb30 = descriptor.getEjbBundleDescriptor().getSpecVersion().equalsIgnoreCase("3.0"); 55 if(descriptor.isTimedObject()) { 56 if(((descriptor instanceof EjbEntityDescriptor) && isEjb30) 59 || ( (descriptor instanceof EjbSessionDescriptor) && 60 ((((EjbSessionDescriptor)descriptor).getSessionType()).equals 61 (EjbSessionDescriptor.STATEFUL)) )) { 62 addErrorDetails(result, compName); 63 result.failed(smh.getLocalString(getClass().getName()+ 64 ".failed1", "[ {0} ] must not implement the TimedObject interface." + 65 "Only 2.1 entity beans or stateless session beans may " + 66 "implement the TimedObject interface" , 67 new Object [] {descriptor.getEjbClassName()})); 68 } 69 } 70 if(result.getStatus() != Result.FAILED) { 71 addGoodDetails(result, compName); 72 result.passed(smh.getLocalString (getClass().getName()+".passed", 73 "[ {0} ] properly implements the TimedObject interface", 74 new Object [] {descriptor.getEjbClassName()})); 75 76 } 77 return result; 78 } 79 } 80 | Popular Tags |