/** * hasAnnotation, if class c contains annotation targetClass * * @param c * @param targetClass * @param annotationRepository * @return */ private boolean hasAnnotation(Class c, Class targetClass, AnnotationRepository annotationRepository) { Collection<Annotation> values = annotationRepository.getAnnotation(targetClass); if (values == null) return false; for (Annotation annotation : values) { if (annotation.getClassName() != null && annotation.getClassName().equals(c.getName())) return true; } return false; }
.getAnnotation(javax.resource.spi.ConnectionDefinition.class); if (values != null)
/** * Has a NotNull annotation attached * @param annotationRepository The annotation repository * @param annotation The annotation being checked * @return True of the method/field contains the NotNull annotation; otherwise false */ private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation) { Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class); if (values == null || values.size() == 0) return false; for (Annotation notNullAnnotation : values) { if (notNullAnnotation.getClassName().equals(annotation.getClassName()) && notNullAnnotation.getMemberName().equals(annotation.getMemberName())) return true; } return false; } }
/** * Process: @Activation * @param annotationRepository The annotation repository * @param classLoader The class loader * @param configProperties The config properties * @param plainConfigProperties The plain config properties * @return The updated metadata * @exception Exception Thrown if an error occurs */ private InboundResourceAdapter processActivation(AnnotationRepository annotationRepository, ClassLoader classLoader, ArrayList<ConfigProperty> configProperties, ArrayList<ConfigProperty> plainConfigProperties) throws Exception { ArrayList<MessageListener> listeners = new ArrayList<MessageListener>(); Collection<Annotation> values = annotationRepository.getAnnotation(Activation.class); if (values != null) { for (Annotation annotation : values) { listeners.addAll(attachActivation(annotation, classLoader, configProperties, plainConfigProperties)); } listeners.trimToSize(); } return new InboundResourceAdapterImpl(new MessageAdapterImpl(listeners, null), null); }
throws Exception Collection<Annotation> values = annotationRepository.getAnnotation(ConnectionDefinitions.class); if (values != null)
Collection<Annotation> values = annotationRepository.getAnnotation(AdministeredObject.class); if (values != null)
Collection<Annotation> values = annotationRepository.getAnnotation(javax.resource.spi.ConfigProperty.class); if (values != null)
Collection<Annotation> values = annotationRepository.getAnnotation(javax.resource.spi.Connector.class); if (values != null)