Methods Summary |
---|
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResult | getDefaultFailedResult()
return HandlerProcessingResultImpl.getDefaultResult(
getAnnotationType(), ResultType.FAILED);
|
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResult | getDefaultProcessedResult()
return HandlerProcessingResultImpl.getDefaultResult(
getAnnotationType(), ResultType.PROCESSED);
|
protected java.lang.Class[] | getEjbAnnotationTypes()This is called by getTypeDependencies().
return new Class[] {
MessageDriven.class, Stateful.class, Stateless.class };
|
protected java.lang.String | getInjectionMethodPropertyName(java.lang.reflect.Method method, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)
String methodName = method.getName();
String propertyName = methodName;
if( (methodName.length() > 3) &&
methodName.startsWith("set") ) {
// Derive javabean property name.
propertyName =
methodName.substring(3, 4).toLowerCase() +
methodName.substring(4);
} else {
throw new AnnotationProcessorException(
localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.invalidinjectionmethodname",
"Injection method name must start with \"set\""),
ainfo);
}
return propertyName;
|
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResult | getInvalidAnnotatedElementHandlerResult(com.sun.enterprise.deployment.annotation.AnnotatedElementHandler aeHandler, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)
if (logger.isLoggable(Level.FINE)) {
log(Level.FINE, ainfo,
localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.invalidaehandler",
"Invalid annotation symbol found for this type of class."));
}
if (logger.isLoggable(Level.FINER)) {
logger.finer("Invalid AnnotatedElementHandler: " + aeHandler);
}
return getDefaultProcessedResult();
|
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResult | getOverallProcessingResult(java.util.List resultList)
HandlerProcessingResult overallProcessingResult = null;
for (HandlerProcessingResult result : resultList) {
if (overallProcessingResult == null ||
(result.getOverallResult().compareTo(
overallProcessingResult.getOverallResult()) > 0)) {
overallProcessingResult = result;
}
}
return overallProcessingResult;
|
public java.lang.Class[] | getTypeDependencies()
return null;
|
protected void | log(java.util.logging.Level level, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, java.lang.String localizedMessage)
if (Level.SEVERE.equals(level)) {
ainfo.getProcessingContext().getErrorHandler().error(
new AnnotationProcessorException(localizedMessage, ainfo));
} else if (Level.WARNING.equals(level)) {
ainfo.getProcessingContext().getErrorHandler().warning(
new AnnotationProcessorException(localizedMessage, ainfo));
} else if (Level.FINE.equals(level)) {
ainfo.getProcessingContext().getErrorHandler().fine(
new AnnotationProcessorException(localizedMessage, ainfo));
} else if (ainfo != null) {
ainfo.getProcessingContext().getProcessor().log(
level, ainfo, localizedMessage);
} else {
logger.log(level, localizedMessage);
}
|
protected void | validateInjectionMethod(java.lang.reflect.Method method, com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)Check if given method is a valid injection method.
Throw Exception if it is not.
if (method.getParameterTypes().length!=1){
throw new AnnotationProcessorException(
localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.invalidinjectionmethod",
"Injection on a method requires a JavaBeans setter method type with one parameter "),
ainfo);
}
if (!void.class.equals(method.getReturnType())) {
throw new AnnotationProcessorException(
localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.injectionmethodmustreturnvoid",
"Injection on a method requires a void return type"),
ainfo);
}
|