use of javax.ejb.TimedObject in project wildfly by wildfly.
the class TimerMethodMergingProcessor method handleDeploymentDescriptor.
@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException {
final EnterpriseBeanMetaData descriptorData = description.getDescriptorData();
if (descriptorData != null && (description.isSession() || description.isMessageDriven())) {
assert descriptorData instanceof ITimeoutTarget : descriptorData + " is not an ITimeoutTarget";
ITimeoutTarget target = (ITimeoutTarget) descriptorData;
if (target.getTimeoutMethod() != null) {
parseTimeoutMethod(target, description, componentClass, deploymentReflectionIndex);
}
parseScheduleMethods(descriptorData, description, componentClass, deploymentReflectionIndex);
}
// or the method specified in the deployment descriptor
if (TimedObject.class.isAssignableFrom(componentClass)) {
Class<?> c = componentClass;
while (c != null && c != Object.class) {
final ClassReflectionIndex index = deploymentReflectionIndex.getClassIndex(c);
// TimedObject takes precedence
Method method = index.getMethod(Void.TYPE, "ejbTimeout", javax.ejb.Timer.class);
if (method != null) {
final Method otherMethod = description.getTimeoutMethod();
if (otherMethod != null && !otherMethod.equals(method)) {
throw EjbLogger.ROOT_LOGGER.invalidEjbEntityTimeout("3.1 18.2.5.3", componentClass);
}
description.setTimeoutMethod(method);
break;
}
c = c.getSuperclass();
}
}
}
Aggregations