// super-class and can be public, protected, private, or
// package access. There can be at most one timeout method for
// the entire bean class hierarchy, so we start from the bean
// class and go up, stopping when we find the first one.
MethodDescriptor timeoutMethodDesc = null;
Class nextClass = ejbClass;
while((nextClass != Object.class) && (nextClass != null)
&& (timeoutMethodDesc == null) ) {
Method[] methods = nextClass.getDeclaredMethods();
for(Method m : methods) {
if( (m.getAnnotation(Timeout.class) != null) ) {
timeoutMethodDesc =
new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
break;
}
}
nextClass = nextClass.getSuperclass();
}
if( (timeoutMethodDesc == null) &&
javax.ejb.TimedObject.class.isAssignableFrom(ejbClass) ) {
// If the class implements the TimedObject interface, it must
// be ejbTimeout.
timeoutMethodDesc = new MethodDescriptor
("ejbTimeout", "@Timeout method",
new String[] { "javax.ejb.Timer" },
MethodDescriptor.EJB_BEAN);
}