Checks if the EJB class implements the TimedObject interface
Result result = getInitializedResult();
ComponentNameConstructor compName =
getVerifierContext().getComponentNameConstructor();
boolean isEjb30 = descriptor.getEjbBundleDescriptor().getSpecVersion().equalsIgnoreCase("3.0");
if(descriptor.isTimedObject()) {
//Timers can be created for stateless session beans, message-driven beans,
//and 2.1 entity beans.Timers cannot be created for stateful session beans or EJB 3.0 entities.
if(((descriptor instanceof EjbEntityDescriptor) && isEjb30)
|| ( (descriptor instanceof EjbSessionDescriptor) &&
((((EjbSessionDescriptor)descriptor).getSessionType()).equals
(EjbSessionDescriptor.STATEFUL)) )) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName()+
".failed1", "[ {0} ] must not implement the TimedObject interface." +
"Only 2.1 entity beans or stateless session beans may " +
"implement the TimedObject interface" ,
new Object[] {descriptor.getEjbClassName()}));
}
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString (getClass().getName()+".passed",
"[ {0} ] properly implements the TimedObject interface",
new Object[] {descriptor.getEjbClassName()}));
}
return result;