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); }
/** * 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 void log(Level level, AnnotationInfo ainfo, String localizedMessage) throws AnnotationProcessorException { 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 log(Level level, AnnotationInfo ainfo, String localizedMessage) throws AnnotationProcessorException { 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 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(); AdministeredObject adminObject = (AdministeredObject) element.getAnnotation();
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(); 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 annInfo) throws AnnotationProcessorException { AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); AnnotatedElement annElem = annInfo.getAnnotatedElement(); Class declaringClass;
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(); }
public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException { AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler(); AuthenticationMechanism authMechanism = (AuthenticationMechanism) element.getAnnotation();