protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException { return getInvalidAnnotatedElementHandlerResult( ainfo.getProcessingContext().getHandler(), ainfo); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException { return getInvalidAnnotatedElementHandlerResult( ainfo.getProcessingContext().getHandler(), ainfo); }
@Override protected HandlerProcessingResult processAnnotation( AnnotationInfo ainfo, WebBundleContext webBundleContext) throws AnnotationProcessorException { return getInvalidAnnotatedElementHandlerResult( ainfo.getProcessingContext().getHandler(), ainfo); }
public void processAnnotation(AnnotationInfo element, ConnectionDefinition defn) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); handleAnnotation(aeHandler, defn, element); }
private HandlerProcessingResult processParameters(ProcessingContext ctx, Annotation[][] parametersAnnotations) throws AnnotationProcessorException { HandlerProcessingResultImpl result = new HandlerProcessingResultImpl(); // process the method parameters... for (Annotation[] parameterAnnotations : parametersAnnotations) { logStart(ctx.getHandler(), ElementType.PARAMETER, null); if (parameterAnnotations!=null) { for (Annotation annotation : parameterAnnotations) { AnnotationInfo info = new AnnotationInfo(ctx, null, annotation, ElementType.PARAMETER); process(ctx, info, result); dumpProcessingResult(result); } } logEnd(ctx.getHandler(), ElementType.PARAMETER, null); } return result; }
private HandlerProcessingResult processParameters(ProcessingContext ctx, Annotation[][] parametersAnnotations) throws AnnotationProcessorException { HandlerProcessingResultImpl result = new HandlerProcessingResultImpl(); // process the method parameters... for (Annotation[] parameterAnnotations : parametersAnnotations) { logStart(ctx.getHandler(), ElementType.PARAMETER, null); if (parameterAnnotations!=null) { for (Annotation annotation : parameterAnnotations) { AnnotationInfo info = new AnnotationInfo(ctx, null, annotation, ElementType.PARAMETER); process(ctx, info, result); dumpProcessingResult(result); } } logEnd(ctx.getHandler(), ElementType.PARAMETER, null); } return result; }
private HandlerProcessingResult processAnnotations(ProcessingContext ctx, ElementType type, AnnotatedElement element) throws AnnotationProcessorException { AnnotatedElementHandler handler = ctx.getHandler(); logStart(handler, type, element); HandlerProcessingResult result = processAnnotations(ctx, element); logEnd(handler, type, element); dumpProcessingResult(result); return result; }
private HandlerProcessingResult processAnnotations(ProcessingContext ctx, ElementType type, AnnotatedElement element) throws AnnotationProcessorException { AnnotatedElementHandler handler = ctx.getHandler(); logStart(handler, type, element); HandlerProcessingResult result = processAnnotations(ctx, element); logEnd(handler, type, element); dumpProcessingResult(result); return result; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class)annInfo.getAnnotatedElement()).isInterface() && ( (annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { //continue, processing } return riDeployment; } }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler(); PreDestroy preDestroyAn = (PreDestroy)ainfo.getAnnotation(); Method annMethod = (Method)ainfo.getAnnotatedElement(); String pdMethodName = annMethod.getName(); String pdClassName = annMethod.getDeclaringClass().getName(); for (ResourceContainerContext rcContext : rcContexts) { LifecycleCallbackDescriptor preDestroyDesc = new LifecycleCallbackDescriptor(); preDestroyDesc.setLifecycleCallbackClass(pdClassName); preDestroyDesc.setLifecycleCallbackMethod(pdMethodName); preDestroyDesc.setMetadataSource(MetadataSource.ANNOTATION); // override by xml is handled in addPreDestroyDescriptor rcContext.addPreDestroyDescriptor(preDestroyDesc); } return getDefaultProcessedResult(); } }
public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); ConnectionDefinition connDefn = (ConnectionDefinition) element.getAnnotation(); if (aeHandler instanceof RarBundleContext) { handleAnnotation(aeHandler, connDefn, element); } else { getFailureResult(element, "not a rar bundle context", true); } return getDefaultProcessedResult(); }
public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); AdministeredObject adminObject = (AdministeredObject) element.getAnnotation();
public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); ConfigProperty configProperty = (ConfigProperty) element.getAnnotation(); if (aeHandler instanceof RarBundleContext) { RarBundleContext rbc = (RarBundleContext) aeHandler; ConnectorDescriptor desc = rbc.getDescriptor(); handleConfigPropertyAnnotation(configProperty, element, desc); } else { return getFailureResult(element, "not a rar bundle context", true); } return getDefaultProcessedResult(); }
public HandlerProcessingResult processAnnotation (AnnotationInfo ainfo) throws AnnotationProcessorException { AnnotatedElement ae = ainfo.getAnnotatedElement(); Annotation annotation = ainfo.getAnnotation(); AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler(); if (aeHandler instanceof EjbBundleContext) { EjbBundleContext ejbBundleContext = (EjbBundleContext)aeHandler; EjbBundleDescriptor ejbBundle = ejbBundleContext.getDescriptor(); ApplicationException appExcAnn = (ApplicationException) annotation; EjbApplicationExceptionInfo appExcInfo = new EjbApplicationExceptionInfo(); Class annotatedClass = (Class) ae; appExcInfo.setExceptionClassName(annotatedClass.getName()); appExcInfo.setRollback(appExcAnn.rollback()); appExcInfo.setInherited(appExcAnn.inherited()); // Set on descriptor unless the same application exception was defined // in ejb-jar.xml if( !ejbBundle.getApplicationExceptions().containsKey(annotatedClass.getName()) ) { ejbBundle.addApplicationException(appExcInfo); } } return getDefaultProcessedResult(); }
public HandlerProcessingResult processAnnotation (AnnotationInfo ainfo) throws AnnotationProcessorException { AnnotatedElement ae = ainfo.getAnnotatedElement(); Annotation annotation = ainfo.getAnnotation(); AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler(); if (aeHandler instanceof EjbBundleContext) { EjbBundleContext ejbBundleContext = (EjbBundleContext)aeHandler; EjbBundleDescriptorImpl ejbBundle = (EjbBundleDescriptorImpl) ejbBundleContext.getDescriptor(); ApplicationException appExcAnn = (ApplicationException) annotation; EjbApplicationExceptionInfo appExcInfo = new EjbApplicationExceptionInfo(); Class annotatedClass = (Class) ae; appExcInfo.setExceptionClassName(annotatedClass.getName()); appExcInfo.setRollback(appExcAnn.rollback()); appExcInfo.setInherited(appExcAnn.inherited()); // Set on descriptor unless the same application exception was defined // in ejb-jar.xml if( !ejbBundle.getApplicationExceptions().containsKey(annotatedClass.getName()) ) { ejbBundle.addApplicationException(appExcInfo); } } return getDefaultProcessedResult(); }
/** * 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. * * @param ainfo the annotation information * @param rcContexts an array of ResourceContainerContext * @return HandlerProcessingResult */ protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler(); if (aeHandler instanceof AppClientContext) { // application client does not support @PersistenceContext String msg = localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidaehandler", "Invalid annotation symbol found for this type of class."); log(Level.WARNING, ainfo, msg); return getDefaultProcessedResult(); } PersistenceContext emRefAn = (PersistenceContext)ainfo.getAnnotation(); return processEmRef(ainfo, rcContexts, emRefAn); }
public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); ConnectionDefinitions connDefns = (ConnectionDefinitions) element.getAnnotation(); if (aeHandler instanceof RarBundleContext) { //TODO V3 what if there is @ConnectionDefiniton as well @ConnectionDefinitions specified on same class ? //TODO V3 should we detect & avoid duplicates here ? ConnectionDefinition[] definitions = connDefns.value(); if (definitions != null) { for (ConnectionDefinition defn : definitions) { ConnectionDefinitionHandler cdh = new ConnectionDefinitionHandler(); cdh.processAnnotation(element, defn); } } } else { getFailureResult(element, "not a rar bundle context", true); } return getDefaultProcessedResult(); }