use of org.glassfish.apf.HandlerProcessingResult in project Payara by payara.
the class EntityManagerFactoryReferencesHandler method processAnnotation.
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException {
PersistenceUnits annotation = (PersistenceUnits) ainfo.getAnnotation();
PersistenceUnit[] emfRefAnnotations = annotation.value();
List<HandlerProcessingResult> results = new ArrayList<>();
for (PersistenceUnit emfRef : emfRefAnnotations) {
results.add(processEmfRef(ainfo, rcContexts, emfRef));
}
return getOverallProcessingResult(results);
}
use of org.glassfish.apf.HandlerProcessingResult in project Payara by payara.
the class EntityManagerReferencesHandler method processAnnotation.
@Override
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException {
PersistenceContexts annotation = (PersistenceContexts) ainfo.getAnnotation();
PersistenceContext[] emRefAnnotations = annotation.value();
List<HandlerProcessingResult> results = new ArrayList<>();
for (PersistenceContext emRef : emRefAnnotations) {
results.add(processEmRef(ainfo, rcContexts, emRef));
}
return getOverallProcessingResult(results);
}
use of org.glassfish.apf.HandlerProcessingResult in project Payara by payara.
the class ResourcesHandler method processAnnotation.
/**
* This entry point is used both for a single @EJB and iteratively
* from a compound @EJBs processor.
*/
@Override
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException {
Resources resourcesAn = (Resources) ainfo.getAnnotation();
Resource[] resourceAns = resourcesAn.value();
List<HandlerProcessingResult> results = new ArrayList<>();
for (Resource res : resourceAns) {
results.add(processResource(ainfo, rcContexts, res));
}
return getOverallProcessingResult(results);
}
use of org.glassfish.apf.HandlerProcessingResult in project Payara by payara.
the class AbstractWebHandler method processAnnotation.
/**
* Process a particular annotation which type is the same as the
* one returned by @see getAnnotationType(). All information
* pertinent to the annotation and its context is encapsulated
* in the passed AnnotationInfo instance.
* This is a method in interface AnnotationHandler.
*
* @param ainfo the annotation information
*/
@Override
public HandlerProcessingResult processAnnotation(AnnotationInfo ainfo) throws AnnotationProcessorException {
AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler();
if (aeHandler instanceof WebBundleContext) {
WebBundleContext webBundleContext = (WebBundleContext) aeHandler;
AnnotatedElementHandler aeh = webBundleContext.createContextForWeb();
if (aeh != null) {
aeHandler = aeh;
}
}
// no inheritance
HandlerProcessingResult procResult = null;
if (aeHandler instanceof WebComponentContext) {
procResult = processAnnotation(ainfo, new WebComponentContext[] { (WebComponentContext) aeHandler });
} else if (aeHandler instanceof WebComponentsContext) {
WebComponentsContext webCompsContext = (WebComponentsContext) aeHandler;
procResult = processAnnotation(ainfo, webCompsContext.getWebComponentContexts());
} else if (aeHandler instanceof WebBundleContext) {
WebBundleContext webBundleContext = (WebBundleContext) aeHandler;
procResult = processAnnotation(ainfo, webBundleContext);
} else {
return getInvalidAnnotatedElementHandlerResult(aeHandler, ainfo);
}
return procResult;
}
use of org.glassfish.apf.HandlerProcessingResult in project Payara by payara.
the class WebServiceRefsHandler method processAnnotation.
public HandlerProcessingResult processAnnotation(AnnotationInfo ainfo) throws AnnotationProcessorException {
WebServiceRefs wsRefsAnnotation = (WebServiceRefs) ainfo.getAnnotation();
WebServiceRef[] wsRefAnnotations = wsRefsAnnotation.value();
List<HandlerProcessingResult> results = new ArrayList<HandlerProcessingResult>();
for (WebServiceRef wsRef : wsRefAnnotations) {
results.add(processAWsRef(ainfo, wsRef));
}
HandlerProcessingResult finalResult = null;
for (HandlerProcessingResult result : results) {
if (finalResult == null || (result.getOverallResult().compareTo(finalResult.getOverallResult()) > 0)) {
finalResult = result;
}
}
return finalResult;
}
Aggregations