public void add(ServiceDefinition service) { if (!(service instanceof SpringService)) { throw new IllegalArgumentException("Service type must be " + SpringService.class.getName()); } super.add(service); }
public void visitField(PersistenceUnit annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { FieldInjectionSite site = new FieldInjectionSite(field); PersistenceUnitResourceReference definition = createDefinition(annotation); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
public void visitConstructorParameter(Cache annotation, Constructor<?> constructor, int index, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = annotation.name(); Class<?> type = constructor.getParameterTypes()[index]; ResourceReferenceDefinition definition = create(name, annotation, type, constructor, componentType, context); componentType.add(definition); }
public void visitMethod(PersistenceUnit annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { MethodInjectionSite site = new MethodInjectionSite(method, 0); PersistenceUnitResourceReference definition = createDefinition(annotation); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
public void visitType(Service annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { for (Class<?> service : annotation.names()) { ServiceDefinition definition = createDefinition(service, type, componentType, context); componentType.add(definition); } Class<?> service = annotation.value(); if (!Void.class.equals(service)) { ServiceDefinition definition = createDefinition(service, type, componentType, context); componentType.add(definition); } }
public void visitMethod(PersistenceUnit annotation, Method method, Class<?> implClass, I implementation, IntrospectionContext context) { MethodInjectionSite site = new MethodInjectionSite(method, 0); PersistenceUnitResource definition = createDefinition(annotation); InjectingComponentType componentType = implementation.getComponentType(); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
public void visitField(Cache annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(field, null); FieldInjectionSite site = new FieldInjectionSite(field); Class<?> type = field.getType(); ResourceReferenceDefinition definition = create(name, annotation, type, field, componentType, context); componentType.add(definition, site); }
public void visitField(PersistenceUnit annotation, Field field, Class<?> implClass, I implementation, IntrospectionContext context) { FieldInjectionSite site = new FieldInjectionSite(field); PersistenceUnitResource definition = createDefinition(annotation); InjectingComponentType componentType = implementation.getComponentType(); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
public void visitType(Remotable annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { ServiceContract serviceContract = contractProcessor.introspect(type, context, componentType); ServiceDefinition definition = new ServiceDefinition(serviceContract.getInterfaceName(), serviceContract); componentType.add(definition); } }
public void visitField(PersistenceContext annotation, Field field, Class<?> implClass, I implementation, IntrospectionContext context) { FieldInjectionSite site = new FieldInjectionSite(field); InjectingComponentType componentType = implementation.getComponentType(); PersistenceContextResource definition = createDefinition(annotation, componentType); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
private void addProperty(InjectingComponentType componentType, TypeMapping typeMapping, String name, Type type, InjectionSite site) { Property property = new Property(name); MultiplicityType multiplicityType = helper.introspectMultiplicity(type, typeMapping); property.setMany(MultiplicityType.COLLECTION == multiplicityType || MultiplicityType.DICTIONARY == multiplicityType); componentType.add(property, site); }
public void visitMethod(PersistenceContext annotation, Method method, Class<?> implClass, I implementation, IntrospectionContext context) { MethodInjectionSite site = new MethodInjectionSite(method, 0); InjectingComponentType componentType = implementation.getComponentType(); PersistenceContextResource definition = createDefinition(annotation, componentType); componentType.add(definition, site); // record that the implementation requires JPA componentType.addRequiredCapability("jpa"); }
public void visitField(Callback annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { validate(field, componentType, context); String name = helper.getSiteName(field, null); Type type = field.getGenericType(); FieldInjectionSite site = new FieldInjectionSite(field); CallbackDefinition definition = createDefinition(name, type, implClass, componentType, context); componentType.add(definition, site); }
public void visitField(Producer annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(field, annotation.value()); Type type = field.getGenericType(); FieldInjectionSite site = new FieldInjectionSite(field); ProducerDefinition definition = createDefinition(name, type, implClass, componentType, field, context); componentType.add(definition, site); }
public void visitField(Monitor annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(field, null); Type genericType = field.getGenericType(); TypeMapping typeMapping = context.getTypeMapping(implClass); Class<?> type = helper.getBaseType(genericType, typeMapping); FieldInjectionSite site = new FieldInjectionSite(field); MonitorResourceReference resource = createDefinition(name, annotation, type, componentType, context); componentType.add(resource, site); }
public void visitMethod(Reference annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(method, annotation.name()); Type type = helper.getGenericType(method); MethodInjectionSite site = new MethodInjectionSite(method, 0); Annotation[] annotations = method.getAnnotations(); ReferenceDefinition definition = createDefinition(name, annotation.required(), type, implClass, annotations, componentType, context); componentType.add(definition, site); }
public void visitMethod(Callback annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { validate(method, componentType, context); String name = helper.getSiteName(method, null); Type type = helper.getGenericType(method); MethodInjectionSite site = new MethodInjectionSite(method, 0); CallbackDefinition definition = createDefinition(name, type, implClass, componentType, context); componentType.add(definition, site); }
public void visitMethod(Producer annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(method, annotation.value()); Type type = helper.getGenericType(method); MethodInjectionSite site = new MethodInjectionSite(method, 0); ProducerDefinition definition = createDefinition(name, type, implClass, componentType, method, context); componentType.add(definition, site); }
public void visitConstructorParameter(Producer annotation, Constructor<?> constructor, int index, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(constructor, index, annotation.value()); Type type = helper.getGenericType(constructor, index); ConstructorInjectionSite site = new ConstructorInjectionSite(constructor, index); ProducerDefinition definition = createDefinition(name, type, implClass, componentType, constructor, context); componentType.add(definition, site); }
public void visitMethod(Monitor annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { String name = helper.getSiteName(method, null); TypeMapping typeMapping = context.getTypeMapping(implClass); Type genericType = helper.getGenericType(method); Class<?> type = helper.getBaseType(genericType, typeMapping); MethodInjectionSite site = new MethodInjectionSite(method, 0); MonitorResourceReference resource = createDefinition(name, annotation, type, componentType, context); componentType.add(resource, site); }