@Inject public void setInitializerService(@OSGiService PropertyService initializerService) { this.initializerService = initializerService; }
public OSGiServiceBean(InjectionPoint injectionPoint, BundleContext ctx) { logger.trace("Entering OSGiServiceBean : " + "OSGiServiceBean() with parameter {}", new Object[] {injectionPoint}); this.injectionPoint = injectionPoint; this.ctx = ctx; type = injectionPoint.getType(); qualifiers = injectionPoint.getQualifiers(); filter = FilterGenerator.makeFilter(injectionPoint); for (Annotation annotation : injectionPoint.getQualifiers()) { if (annotation.annotationType().equals(OSGiService.class)) { timeout = ((OSGiService) annotation).value(); break; } } logger.debug("New OSGiServiceBean constructed {}", this); }
public OSGiServiceAnnotatedParameter(AnnotatedParameter parameter) { logger.trace("Entering OSGiServiceAnnotatedParameter : " + "OSGiServiceAnnotatedParameter() with parameter {}", new Object[] {parameter}); this.parameter = parameter; filter = FilterGenerator.makeFilter(parameter.getAnnotations()); annotations.add(filter); //annotations.add(new AnnotationLiteral<OSGiService>() {}); annotations.add(new OSGiServiceAnnotation( parameter.getAnnotation(OSGiService.class).value())); if (parameter.getAnnotation(Required.class) != null) { annotations.add(new AnnotationLiteral<Required>() { }); } for (Annotation annotation : parameter.getAnnotations()) { if (!annotation.annotationType().isAnnotationPresent(Qualifier.class)) { annotations.add(annotation); } } logger.debug("New OSGiServiceAnnotatedParameter constructed {}", this); }
@Inject public void setInitializerFilteredFromQualifierService(@OSGiService @Filter("(Name.value=2)") PropertyService initializerFilteredFromQualifierService) { this.initializerFilteredFromQualifierService = initializerFilteredFromQualifierService; }
public OSGiServiceAnnotatedField(final AnnotatedField<? super T> field) { logger.debug("Creation of a new CDIOSGiAnnotatedField wrapping {}", field); this.field = field; filter = FilterGenerator.makeFilter(filter, field.getAnnotations()); annotations.add(filter); //annotations.add(new AnnotationLiteral<OSGiService>() {}); annotations.add(new OSGiServiceAnnotation( field.getJavaMember().getAnnotation(OSGiService.class).value())); if (field.getAnnotation(Required.class) != null) { annotations.add(new AnnotationLiteral<Required>() { }); } for (Annotation annotation : field.getAnnotations()) { if (!annotation.annotationType().isAnnotationPresent(Qualifier.class)) { annotations.add(annotation); } } logger.debug("New OSGiServiceAnnotatedField constructed {}", this); }
@Inject public void setInitializerQualifiedFromPropertyService(@OSGiService @Name("1") PropertyService initializerQualifiedFromPropertyService) { this.initializerQualifiedFromPropertyService = initializerQualifiedFromPropertyService; }
@Inject public void setInitializerQualifiedService(@OSGiService @Name("2") PropertyService initializerQualifiedService) { this.initializerQualifiedService = initializerQualifiedService; }
@Inject public void setInitializerOtherFilteredService(@OSGiService @Filter("(Name.value=1)") PropertyService initializerOtherFilteredService) { this.initializerOtherFilteredService = initializerOtherFilteredService; }
@Inject public void setInitializerFilteredService(@OSGiService @Filter("(Name.value=1)") PropertyService initializerFilteredService) { this.initializerFilteredService = initializerFilteredService; }
@Publish @ApplicationScoped public class TestPublishedBean implements TestPublished { @Inject @OSGiService @Filter("(Name.value=2)") PropertyService service; @Inject @OSGiService @Name2 PropertyService service2; public PropertyService getService() { return service; } public PropertyService getService2() { return service2; } }
public class RequiredServiceProvider { @Inject @OSGiService @Required @Name("1") RequiredService requiredService1; @Inject @OSGiService @Required @Name("2") RequiredService requiredService2; public RequiredService getRequiredService1() { return requiredService1; } public RequiredService getRequiredService2() { return requiredService2; } }
@Publish public class ServiceExtensionProvider { @Inject @Name("extension") private PropertyService serviceExtension; @Inject @OSGiService @Name("extension") private PropertyService serviceExtensionService; public PropertyService getServiceExtension() { return serviceExtension; } public PropertyService getServiceExtensionService() { return serviceExtensionService; } }
@Inject public ServiceProvider(@OSGiService PropertyService constructorService, @OSGiService @Filter("(Name.value=1)") PropertyService constructorFilteredService, @OSGiService @Name("2") PropertyService constructorQualifiedService, @OSGiService @Name("1") PropertyService constructorQualifiedFromPropertyService, @OSGiService @Filter("(Name.value=2)") PropertyService constructorFilteredFromQualifierService, @OSGiService @Filter("(Name.value=1)") PropertyService constructorOtherFilteredService, Service<PropertyService> constructorServiceProvider, @Filter("(Name.value=1)") Service<PropertyService> constructorFilteredServiceProvider, @Name("2") Service<PropertyService> constructorQualifiedServiceProvider, @Name("1") Service<PropertyService> constructorQualifiedFromPropertyServiceProvider, @Filter("(Name.value=2)") Service<PropertyService> constructorFilteredFromQualifierServiceProvider, @Filter("(Name.value=1)") Service<PropertyService> constructorOtherFilteredServiceProvider) { this.constructorService = constructorService; this.constructorFilteredService = constructorFilteredService; this.constructorQualifiedService = constructorQualifiedService; this.constructorQualifiedFromPropertyService = constructorQualifiedFromPropertyService; this.constructorFilteredFromQualifierService = constructorFilteredFromQualifierService; this.constructorOtherFilteredService = constructorOtherFilteredService; this.constructorServiceProvider = constructorServiceProvider; this.constructorFilteredServiceProvider = constructorFilteredServiceProvider; this.constructorQualifiedServiceProvider = constructorQualifiedServiceProvider; this.constructorQualifiedFromPropertyServiceProvider = constructorQualifiedFromPropertyServiceProvider; this.constructorFilteredFromQualifierServiceProvider = constructorFilteredFromQualifierServiceProvider; this.constructorOtherFilteredServiceProvider = constructorOtherFilteredServiceProvider; }
@OSGiService private PropertyService service; @OSGiService @Filter("(Name.value=1)") private PropertyService filteredService; @OSGiService @Name("2") private PropertyService qualifiedService; @OSGiService @Name("1") private PropertyService qualifiedFromPropertyService; @OSGiService @Filter("(Name.value=2)") private PropertyService filteredFromQualifierService; @OSGiService @Filter("(Name.value=1)") private PropertyService otherFilteredService; @OSGiService private PersonalizedHashCodeService personalizedHashCodeService;