public void startElement(ElementType type, AnnotatedElement element) throws AnnotationProcessorException { getProcessingContext().pushHandler(this); }
public void startElement(ElementType type, AnnotatedElement element) throws AnnotationProcessorException { getProcessingContext().pushHandler(this); }
new EjbInterceptorContext(interceptor); ProcessingContext procContext = ainfo.getProcessingContext(); procContext.pushHandler(ejbInterceptorContext); procContext.getProcessor().process( procContext, new Class[] { interceptorClass });
new EjbInterceptorContext(interceptor); ProcessingContext procContext = ainfo.getProcessingContext(); procContext.pushHandler(ejbInterceptorContext); procContext.getProcessor().process( procContext, new Class[] { interceptorClass });
/** * This methods create a context for EjbInterceptor associated to * given className. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForEjbInterceptor() { Class interceptorClass = (Class)this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); EjbInterceptor ejbInterceptor = this.getDescriptor().getInterceptorByClassName( interceptorClass.getName()); AnnotatedElementHandler aeHandler = null; if (ejbInterceptor != null) { aeHandler = new EjbInterceptorContext(ejbInterceptor); // push a EjbInterceptorContext to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; } }
/** * This methods create a context for EjbInterceptor associated to * given className. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForEjbInterceptor() { Class interceptorClass = (Class)this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); EjbInterceptor ejbInterceptor = this.getDescriptor().getInterceptorByClassName( interceptorClass.getName()); AnnotatedElementHandler aeHandler = null; if (ejbInterceptor != null) { aeHandler = new EjbInterceptorContext(ejbInterceptor); // push a EjbInterceptorContext to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; } }
private InterceptorDescriptor processInterceptor(Class interceptorClass, ManagedBeanContext managedBeanCtx, ProcessingContext procCtx) throws AnnotationProcessorException { InterceptorDescriptor interceptorDesc = new InterceptorDescriptor(); interceptorDesc.setInterceptorClassName(interceptorClass.getName()); // Redirect PostConstruct / PreDestroy methods to InterceptorDescriptor // during annotation processing managedBeanCtx.setInterceptorMode(interceptorDesc); // Process annotations on interceptor procCtx.pushHandler(managedBeanCtx); procCtx.getProcessor().process(procCtx, new Class[] {interceptorClass}); managedBeanCtx.unsetInterceptorMode(); Class nextIntClass = interceptorClass; while(nextIntClass != Object.class) { Method interceptorAroundInvoke = getMethodForMethodAnnotation(nextIntClass, "javax.interceptor.AroundInvoke"); if( (interceptorAroundInvoke != null) && !(methodOverridden(interceptorAroundInvoke, nextIntClass, interceptorClass)) ) { LifecycleCallbackDescriptor desc = new LifecycleCallbackDescriptor(); desc.setLifecycleCallbackClass(nextIntClass.getName()); desc.setLifecycleCallbackMethod(interceptorAroundInvoke.getName()); interceptorDesc.addAroundInvokeDescriptor(desc); } nextIntClass = nextIntClass.getSuperclass(); } return interceptorDesc; }
new ManagedBeanContext(managedBeanDesc); ProcessingContext procContext = element.getProcessingContext(); procContext.pushHandler(managedBeanContext);
new ManagedBeanContext(managedBeanDesc); ProcessingContext procContext = element.getProcessingContext(); procContext.pushHandler(managedBeanContext);
/** * This method create a context for web component(s) by using * descriptor(s) associated to given webComponet impl class. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForWeb() { AnnotatedElement anTypeElement = this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); WebComponentDescriptor[] webComps = null; if (anTypeElement != null) { String implClassName = ((Class)anTypeElement).getName(); webComps = getDescriptor().getWebComponentByImplName(implClassName); } AnnotatedElementHandler aeHandler = null; if (webComps != null && webComps.length > 1) { aeHandler = new WebComponentsContext(webComps); } else if (webComps != null && webComps.length == 1) { aeHandler = new WebComponentContext(webComps[0]); } if (aeHandler != null) { // push a WebComponent(s)Context to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; }
/** * This methods create a context for Ejb(s) by using descriptor(s) * associated to given ejbClassName. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForEjb() { Class ejbClass = (Class)this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); EjbDescriptor[] ejbDescs = null; String ejbClassName = null; if (ejbClass != null) { ejbClassName = ejbClass.getName(); ejbDescs = this.getDescriptor().getEjbByClassName(ejbClassName); } AnnotatedElementHandler aeHandler = null; if (ejbDescs != null && ejbDescs.length > 1) { aeHandler = new EjbsContext(ejbDescs, ejbClass); } else if (ejbDescs != null && ejbDescs.length == 1) { aeHandler = new EjbContext(ejbDescs[0], ejbClass); } if (aeHandler != null) { // push a EjbContext to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; }
/** * This methods create a context for Ejb(s) by using descriptor(s) * associated to given ejbClassName. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForEjb() { Class ejbClass = (Class)this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); EjbDescriptor[] ejbDescs = null; String ejbClassName = null; if (ejbClass != null) { ejbClassName = ejbClass.getName(); ejbDescs = this.getDescriptor().getEjbByClassName(ejbClassName); } AnnotatedElementHandler aeHandler = null; if (ejbDescs != null && ejbDescs.length > 1) { aeHandler = new EjbsContext(ejbDescs, ejbClass); } else if (ejbDescs != null && ejbDescs.length == 1) { aeHandler = new EjbContext(ejbDescs[0], ejbClass); } if (aeHandler != null) { // push a EjbContext to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; }
ProcessingContext ctx = annInfo.getProcessingContext(); ctx.pushHandler(newContext);
/** * This method create a context for web component(s) by using * descriptor(s) associated to given webComponet impl class. * Return null if corresponding descriptor is not found. */ public AnnotatedElementHandler createContextForWeb() { AnnotatedElement anTypeElement = this.getProcessingContext().getProcessor( ).getLastAnnotatedElement(ElementType.TYPE); WebComponentDescriptor[] webComps = null; if (anTypeElement != null) { String implClassName = ((Class)anTypeElement).getName(); webComps = getDescriptor().getWebComponentByImplName(implClassName); } AnnotatedElementHandler aeHandler = null; if (webComps != null && webComps.length > 1) { aeHandler = new WebComponentsContext(webComps); } else if (webComps != null && webComps.length == 1) { aeHandler = new WebComponentContext(webComps[0]); } if (aeHandler != null) { // push a WebComponent(s)Context to stack this.getProcessingContext().pushHandler(aeHandler); } return aeHandler; }
procCtx.pushHandler(managedBeanCtx); procCtx.getProcessor().process(procCtx, new Class[] {interceptorClass});
ctx.getProcessingContext().pushHandler(annContext);
ctx.getProcessingContext().pushHandler(annContext);
@Override protected HandlerProcessingResult processAnnotation( AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException { WebServlet webServletAn = (WebServlet)ainfo.getAnnotation(); Class webCompClass = (Class)ainfo.getAnnotatedElement(); String servletName = webServletAn.name(); if (servletName == null || servletName.length() == 0) { servletName = webCompClass.getName(); } WebComponentDescriptor webCompDesc = webBundleContext.getDescriptor().getWebComponentByCanonicalName(servletName); if (webCompDesc == null) { webCompDesc = new WebComponentDescriptor(); webCompDesc.setName(servletName); webCompDesc.setCanonicalName(servletName); } HandlerProcessingResult result = processAnnotation(ainfo, webCompDesc); if (result.getOverallResult() == ResultType.PROCESSED) { webBundleContext.getDescriptor().addWebComponentDescriptor(webCompDesc); WebComponentContext webCompContext = new WebComponentContext(webCompDesc); // we push the new context on the stack... webBundleContext.getProcessingContext().pushHandler(webCompContext); } return result; }
ctx.pushHandler(aeHandler);
ctx.pushHandler(aeHandler);