public void add(Service<ComponentType> service) { if (!(service instanceof SpringService)) { throw new IllegalArgumentException("Service type must be " + SpringService.class.getName()); } super.add(service); }
public void add(Service<ComponentType> service) { if (!(service instanceof SpringService)) { throw new IllegalArgumentException("Service type must be " + SpringService.class.getName()); } super.add(service); }
public void visitField(PersistenceContext annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { FieldInjectionSite site = new FieldInjectionSite(field); String name = helper.getSiteName(field, null); if (EntityManager.class.equals(field.getType())) { PersistenceContextResourceReference reference = createReference(name, field, annotation, componentType, context); componentType.add(reference, site); } else { HibernateSessionResourceReference reference = createSessionReference(name, annotation, componentType); componentType.add(reference, site); } }
public void visitField(PersistenceContext annotation, Field field, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { FieldInjectionSite site = new FieldInjectionSite(field); String name = helper.getSiteName(field, null); if (EntityManager.class.equals(field.getType())) { PersistenceContextResourceReference reference = createReference(name, field, annotation, componentType, context); componentType.add(reference, site); } else { HibernateSessionResourceReference reference = createSessionReference(name, annotation, componentType); componentType.add(reference, site); } }
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); }
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); }
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); }
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); }
public void visitType(org.oasisopen.sca.annotation.Service annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { Class<?>[] services = annotation.value(); String[] names = annotation.names(); for (int i = 0; i < services.length; i++) { Class<?> service = services[i]; componentType.add(createDefinition(service, names.length == 0 ? service.getSimpleName() : names[i], type, componentType, context)); } }
public void addDefinition(Field field, String name, boolean required, Class<?> clazz, InjectingComponentType componentType, IntrospectionContext context) { name = helper.getSiteName(field, name); Type type = field.getGenericType(); FieldInjectionSite site = new FieldInjectionSite(field); Reference<ComponentType> definition = createDefinition(name, required, type, clazz, componentType, context); componentType.add(definition, site); addTargets(field, field, context, definition); }
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 visitType(Remotable annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { ServiceContract serviceContract = contractProcessor.introspect(type, context, componentType); Service definition = new Service(serviceContract.getInterfaceName(), serviceContract); componentType.add(definition); } }
public void visitField(org.oasisopen.sca.annotation.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); Callback definition = createDefinition(name, type, implClass, componentType, 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 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); }
private void addProperty(InjectingComponentType componentType, String name, Type type, Class<?> declaringClass, InjectionSite site, IntrospectionContext context) { TypeMapping typeMapping = context.getTypeMapping(declaringClass); 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(org.oasisopen.sca.annotation.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); Callback definition = createDefinition(name, type, implClass, componentType, context); componentType.add(definition, site); }
public void addDefinition(Constructor constructor, String name, int index, boolean required, Class<?> clazz, InjectingComponentType componentType, IntrospectionContext context) { name = helper.getSiteName(constructor, index, name); Type type = helper.getGenericType(constructor, index); ConstructorInjectionSite site = new ConstructorInjectionSite(constructor, index); Reference<ComponentType> definition = createDefinition(name, required, type, clazz, componentType, context); componentType.add(definition, site); addTargets(constructor, constructor, context, definition); }
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); }
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); }