return getMessageDestinationReferenceDescriptors( logicalName, rcContexts); } else if (resourceType == javax.sql.DataSource.class || resourceType.getName().equals("javax.jms.XAQueueConnectionFactory") || resourceType.getName().equals("javax.jms.XATopicConnectionFactory") ) { return getResourceReferenceDescriptors(logicalName, rcContexts); } else if (envEntryTypes.containsKey(resourceType) || resourceType.isEnum()) { return getEnvironmentPropertyDescriptors(logicalName, rcContexts, resourceAn); } else { return getJmsDestinationReferenceDescriptors(logicalName, rcContexts);
/** * This entry point is used both for a single @Resource and iteratively * from a compound @Resources processor. */ protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { Resource resourceAn = (Resource)ainfo.getAnnotation(); return processResource(ainfo, rcContexts, resourceAn); }
return getMessageDestinationReferenceDescriptors( logicalName, rcContexts); } else if (envEntryTypes.containsKey(resourceType) || resourceType.isEnum()) { return getEnvironmentPropertyDescriptors(logicalName, rcContexts, resourceAn); } else if (resourceType == javax.sql.DataSource.class || resourceType.getName().equals("javax.jms.XATopicConnectionFactory") || DOLUtils.isRAConnectionFactory(habitat, resourceType.getName(), ((ResourceContainerContextImpl)rcContexts[0]).getAppFromDescriptor()) ) { return getResourceReferenceDescriptors(logicalName, rcContexts); } else { return getResourceEnvReferenceDescriptors(logicalName, rcContexts);
validateInjectionMethod(m, ainfo); String propertyName = getInjectionMethodPropertyName(m, ainfo); resourceAn.type() == Object.class) { Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidtypelevelresource", "specify both name() and type().", new Object[] { resourceAn.name(), resourceAn.type(), c })); return getDefaultFailedResult(); return getDefaultFailedResult(); getDescriptors(resourceType, logicalName, rcContexts, resourceAn); ok(getResourceLookupValue(resourceAn, ainfo))) desc.setLookupName(getResourceLookupValue(resourceAn, ainfo)); if (!ok(desc.getMappedName()) && ok(resourceAn.mappedName())) desc.setMappedName(resourceAn.mappedName()); default: // should never happen Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidauthenticationtype",
/** * 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; } }
validateInjectionMethod(m, ainfo); String propertyName = getInjectionMethodPropertyName(m, ainfo); resourceAn.type() == Object.class) { Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidtypelevelresource", "specify both name() and type().", new Object[] { resourceAn.name(), resourceAn.type(), c })); return getDefaultFailedResult(); return getDefaultFailedResult(); getDescriptors(resourceType, logicalName, rcContexts, resourceAn); ok(getResourceLookupValue(resourceAn, ainfo))) desc.setLookupName(getResourceLookupValue(resourceAn, ainfo)); if (!ok(desc.getMappedName()) && ok(resourceAn.mappedName())) desc.setMappedName(resourceAn.mappedName()); default: // should never happen Class c = (Class) ainfo.getAnnotatedElement(); log(Level.SEVERE, ainfo, localStrings.getLocalString( "enterprise.deployment.annotation.handlers.invalidauthenticationtype",
/** * 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; } }
/** * This entry point is used both for a single @Resource and iteratively * from a compound @Resources processor. */ protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { Resource resourceAn = (Resource)ainfo.getAnnotation(); return processResource(ainfo, rcContexts, resourceAn); }