/** * Return the value of the "lookup" element of the @Resource annotation. * This method handles the case where the Resource class is an older * version before the lookup element was added; in that case access to * the lookup element will cause a NoSuchMethodError, which is caught * and ignored (with a warning message). * * @return the value of the lookup element */ private String getResourceLookupValue(Resource annotation, AnnotationInfo ainfo) { String lookupValue = ""; try { lookupValue = annotation.lookup(); } catch(NoSuchMethodError nsme) { // Probably means lib endorsed dir is not set and an older version // of Resource is being picked up from JDK. // Don't treat this as a fatal error. try { log(Level.WARNING, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.wrongresourceclass", "Incorrect @Resource annotation class definition - " + "missing lookup attribute")); } catch (AnnotationProcessorException ex) { } } return lookupValue; } }
/** * Return the value of the "lookup" element of the @Resource annotation. * This method handles the case where the Resource class is an older * version before the lookup element was added; in that case access to * the lookup element will cause a NoSuchMethodError, which is caught * and ignored (with a warning message). * * @return the value of the lookup element */ private String getResourceLookupValue(Resource annotation, AnnotationInfo ainfo) { String lookupValue = ""; try { lookupValue = annotation.lookup(); } catch(NoSuchMethodError nsme) { // Probably means lib endorsed dir is not set and an older version // of Resource is being picked up from JDK. // Don't treat this as a fatal error. try { log(Level.WARNING, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.wrongresourceclass", "Incorrect @Resource annotation class definition - " + "missing lookup attribute")); } catch (AnnotationProcessorException ex) { } } return lookupValue; } }
resourceAn.type() == Object.class) { Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidtypelevelresource", default: // should never happen Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidauthenticationtype",
resourceAn.type() == Object.class) { Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidtypelevelresource", default: // should never happen Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidauthenticationtype",