public HandlerProcessingResult processAnnotation(AnnotationInfo annInfo)
throws AnnotationProcessorException
{
AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler();
AnnotatedElement annElem = annInfo.getAnnotatedElement();
boolean ejbInWar = ignoreWebserviceAnnotations(annElem, annCtx);
//Bug http://monaco.sfbay/detail.jsf?cr=6956406
//When there is an ejb webservice packaged in a war
//ignore the annotation processing for WebBundleDescriptor
//In Ejb webservice in a war there are 2 bundle descriptors
//so we should just allow the processing for the EjbBundleDescriptor
//and add webservices to that BundleDescriptor
if (ejbInWar) {
return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(), ResultType.PROCESSED);
}
// sanity check
if (!(annElem instanceof Class)) {
AnnotationProcessorException ape = new AnnotationProcessorException(
"@WebServiceProvider can only be specified on TYPE", annInfo);
annInfo.getProcessingContext().getErrorHandler().error(ape);
return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(), ResultType.FAILED);
}
if(isJaxwsRIDeployment(annInfo)) {
// Looks like JAX-WS RI specific deployment, do not process Web Service annotations otherwise would end up as two web service endpoints
logger.info(format(rb.getString("enterprise.webservice.deployment.disabled"),
annInfo.getProcessingContext().getArchive().getName(),"WEB-INF/sun-jaxws.xml"));
return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(), ResultType.PROCESSED);
}
// WebServiceProvider MUST implement the provider interface, let's check this
if (!javax.xml.ws.Provider.class.isAssignableFrom((Class) annElem)) {
AnnotationProcessorException ape = new AnnotationProcessorException(
annElem.toString() + "does not implement the javax.xml.ws.Provider interface", annInfo);
annInfo.getProcessingContext().getErrorHandler().error(ape);
return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(), ResultType.FAILED);
}
// let's get the main annotation of interest.