aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rotty3...@apache.org
Subject svn commit: r1829454 [1/2] - in /aries/trunk/cdi: cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ cdi-extender/src/main/java/org/apache/aries/cdi/con...
Date Wed, 18 Apr 2018 15:13:47 GMT
Author: rotty3000
Date: Wed Apr 18 15:13:46 2018
New Revision: 1829454

URL: http://svn.apache.org/viewvc?rev=1829454&view=rev
Log:
updated to latest CDI API

Signed-off-by: Raymond Auge <rotty3000@apache.org>

Added:
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/BeanServiceObjectsImpl.java
      - copied, changed from r1829162, aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceServiceObjectsImpl.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindObjectImpl.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceObjectsImpl.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/Binder.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_BeanServiceObjectsTest.java
      - copied, changed from r1829162, aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_ReferenceServiceObjectsTest.java
Removed:
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceServiceObjectsImpl.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceEventImpl.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_ReferenceServiceObjectsTest.java
Modified:
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ReferenceBean.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/DiscoveryExtension.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceSync.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/RuntimeExtension.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/CollectionType.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedReferenceDTO.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/FactoryActivator.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceModel.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/SingleActivator.java
    aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/provider/package-info.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarAnnotated.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarProducer.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/FooAnnotated.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/FooWithReferenceAndConfig.java
    aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/ObserverFoo.java
    aries/trunk/cdi/cdi-itests/src/main/java/org/apache/aries/cdi/test/cases/JndiExtensionTests.java
    aries/trunk/cdi/cdi-itests/src/main/java/org/apache/aries/cdi/test/tb10/SingleReferenceEventHandler.java
    aries/trunk/cdi/cdi-itests/src/main/java/org/apache/aries/cdi/test/tb9/ContainerReferenceEventHandler.java

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ReferenceBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ReferenceBean.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ReferenceBean.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/bean/ReferenceBean.java Wed Apr 18 15:13:46 2018
@@ -38,7 +38,6 @@ import org.apache.aries.cdi.container.in
 import org.apache.aries.cdi.container.internal.model.CollectionType;
 import org.apache.aries.cdi.container.internal.model.ExtendedReferenceDTO;
 import org.apache.aries.cdi.container.internal.model.ExtendedReferenceTemplateDTO;
-import org.apache.aries.cdi.container.internal.model.ReferenceEventImpl;
 import org.apache.aries.cdi.container.internal.util.Logs;
 import org.apache.aries.cdi.container.internal.util.Sets;
 import org.osgi.framework.ServiceReference;
@@ -47,7 +46,6 @@ import org.osgi.service.cdi.MaximumCardi
 import org.osgi.service.cdi.ReferencePolicy;
 import org.osgi.service.cdi.annotations.ComponentScoped;
 import org.osgi.service.cdi.annotations.Reference;
-import org.osgi.service.cdi.reference.ReferenceEvent;
 import org.osgi.service.cdi.runtime.dto.template.ComponentTemplateDTO;
 import org.osgi.service.log.Logger;
 
@@ -68,8 +66,6 @@ public class ReferenceBean implements Be
 
 	@Override
 	public Object create(CreationalContext<Object> c) {
-		if (_template.collectionType == CollectionType.OBSERVER) return null;
-
 		Objects.requireNonNull(_bm);
 		Objects.requireNonNull(_snapshot);
 
@@ -77,7 +73,13 @@ public class ReferenceBean implements Be
 
 		final SortedMap<ServiceReference<Object>, Object> tracked = _snapshot.serviceTracker.getTracked();
 
-		if (_template.policy == ReferencePolicy.DYNAMIC) {
+		if (_template.collectionType == CollectionType.BINDER_OBJECT ||
+			_template.collectionType == CollectionType.BINDER_REFERENCE ||
+			_template.collectionType == CollectionType.BINDER_SERVICE_OBJECTS) {
+
+			return _snapshot.binder;
+		}
+		else if (_template.policy == ReferencePolicy.DYNAMIC) {
 			if (_template.maximumCardinality == MaximumCardinality.MANY) {
 				return new Provider<List<Object>>() {
 					@Override
@@ -167,34 +169,6 @@ public class ReferenceBean implements Be
 	public void destroy(Object instance, CreationalContext<Object> creationalContext) {
 	}
 
-	public boolean fireEvents() {
-		if (_template.collectionType != CollectionType.OBSERVER) return true;
-
-		_snapshot.serviceTracker.getTracked().values().stream().map(
-			ReferenceEvent.class::cast
-		).forEach(this::fireEvent);
-
-		return true;
-	}
-
-	public boolean fireEvent(ReferenceEvent<?> event) {
-		try {
-//			TODO this is the spec way to do it, but parameterized types are not supported,
-//			so we need to cheat.
-//			_bm.getEvent().select(
-//				Reference.Literal.of(_template.serviceClass, _template.targetFilter)
-//			).fire(event);
-
-			((org.jboss.weld.bean.builtin.BeanManagerProxy)_bm).delegate().getGlobalLenientObserverNotifier().fireEvent(
-				(Type)event, event, Reference.Literal.of(_template.serviceClass, _template.targetFilter));
-		}
-		catch (Exception e) {
-			_log.error(l -> l.error("CCR observer method error on {}", _snapshot, e));
-		}
-
-		return ((ReferenceEventImpl<?>)event).flush();
-	}
-
 	@Override
 	public Class<?> getBeanClass() {
 		return _template.beanClass;

Copied: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/BeanServiceObjectsImpl.java (from r1829162, aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceServiceObjectsImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/BeanServiceObjectsImpl.java?p2=aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/BeanServiceObjectsImpl.java&p1=aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceServiceObjectsImpl.java&r1=1829162&r2=1829454&rev=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceServiceObjectsImpl.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/BeanServiceObjectsImpl.java Wed Apr 18 15:13:46 2018
@@ -19,11 +19,11 @@ import java.util.concurrent.ConcurrentHa
 
 import org.osgi.framework.ServiceObjects;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.cdi.reference.ReferenceServiceObjects;
+import org.osgi.service.cdi.reference.BeanServiceObjects;
 
-public class ReferenceServiceObjectsImpl<T> implements ReferenceServiceObjects<T> {
+public class BeanServiceObjectsImpl<T> implements BeanServiceObjects<T> {
 
-	public ReferenceServiceObjectsImpl(ServiceObjects<T> so) {
+	public BeanServiceObjectsImpl(ServiceObjects<T> so) {
 		_so = so;
 	}
 

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/DiscoveryExtension.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/DiscoveryExtension.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/DiscoveryExtension.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/DiscoveryExtension.java Wed Apr 18 15:13:46 2018
@@ -33,7 +33,6 @@ import javax.enterprise.event.Observes;
 import javax.enterprise.inject.spi.AfterBeanDiscovery;
 import javax.enterprise.inject.spi.Annotated;
 import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
@@ -41,12 +40,10 @@ import javax.enterprise.inject.spi.BeanM
 import javax.enterprise.inject.spi.DefinitionException;
 import javax.enterprise.inject.spi.Extension;
 import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
 import javax.enterprise.inject.spi.ProcessBean;
 import javax.enterprise.inject.spi.ProcessInjectionPoint;
 import javax.enterprise.inject.spi.ProcessManagedBean;
-import javax.enterprise.inject.spi.ProcessObserverMethod;
 import javax.enterprise.inject.spi.ProcessProducerField;
 import javax.enterprise.inject.spi.ProcessProducerMethod;
 import javax.enterprise.inject.spi.ProcessSessionBean;
@@ -66,15 +63,16 @@ import org.osgi.service.cdi.ComponentTyp
 import org.osgi.service.cdi.ConfigurationPolicy;
 import org.osgi.service.cdi.MaximumCardinality;
 import org.osgi.service.cdi.ServiceScope;
-import org.osgi.service.cdi.annotations.Bundle;
 import org.osgi.service.cdi.annotations.ComponentScoped;
 import org.osgi.service.cdi.annotations.Configuration;
 import org.osgi.service.cdi.annotations.FactoryComponent;
 import org.osgi.service.cdi.annotations.PID;
-import org.osgi.service.cdi.annotations.Prototype;
 import org.osgi.service.cdi.annotations.Reference;
+import org.osgi.service.cdi.annotations.ServiceInstance;
 import org.osgi.service.cdi.annotations.SingleComponent;
-import org.osgi.service.cdi.reference.ReferenceEvent;
+import org.osgi.service.cdi.reference.BindObject;
+import org.osgi.service.cdi.reference.BindServiceObjects;
+import org.osgi.service.cdi.reference.BindServiceReference;
 import org.osgi.service.cdi.runtime.dto.template.ComponentTemplateDTO;
 
 public class DiscoveryExtension implements Extension {
@@ -403,6 +401,108 @@ public class DiscoveryExtension implemen
 		}
 	}
 
+	void processBindObject(@Observes ProcessInjectionPoint<?, BindObject<?>> pip) {
+		InjectionPoint injectionPoint = pip.getInjectionPoint();
+
+		Class<?> declaringClass = getDeclaringClass(injectionPoint);
+
+		String className = declaringClass.getName();
+
+		OSGiBean osgiBean = _beansModel.getOSGiBean(className);
+
+		if (osgiBean == null) {
+			return;
+		}
+
+		Annotated annotated = injectionPoint.getAnnotated();
+
+		Builder builder = null;
+
+		if (annotated instanceof AnnotatedParameter) {
+			builder = new ReferenceModel.Builder((AnnotatedParameter<?>)annotated);
+		}
+		else {
+			builder = new ReferenceModel.Builder((AnnotatedField<?>)annotated);
+		}
+
+		try {
+			ReferenceModel referenceModel = builder.type(injectionPoint.getType()).build();
+
+			osgiBean.addReference(referenceModel.toDTO());
+		}
+		catch (Exception e) {
+			_containerState.error(e);
+		}
+	}
+
+	void processBindServiceObjects(@Observes ProcessInjectionPoint<?, BindServiceObjects<?>> pip) {
+		InjectionPoint injectionPoint = pip.getInjectionPoint();
+
+		Class<?> declaringClass = getDeclaringClass(injectionPoint);
+
+		String className = declaringClass.getName();
+
+		OSGiBean osgiBean = _beansModel.getOSGiBean(className);
+
+		if (osgiBean == null) {
+			return;
+		}
+
+		Annotated annotated = injectionPoint.getAnnotated();
+
+		Builder builder = null;
+
+		if (annotated instanceof AnnotatedParameter) {
+			builder = new ReferenceModel.Builder((AnnotatedParameter<?>)annotated);
+		}
+		else {
+			builder = new ReferenceModel.Builder((AnnotatedField<?>)annotated);
+		}
+
+		try {
+			ReferenceModel referenceModel = builder.type(injectionPoint.getType()).build();
+
+			osgiBean.addReference(referenceModel.toDTO());
+		}
+		catch (Exception e) {
+			_containerState.error(e);
+		}
+	}
+
+	void processBindServiceReference(@Observes ProcessInjectionPoint<?, BindServiceReference<?>> pip) {
+		InjectionPoint injectionPoint = pip.getInjectionPoint();
+
+		Class<?> declaringClass = getDeclaringClass(injectionPoint);
+
+		String className = declaringClass.getName();
+
+		OSGiBean osgiBean = _beansModel.getOSGiBean(className);
+
+		if (osgiBean == null) {
+			return;
+		}
+
+		Annotated annotated = injectionPoint.getAnnotated();
+
+		Builder builder = null;
+
+		if (annotated instanceof AnnotatedParameter) {
+			builder = new ReferenceModel.Builder((AnnotatedParameter<?>)annotated);
+		}
+		else {
+			builder = new ReferenceModel.Builder((AnnotatedField<?>)annotated);
+		}
+
+		try {
+			ReferenceModel referenceModel = builder.type(injectionPoint.getType()).build();
+
+			osgiBean.addReference(referenceModel.toDTO());
+		}
+		catch (Exception e) {
+			_containerState.error(e);
+		}
+	}
+
 	void processInjectionPoint(@Observes ProcessInjectionPoint<?, ?> pip) {
 		InjectionPoint injectionPoint = pip.getInjectionPoint();
 
@@ -468,70 +568,18 @@ public class DiscoveryExtension implemen
 		}
 	}
 
-	void processObserverMethod(@Observes ProcessObserverMethod<ReferenceEvent<?>, ?> pom) {
-		ObserverMethod<ReferenceEvent<?>> observerMethod = pom.getObserverMethod();
-
-		AnnotatedMethod<?> annotatedMethod = pom.getAnnotatedMethod();
-
-		Configuration configuration = annotatedMethod.getAnnotation(Configuration.class);
-
-		if (configuration != null) {
-			pom.addDefinitionError(
-				new IllegalArgumentException(
-					String.format(
-						"Cannot use @Configuration on ReferenceEvent observer method {}",
-						observerMethod))
-			);
-
-			return;
-		}
-
-		Class<?> beanClass = observerMethod.getBeanClass();
-
-		final String className = beanClass.getName();
-
-		OSGiBean osgiBean = _beansModel.getOSGiBean(className);
-
-		if (osgiBean == null) {
-			pom.addDefinitionError(
-				new DefinitionException(
-					String.format(
-						"The observer method %s was not declared as <cdi:bean class=\"%s\">",
-						observerMethod, className))
-			);
-
-			return;
-		}
-
-		try {
-			ReferenceModel referenceModel = new ReferenceModel.Builder(
-				pom.getAnnotatedMethod().getParameters().get(0)
-			).type(observerMethod.getObservedType()).build();
-
-			osgiBean.addReference(referenceModel.toDTO());
-		}
-		catch (Exception e) {
-			pom.addDefinitionError(e);
-		}
-	}
-
 	ServiceScope getScope(Annotated annotated) {
-		Prototype prototype = annotated.getAnnotation(Prototype.class);
-		Bundle bundle = annotated.getAnnotation(Bundle.class);
+		ServiceInstance serviceInstance = annotated.getAnnotation(ServiceInstance.class);
 
-		if (prototype != null) {
-			if (bundle != null) {
-				throw new IllegalArgumentException(
-					String.format(
-						"@Prototype and @Bundle must not be used to gether: %s",
-						annotated));
+		if (serviceInstance != null) {
+			switch (serviceInstance.value()) {
+				case BUNDLE:
+					return ServiceScope.BUNDLE;
+				case PROTOTYPE:
+					return ServiceScope.PROTOTYPE;
+				case SINGLETON:
+					return ServiceScope.SINGLETON;
 			}
-
-			return ServiceScope.PROTOTYPE;
-		}
-
-		if (bundle != null) {
-			return ServiceScope.BUNDLE;
 		}
 
 		return ServiceScope.SINGLETON;

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceSync.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceSync.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceSync.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/ReferenceSync.java Wed Apr 18 15:13:46 2018
@@ -16,13 +16,11 @@ package org.apache.aries.cdi.container.i
 
 import java.util.AbstractMap.SimpleImmutableEntry;
 
-import org.apache.aries.cdi.container.internal.container.ComponentContext.With;
 import org.apache.aries.cdi.container.internal.model.CollectionType;
 import org.apache.aries.cdi.container.internal.model.ExtendedComponentInstanceDTO;
 import org.apache.aries.cdi.container.internal.model.ExtendedReferenceDTO;
 import org.apache.aries.cdi.container.internal.model.ExtendedReferenceTemplateDTO;
 import org.apache.aries.cdi.container.internal.model.InstanceActivator;
-import org.apache.aries.cdi.container.internal.model.ReferenceEventImpl;
 import org.apache.aries.cdi.container.internal.util.Conversions;
 import org.apache.aries.cdi.container.internal.util.Maps;
 import org.apache.aries.cdi.container.internal.util.SRs;
@@ -65,21 +63,13 @@ public class ReferenceSync implements Se
 		_referenceDTO.matches = SRs.from(_referenceDTO.serviceTracker.getServiceReferences(), reference);
 
 		try {
-			if (collectionType == CollectionType.OBSERVER) {
-				@SuppressWarnings("unchecked")
-				ReferenceEventImpl<Object> event = new ReferenceEventImpl<>(_containerState, (Class<Object>)_templateDTO.serviceClass);
-				event.addingService(reference);
-				if (active) {
-					_componentInstanceDTO.activations.forEach(
-						a -> {
-							try (With with = new With(a)) {
-								_templateDTO.bean.fireEvent(event);
-							}
-						}
-					);
-					requiresUpdate = false;
-				}
-				return event;
+			if (collectionType == CollectionType.BINDER_OBJECT ||
+				collectionType == CollectionType.BINDER_REFERENCE ||
+				collectionType == CollectionType.BINDER_SERVICE_OBJECTS) {
+
+				requiresUpdate = false;
+
+				return _referenceDTO.binder.addingService(reference);
 			}
 			else if (collectionType == CollectionType.PROPERTIES) {
 				return Maps.of(reference.getProperties());
@@ -88,7 +78,7 @@ public class ReferenceSync implements Se
 				return reference;
 			}
 			else if (collectionType == CollectionType.SERVICEOBJECTS) {
-				return new ReferenceServiceObjectsImpl<>(
+				return new BeanServiceObjectsImpl<>(
 					_containerState.bundleContext().getServiceObjects(reference));
 			}
 			else if (collectionType == CollectionType.TUPLE) {
@@ -111,12 +101,14 @@ public class ReferenceSync implements Se
 	}
 
 	@Override
-	@SuppressWarnings("unchecked")
 	public void modifiedService(ServiceReference<Object> reference, Object service) {
 		CollectionType collectionType = _templateDTO.collectionType;
 
-		if (collectionType == CollectionType.OBSERVER) {
-			((ReferenceEventImpl<Object>)service).modifiedService(reference);
+		if (collectionType == CollectionType.BINDER_OBJECT ||
+			collectionType == CollectionType.BINDER_REFERENCE ||
+			collectionType == CollectionType.BINDER_SERVICE_OBJECTS) {
+
+			_referenceDTO.binder.modifiedService(reference);
 		}
 		else if (collectionType == CollectionType.PROPERTIES ||
 				collectionType == CollectionType.REFERENCE ||
@@ -145,8 +137,13 @@ public class ReferenceSync implements Se
 		_referenceDTO.matches.removeIf(d -> d.id == SRs.id(reference));
 
 		try {
-			if (collectionType == CollectionType.OBSERVER) {
-				((ReferenceEventImpl<Object>)service).removedService(reference);
+			if (collectionType == CollectionType.BINDER_OBJECT ||
+				collectionType == CollectionType.BINDER_REFERENCE ||
+				collectionType == CollectionType.BINDER_SERVICE_OBJECTS) {
+
+				requiresUpdate = false;
+
+				_referenceDTO.binder.removedService(reference);
 
 				return;
 			}
@@ -157,7 +154,7 @@ public class ReferenceSync implements Se
 				return;
 			}
 			else if (collectionType == CollectionType.SERVICEOBJECTS) {
-				((ReferenceServiceObjectsImpl<Object>)service).close();
+				((BeanServiceObjectsImpl<Object>)service).close();
 
 				return;
 			}

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/RuntimeExtension.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/RuntimeExtension.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/RuntimeExtension.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/container/RuntimeExtension.java Wed Apr 18 15:13:46 2018
@@ -46,7 +46,6 @@ import org.apache.aries.cdi.container.in
 import org.apache.aries.cdi.container.internal.bean.ReferenceBean;
 import org.apache.aries.cdi.container.internal.container.Op.Mode;
 import org.apache.aries.cdi.container.internal.container.Op.Type;
-import org.apache.aries.cdi.container.internal.model.CollectionType;
 import org.apache.aries.cdi.container.internal.model.ConfigurationModel;
 import org.apache.aries.cdi.container.internal.model.ExtendedActivationDTO;
 import org.apache.aries.cdi.container.internal.model.ExtendedActivationTemplateDTO;
@@ -71,6 +70,9 @@ import org.osgi.service.cdi.ServiceScope
 import org.osgi.service.cdi.annotations.ComponentScoped;
 import org.osgi.service.cdi.annotations.Configuration;
 import org.osgi.service.cdi.annotations.Reference;
+import org.osgi.service.cdi.reference.BindObject;
+import org.osgi.service.cdi.reference.BindServiceObjects;
+import org.osgi.service.cdi.reference.BindServiceReference;
 import org.osgi.service.cdi.runtime.dto.ComponentDTO;
 import org.osgi.service.cdi.runtime.dto.ConfigurationDTO;
 import org.osgi.service.cdi.runtime.dto.template.ComponentTemplateDTO;
@@ -103,13 +105,13 @@ public class RuntimeExtension implements
 	}
 
 	void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd) {
-		bbd.addQualifier(org.osgi.service.cdi.annotations.Bundle.class);
 		bbd.addQualifier(org.osgi.service.cdi.annotations.Configuration.class);
 		bbd.addQualifier(org.osgi.service.cdi.annotations.Greedy.class);
 		bbd.addQualifier(org.osgi.service.cdi.annotations.PID.class);
-		bbd.addQualifier(org.osgi.service.cdi.annotations.Prototype.class);
+		bbd.addQualifier(org.osgi.service.cdi.annotations.PrototypeRequired.class);
 		bbd.addQualifier(org.osgi.service.cdi.annotations.Reference.class);
 		bbd.addQualifier(org.osgi.service.cdi.annotations.Service.class);
+		bbd.addQualifier(org.osgi.service.cdi.annotations.ServiceInstance.class);
 		bbd.addScope(ComponentScoped.class, false, false);
 		bbd.addStereotype(org.osgi.service.cdi.annotations.FactoryComponent.class);
 		bbd.addStereotype(org.osgi.service.cdi.annotations.SingleComponent.class);
@@ -136,15 +138,8 @@ public class RuntimeExtension implements
 			properties);
 
 		_containerState.submit(
-			Op.of(Mode.OPEN, Type.CONTAINER_FIRE_EVENTS, _containerState.id()),
-			_containerInstanceDTO::fireEvents
-		).then(
-			s-> {
-				return _containerState.submit(
-					Op.of(Mode.OPEN, Type.CONTAINER_PUBLISH_SERVICES, _containerState.id()),
-					() -> registerServices(_containerComponentDTO, _containerInstanceDTO, bm)
-				);
-			}
+			Op.of(Mode.OPEN, Type.CONTAINER_PUBLISH_SERVICES, _containerState.id()),
+			() -> registerServices(_containerComponentDTO, _containerInstanceDTO, bm)
 		).then(
 			s -> initComponents()
 		);
@@ -180,7 +175,23 @@ public class RuntimeExtension implements
 		);
 	}
 
-	void processInjectionPoint(@Observes ProcessInjectionPoint<?, ?> pip, BeanManager beanManager) {
+	void processBindObject(@Observes ProcessInjectionPoint<?, BindObject<?>> pip) {
+		processInjectionPoint(pip, true);
+	}
+
+	void processBindServiceObjects(@Observes ProcessInjectionPoint<?, BindServiceObjects<?>> pip) {
+		processInjectionPoint(pip, true);
+	}
+
+	void processBindServiceReference(@Observes ProcessInjectionPoint<?, BindServiceReference<?>> pip) {
+		processInjectionPoint(pip, true);
+	}
+
+	void processInjectionPoint(@Observes ProcessInjectionPoint<?, ?> pip) {
+		processInjectionPoint(pip, false);
+	}
+
+	void processInjectionPoint(ProcessInjectionPoint<?, ?> pip, boolean special) {
 		InjectionPoint injectionPoint = pip.getInjectionPoint();
 
 		Class<?> declaringClass = DiscoveryExtension.getDeclaringClass(injectionPoint);
@@ -197,7 +208,7 @@ public class RuntimeExtension implements
 		Configuration configuration = annotated.getAnnotation(Configuration.class);
 		Reference reference = annotated.getAnnotation(Reference.class);
 
-		if ((reference != null) && matchReference(osgiBean, reference, pip)) {
+		if (((reference != null) || special) && matchReference(osgiBean, pip)) {
 			return;
 		}
 
@@ -220,11 +231,10 @@ public class RuntimeExtension implements
 						r -> bean.setReferenceDTO(r)
 					);
 				}
-				if (t.collectionType != CollectionType.OBSERVER) {
-					_log.debug(l -> l.debug("CCR Adding synthetic bean {} on {}", bean, _containerState.bundle()));
 
-					abd.addBean(bean);
-				}
+				_log.debug(l -> l.debug("CCR Adding synthetic bean {} on {}", bean, _containerState.bundle()));
+
+				abd.addBean(bean);
 			}
 		);
 
@@ -350,7 +360,7 @@ public class RuntimeExtension implements
 		).orElse(false);
 	}
 
-	private boolean matchReference(OSGiBean osgiBean, Reference reference, ProcessInjectionPoint<?, ?> pip) {
+	private boolean matchReference(OSGiBean osgiBean, ProcessInjectionPoint<?, ?> pip) {
 		InjectionPoint injectionPoint = pip.getInjectionPoint();
 
 		Annotated annotated = injectionPoint.getAnnotated();
@@ -383,6 +393,8 @@ public class RuntimeExtension implements
 
 				t.bean.setMark(markedInjectionPoint.getMark());
 
+				_log.debug(l -> l.debug("CCR maping InjectionPoint {} to reference template {}", injectionPoint, t));
+
 				return true;
 			}
 		).orElse(false);

Added: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindObjectImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindObjectImpl.java?rev=1829454&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindObjectImpl.java (added)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindObjectImpl.java Wed Apr 18 15:13:46 2018
@@ -0,0 +1,200 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.cdi.container.internal.model;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+
+import org.apache.aries.cdi.container.internal.container.ContainerState;
+import org.apache.aries.cdi.container.internal.util.Maps;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cdi.reference.BindObject;
+import org.osgi.service.log.Logger;
+
+public class BindObjectImpl<T> implements Binder<T>, BindObject<T> {
+
+	private final ContainerState _containerState;
+	private final Logger _log;
+
+	private final List<ServiceReference<T>> _queue = new CopyOnWriteArrayList<>();
+	private final AtomicBoolean _enqueue = new AtomicBoolean(true);
+	private volatile Optional<Consumer<T>> onAdding = Optional.empty();
+	private volatile Optional<BiConsumer<T, Map<String, Object>>> onAddingBi = Optional.empty();
+	private volatile Optional<Consumer<T>> onUpdate = Optional.empty();
+	private volatile Optional<BiConsumer<T, Map<String, Object>>> onUpdateBi = Optional.empty();
+	private volatile Optional<Consumer<T>> onRemove = Optional.empty();
+	private volatile Optional<BiConsumer<T, Map<String, Object>>> onRemoveBi = Optional.empty();
+
+	private volatile T service;
+
+	public BindObjectImpl(ContainerState containerState) {
+		_containerState = containerState;
+		_log = _containerState.containerLogs().getLogger(getClass());
+	}
+
+	@Override
+	public BindObjectImpl<T> addingService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.add(reference);
+			return this;
+		}
+
+		BundleContext bundleContext = _containerState.bundleContext();
+		service = bundleContext.getService(reference);
+		Map<String, Object> map = Maps.of(reference.getProperties());
+
+		onAdding.ifPresent(
+			c -> {
+				try {
+					c.accept(service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onAddingBi.ifPresent(
+			c -> {
+				try {
+					c.accept(service, map);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> modifiedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			return this; // i.e. do nothing
+		}
+
+		Map<String, Object> map = Maps.of(reference.getProperties());
+
+		onUpdate.ifPresent(
+			c -> {
+				try {
+					c.accept(service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onUpdateBi.ifPresent(
+			c -> {
+				try {
+					c.accept(service, map);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> removedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.remove(reference);
+			return this;
+		}
+
+		Map<String, Object> map = Maps.of(reference.getProperties());
+
+		onRemove.ifPresent(
+			c -> {
+				try {
+					c.accept(service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onRemoveBi.ifPresent(
+			c -> {
+				try {
+					c.accept(service, map);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public void bind() {
+		_enqueue.set(false);
+		_queue.removeIf(
+			reference -> {
+				addingService(reference);
+				return true;
+			}
+		);
+	}
+
+	@Override
+	public BindObjectImpl<T> adding(Consumer<T> action) {
+		onAdding = Optional.ofNullable(action);
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> adding(BiConsumer<T, Map<String, Object>> action) {
+		onAddingBi = Optional.ofNullable(action);
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> modified(Consumer<T> consumer) {
+		onUpdate = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> modified(BiConsumer<T, Map<String, Object>> consumer) {
+		onUpdateBi = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> removed(Consumer<T> consumer) {
+		onRemove = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindObjectImpl<T> removed(BiConsumer<T, Map<String, Object>> consumer) {
+		onRemoveBi = Optional.ofNullable(consumer);
+		return this;
+	}
+
+}
\ No newline at end of file

Added: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceObjectsImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceObjectsImpl.java?rev=1829454&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceObjectsImpl.java (added)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceObjectsImpl.java Wed Apr 18 15:13:46 2018
@@ -0,0 +1,143 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.cdi.container.internal.model;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Consumer;
+
+import org.apache.aries.cdi.container.internal.container.BeanServiceObjectsImpl;
+import org.apache.aries.cdi.container.internal.container.ContainerState;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cdi.reference.BeanServiceObjects;
+import org.osgi.service.cdi.reference.BindServiceObjects;
+import org.osgi.service.log.Logger;
+
+public class BindServiceObjectsImpl<T> implements Binder<T>, BindServiceObjects<T> {
+
+	private final ContainerState _containerState;
+	private final Logger _log;
+
+	private final List<ServiceReference<T>> _queue = new CopyOnWriteArrayList<>();
+	private final AtomicBoolean _enqueue = new AtomicBoolean(true);
+	private volatile Optional<Consumer<BeanServiceObjects<T>>> onAdding = Optional.empty();
+	private volatile Optional<Consumer<BeanServiceObjects<T>>> onUpdate = Optional.empty();
+	private volatile Optional<Consumer<BeanServiceObjects<T>>> onRemove = Optional.empty();
+
+	private volatile BeanServiceObjects<T> serviceObjects;
+
+	public BindServiceObjectsImpl(ContainerState containerState) {
+		_containerState = containerState;
+		_log = _containerState.containerLogs().getLogger(getClass());
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> addingService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.add(reference);
+			return this;
+		}
+
+		BundleContext bundleContext = _containerState.bundleContext();
+		serviceObjects = new BeanServiceObjectsImpl<T>(bundleContext.getServiceObjects(reference));
+
+		onAdding.ifPresent(
+			c -> {
+				try {
+					c.accept(serviceObjects);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> modifiedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			return this; // i.e. do nothing
+		}
+
+		onUpdate.ifPresent(
+			c -> {
+				try {
+					c.accept(serviceObjects);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> removedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.remove(reference);
+			return this;
+		}
+
+		onRemove.ifPresent(
+			c -> {
+				try {
+					c.accept(serviceObjects);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public void bind() {
+		_enqueue.set(false);
+		_queue.removeIf(
+			reference -> {
+				addingService(reference);
+				return true;
+			}
+		);
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> adding(Consumer<BeanServiceObjects<T>> action) {
+		onAdding = Optional.ofNullable(action);
+		return this;
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> modified(Consumer<BeanServiceObjects<T>> consumer) {
+		onUpdate = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindServiceObjectsImpl<T> removed(Consumer<BeanServiceObjects<T>> consumer) {
+		onRemove = Optional.ofNullable(consumer);
+		return this;
+	}
+
+}
\ No newline at end of file

Added: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java?rev=1829454&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java (added)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java Wed Apr 18 15:13:46 2018
@@ -0,0 +1,193 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.aries.cdi.container.internal.model;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+
+import org.apache.aries.cdi.container.internal.container.ContainerState;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cdi.reference.BindServiceReference;
+import org.osgi.service.log.Logger;
+
+public class BindServiceReferenceImpl<T> implements Binder<T>, BindServiceReference<T> {
+
+	private final ContainerState _containerState;
+	private final Logger _log;
+
+	private final List<ServiceReference<T>> _queue = new CopyOnWriteArrayList<>();
+	private final AtomicBoolean _enqueue = new AtomicBoolean(true);
+	private volatile Optional<Consumer<ServiceReference<T>>> onAdding = Optional.empty();
+	private volatile Optional<BiConsumer<ServiceReference<T>, T>> onAddingBi = Optional.empty();
+	private volatile Optional<Consumer<ServiceReference<T>>> onUpdate = Optional.empty();
+	private volatile Optional<BiConsumer<ServiceReference<T>, T>> onUpdateBi = Optional.empty();
+	private volatile Optional<Consumer<ServiceReference<T>>> onRemove = Optional.empty();
+	private volatile Optional<BiConsumer<ServiceReference<T>, T>> onRemoveBi = Optional.empty();
+
+	private volatile T service;
+
+	public BindServiceReferenceImpl(ContainerState containerState) {
+		_containerState = containerState;
+		_log = _containerState.containerLogs().getLogger(getClass());
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> addingService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.add(reference);
+			return this;
+		}
+
+		BundleContext bundleContext = _containerState.bundleContext();
+		service = bundleContext.getService(reference);
+
+		onAdding.ifPresent(
+			c -> {
+				try {
+					c.accept(reference);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onAddingBi.ifPresent(
+			c -> {
+				try {
+					c.accept(reference, service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> modifiedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			return this; // i.e. do nothing
+		}
+
+		onUpdate.ifPresent(
+			c -> {
+				try {
+					c.accept(reference);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onUpdateBi.ifPresent(
+			c -> {
+				try {
+					c.accept(reference, service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> removedService(ServiceReference<T> reference) {
+		if (_enqueue.get()) {
+			_queue.remove(reference);
+			return this;
+		}
+
+		onRemove.ifPresent(
+			c -> {
+				try {
+					c.accept(reference);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+		onRemoveBi.ifPresent(
+			c -> {
+				try {
+					c.accept(reference, service);
+				}
+				catch (Throwable t) {
+					_log.error(l -> l.error("CCR error in {}", this, t));
+				}
+			}
+		);
+
+		return this;
+	}
+
+	@Override
+	public void bind() {
+		_enqueue.set(false);
+		_queue.removeIf(
+			reference -> {
+				addingService(reference);
+				return true;
+			}
+		);
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> adding(Consumer<ServiceReference<T>> action) {
+		onAdding = Optional.ofNullable(action);
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> adding(BiConsumer<ServiceReference<T>, T> action) {
+		onAddingBi = Optional.ofNullable(action);
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> modified(Consumer<ServiceReference<T>> consumer) {
+		onUpdate = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> modified(BiConsumer<ServiceReference<T>, T> consumer) {
+		onUpdateBi = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> removed(Consumer<ServiceReference<T>> consumer) {
+		onRemove = Optional.ofNullable(consumer);
+		return this;
+	}
+
+	@Override
+	public BindServiceReferenceImpl<T> removed(BiConsumer<ServiceReference<T>, T> consumer) {
+		onRemoveBi = Optional.ofNullable(consumer);
+		return this;
+	}
+
+}
\ No newline at end of file

Added: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/Binder.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/Binder.java?rev=1829454&view=auto
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/Binder.java (added)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/Binder.java Wed Apr 18 15:13:46 2018
@@ -0,0 +1,11 @@
+package org.apache.aries.cdi.container.internal.model;
+
+import org.osgi.framework.ServiceReference;
+
+public interface Binder<T> {
+
+	public Binder<T> addingService(ServiceReference<T> reference);
+	public Binder<T> modifiedService(ServiceReference<T> reference);
+	public Binder<T> removedService(ServiceReference<T> reference);
+
+}

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/CollectionType.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/CollectionType.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/CollectionType.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/CollectionType.java Wed Apr 18 15:13:46 2018
@@ -61,9 +61,22 @@ public enum CollectionType {
 	TUPLE("tuple"),
 
 	/**
-	 * The observer type is used to indicate the reference is targeted to a observer method.
+	 * Used to indicate the reference is a binder for registering handler
+	 * methods for tracking service instances.
 	 */
-	OBSERVER("observer");
+	BINDER_OBJECT("binder_object"),
+
+	/**
+	 * Used to indicate the reference is a binder for registering handler
+	 * methods for tracking service references.
+	 */
+	BINDER_REFERENCE("binder_reference"),
+
+	/**
+	 * Used to indicate the reference is a binder for registering handler
+	 * methods for tracking service objects.
+	 */
+	BINDER_SERVICE_OBJECTS("binder_service_objects");
 
 	private final String value;
 

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java Wed Apr 18 15:13:46 2018
@@ -126,20 +126,6 @@ public class ExtendedComponentInstanceDT
 		return true;
 	}
 
-	public final boolean fireEvents() {
-		references.stream().map(ExtendedReferenceDTO.class::cast).filter(
-			r -> ((ExtendedReferenceTemplateDTO)r.template).collectionType == CollectionType.OBSERVER
-		).map(
-			r -> (ExtendedReferenceTemplateDTO)r.template
-		).forEach(
-			t -> {
-				t.bean.fireEvents();
-			}
-		);
-
-		return true;
-	}
-
 	public final boolean referencesResolved() {
 		for (ReferenceTemplateDTO template : template.references) {
 			if (template.minimumCardinality > 0) {
@@ -172,6 +158,16 @@ public class ExtendedComponentInstanceDT
 			t -> {
 				ExtendedReferenceDTO referenceDTO = new ExtendedReferenceDTO();
 
+				if (t.collectionType == CollectionType.BINDER_OBJECT) {
+					referenceDTO.binder = new BindObjectImpl<>(_containerState);
+				}
+				else if (t.collectionType == CollectionType.BINDER_REFERENCE) {
+					referenceDTO.binder = new BindServiceReferenceImpl<>(_containerState);
+				}
+				else if (t.collectionType == CollectionType.BINDER_SERVICE_OBJECTS) {
+					referenceDTO.binder = new BindServiceObjectsImpl<>(_containerState);
+				}
+
 				referenceDTO.matches = new CopyOnWriteArrayList<>();
 				referenceDTO.minimumCardinality = minimumCardinality(t.name, t.minimumCardinality);
 				referenceDTO.targetFilter = targetFilter(t.serviceType, t.name, t.targetFilter);

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedReferenceDTO.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedReferenceDTO.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedReferenceDTO.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedReferenceDTO.java Wed Apr 18 15:13:46 2018
@@ -19,6 +19,8 @@ import org.osgi.util.tracker.ServiceTrac
 
 public class ExtendedReferenceDTO extends ReferenceDTO {
 
+	public Binder<Object> binder;
+
 	public ServiceTracker<Object, Object> serviceTracker;
 
 }

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/FactoryActivator.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/FactoryActivator.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/FactoryActivator.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/FactoryActivator.java Wed Apr 18 15:13:46 2018
@@ -263,7 +263,6 @@ public class FactoryActivator extends In
 						instance.activations.remove(a);
 					}
 				};
-				instance.fireEvents();
 				return new AbstractMap.SimpleImmutableEntry<>(activationDTO, object);
 			}
 			catch (Throwable t) {

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceModel.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceModel.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceModel.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ReferenceModel.java Wed Apr 18 15:13:46 2018
@@ -47,10 +47,12 @@ import org.osgi.service.cdi.MaximumCardi
 import org.osgi.service.cdi.ReferencePolicy;
 import org.osgi.service.cdi.ReferencePolicyOption;
 import org.osgi.service.cdi.annotations.Greedy;
-import org.osgi.service.cdi.annotations.Prototype;
+import org.osgi.service.cdi.annotations.PrototypeRequired;
 import org.osgi.service.cdi.annotations.Reference;
-import org.osgi.service.cdi.reference.ReferenceEvent;
-import org.osgi.service.cdi.reference.ReferenceServiceObjects;
+import org.osgi.service.cdi.reference.BindObject;
+import org.osgi.service.cdi.reference.BindServiceObjects;
+import org.osgi.service.cdi.reference.BindServiceReference;
+import org.osgi.service.cdi.reference.BeanServiceObjects;
 
 public class ReferenceModel {
 
@@ -127,7 +129,7 @@ public class ReferenceModel {
 		_referenceType = getReferenceType();
 		_referenceTarget = getReferenceTarget();
 		_prototype = getQualifiers().stream().filter(
-			ann -> ann.annotationType().equals(Prototype.class)
+			ann -> ann.annotationType().equals(PrototypeRequired.class)
 		).findFirst().isPresent();
 
 		calculateServiceType(_injectionPointType);
@@ -356,7 +358,7 @@ public class ReferenceModel {
 				throw new IllegalArgumentException(
 					"Map.Entry must specify a generic type arguments: " + clazz);
 			}
-			else if ((ReferenceServiceObjects.class == clazz) && !_referenceType.isPresent()) {
+			else if ((BeanServiceObjects.class == clazz) && !_referenceType.isPresent()) {
 				throw new IllegalArgumentException(
 					"ReferenceServiceObjects must specify a generic type argument: " + clazz);
 			}
@@ -370,7 +372,7 @@ public class ReferenceModel {
 				throw new IllegalArgumentException(
 					type + " must specify a generic type argument");
 			}
-			else if (ReferenceServiceObjects.class == clazz) {
+			else if (BeanServiceObjects.class == clazz) {
 				_collectionType = CollectionType.SERVICEOBJECTS;
 				return;
 			}
@@ -403,8 +405,8 @@ public class ReferenceModel {
 				"Instance<T> is not supported with @Reference: " + type);
 		}
 
-		if (ReferenceEvent.class == cast(rawType)) {
-			_collectionType = CollectionType.OBSERVER;
+		if (BindObject.class.isAssignableFrom(cast(rawType))) {
+			_collectionType = CollectionType.BINDER_OBJECT;
 			_dynamic = true;
 			_multiplicity = MaximumCardinality.MANY;
 			_optional = true;
@@ -414,7 +416,45 @@ public class ReferenceModel {
 				argument instanceof ParameterizedType) {
 
 				throw new IllegalArgumentException(
-					"Type argument <S> of ReferenceEvent must not be generic: " + argument);
+					"Type argument <S> of BindObject must not be generic: " + argument);
+			}
+
+			_serviceType = cast(argument);
+
+			return;
+		}
+
+		if (BindServiceReference.class.isAssignableFrom(cast(rawType))) {
+			_collectionType = CollectionType.BINDER_REFERENCE;
+			_dynamic = true;
+			_multiplicity = MaximumCardinality.MANY;
+			_optional = true;
+			_greedy = true;
+
+			if (argument instanceof WildcardType ||
+				argument instanceof ParameterizedType) {
+
+				throw new IllegalArgumentException(
+					"Type argument <S> of BindServiceReference must not be generic: " + argument);
+			}
+
+			_serviceType = cast(argument);
+
+			return;
+		}
+
+		if (BindServiceObjects.class.isAssignableFrom(cast(rawType))) {
+			_collectionType = CollectionType.BINDER_SERVICE_OBJECTS;
+			_dynamic = true;
+			_multiplicity = MaximumCardinality.MANY;
+			_optional = true;
+			_greedy = true;
+
+			if (argument instanceof WildcardType ||
+				argument instanceof ParameterizedType) {
+
+				throw new IllegalArgumentException(
+					"Type argument <S> of BindServiceObjects must not be generic: " + argument);
 			}
 
 			_serviceType = cast(argument);
@@ -508,7 +548,7 @@ public class ReferenceModel {
 			return;
 		}
 
-		if (ReferenceServiceObjects.class == cast(rawType)) {
+		if (BeanServiceObjects.class == cast(rawType)) {
 			_collectionType = CollectionType.SERVICEOBJECTS;
 
 			if ((argument instanceof WildcardType) && _referenceType.isPresent()) {

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/SingleActivator.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/SingleActivator.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/SingleActivator.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/SingleActivator.java Wed Apr 18 15:13:46 2018
@@ -262,7 +262,6 @@ public class SingleActivator extends Ins
 						instance.activations.remove(a);
 					}
 				};
-				instance.fireEvents();
 				return new AbstractMap.SimpleImmutableEntry<>(activationDTO, object);
 			}
 			catch (Throwable t) {

Modified: aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/provider/package-info.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/provider/package-info.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/provider/package-info.java (original)
+++ aries/trunk/cdi/cdi-extender/src/main/java/org/apache/aries/cdi/provider/package-info.java Wed Apr 18 15:13:46 2018
@@ -3,8 +3,8 @@
 	namespace = ExtenderNamespace.EXTENDER_NAMESPACE,
 	uses = {
 		org.osgi.service.cdi.ServiceScope.class,
-		org.osgi.service.cdi.annotations.Bundle.class,
-		org.osgi.service.cdi.reference.ReferenceEvent.class,
+		org.osgi.service.cdi.annotations.Reference.class,
+		org.osgi.service.cdi.reference.BindObject.class,
 		org.osgi.service.cdi.runtime.CDIComponentRuntime.class,
 		org.osgi.service.cdi.runtime.dto.ActivationDTO.class,
 		org.osgi.service.cdi.runtime.dto.template.ActivationTemplateDTO.class
@@ -16,8 +16,8 @@
 	namespace = ImplementationNamespace.IMPLEMENTATION_NAMESPACE,
 	uses = {
 		org.osgi.service.cdi.ServiceScope.class,
-		org.osgi.service.cdi.annotations.Bundle.class,
-		org.osgi.service.cdi.reference.ReferenceEvent.class,
+		org.osgi.service.cdi.annotations.Reference.class,
+		org.osgi.service.cdi.reference.BindObject.class,
 		org.osgi.service.cdi.runtime.CDIComponentRuntime.class,
 		org.osgi.service.cdi.runtime.dto.ActivationDTO.class,
 		org.osgi.service.cdi.runtime.dto.template.ActivationTemplateDTO.class

Copied: aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_BeanServiceObjectsTest.java (from r1829162, aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_ReferenceServiceObjectsTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_BeanServiceObjectsTest.java?p2=aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_BeanServiceObjectsTest.java&p1=aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_ReferenceServiceObjectsTest.java&r1=1829162&r2=1829454&rev=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_ReferenceServiceObjectsTest.java (original)
+++ aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/internal/model/ReferenceModel_BeanServiceObjectsTest.java Wed Apr 18 15:13:46 2018
@@ -14,9 +14,7 @@
 
 package org.apache.aries.cdi.container.internal.model;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.lang.reflect.Type;
 import java.util.Collection;
@@ -26,16 +24,14 @@ import javax.enterprise.inject.Instance;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.inject.Inject;
 
-import org.apache.aries.cdi.container.internal.model.CollectionType;
-import org.apache.aries.cdi.container.internal.model.ReferenceModel;
 import org.apache.aries.cdi.container.test.MockInjectionPoint;
 import org.apache.aries.cdi.container.test.beans.Foo;
 import org.junit.Test;
 import org.osgi.service.cdi.annotations.Reference;
-import org.osgi.service.cdi.reference.ReferenceServiceObjects;
+import org.osgi.service.cdi.reference.BeanServiceObjects;
 import org.osgi.util.converter.TypeReference;
 
-public class ReferenceModel_ReferenceServiceObjectsTest {
+public class ReferenceModel_BeanServiceObjectsTest {
 
 	@Test(expected = IllegalArgumentException.class)
 	public void withoutServiceDefined_raw() throws Exception {
@@ -43,7 +39,7 @@ public class ReferenceModel_ReferenceSer
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference
-			public ReferenceServiceObjects m;
+			public BeanServiceObjects m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -56,7 +52,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference
-			public ReferenceServiceObjects<?> m;
+			public BeanServiceObjects<?> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -67,20 +63,20 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void withoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<Integer>
+			BeanServiceObjects<Integer>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference
-			public ReferenceServiceObjects<Integer> m;
+			public BeanServiceObjects<Integer> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -93,21 +89,21 @@ public class ReferenceModel_ReferenceSer
 	public void withServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			ReferenceServiceObjects
+			BeanServiceObjects
 		>(){}.getType();
 
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference(Integer.class)
-			public ReferenceServiceObjects m;
+			public BeanServiceObjects m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -119,20 +115,20 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void withServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<?>
+			BeanServiceObjects<?>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public ReferenceServiceObjects<?> m;
+			public BeanServiceObjects<?> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -144,20 +140,20 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void withServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<Integer>
+			BeanServiceObjects<Integer>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public ReferenceServiceObjects<Integer> m;
+			public BeanServiceObjects<Integer> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -171,7 +167,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public ReferenceServiceObjects<Foo> m;
+			public BeanServiceObjects<Foo> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -185,7 +181,7 @@ public class ReferenceModel_ReferenceSer
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference
-			public Collection<ReferenceServiceObjects> m;
+			public Collection<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -198,7 +194,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference
-			public Collection<ReferenceServiceObjects<?>> m;
+			public Collection<BeanServiceObjects<?>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -209,13 +205,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void collectionWithoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<Integer>>
+			Collection<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference
-			public Collection<ReferenceServiceObjects<Integer>> m;
+			public Collection<BeanServiceObjects<Integer>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -235,14 +231,14 @@ public class ReferenceModel_ReferenceSer
 	public void collectionWithServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects>
+			Collection<BeanServiceObjects>
 		>(){}.getType();
 
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference(Integer.class)
-			public Collection<ReferenceServiceObjects> m;
+			public Collection<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -260,13 +256,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void collectionWithServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<?>>
+			Collection<BeanServiceObjects<?>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public Collection<ReferenceServiceObjects<?>> m;
+			public Collection<BeanServiceObjects<?>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -286,13 +282,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void collectionWithServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<Integer>>
+			Collection<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public Collection<ReferenceServiceObjects<Integer>> m;
+			public Collection<BeanServiceObjects<Integer>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -313,7 +309,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public Collection<ReferenceServiceObjects<Foo>> m;
+			public Collection<BeanServiceObjects<Foo>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -327,7 +323,7 @@ public class ReferenceModel_ReferenceSer
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference
-			public List<ReferenceServiceObjects> m;
+			public List<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -340,7 +336,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference
-			public List<ReferenceServiceObjects<?>> m;
+			public List<BeanServiceObjects<?>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -351,13 +347,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void listWithoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<Integer>>
+			List<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference
-			public List<ReferenceServiceObjects<Integer>> m;
+			public List<BeanServiceObjects<Integer>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -377,14 +373,14 @@ public class ReferenceModel_ReferenceSer
 	public void listWithServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects>
+			List<BeanServiceObjects>
 		>(){}.getType();
 
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference(Integer.class)
-			public List<ReferenceServiceObjects> m;
+			public List<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -403,13 +399,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void listWithServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<?>>
+			List<BeanServiceObjects<?>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public List<ReferenceServiceObjects<?>> m;
+			public List<BeanServiceObjects<?>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -428,13 +424,13 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void listWithServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<Integer>>
+			List<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public List<ReferenceServiceObjects<Integer>> m;
+			public List<BeanServiceObjects<Integer>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -455,7 +451,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@Inject
 			@Reference(Integer.class)
-			public List<ReferenceServiceObjects<Foo>> m;
+			public List<BeanServiceObjects<Foo>> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -469,7 +465,7 @@ public class ReferenceModel_ReferenceSer
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference
-			public Instance<ReferenceServiceObjects> m;
+			public Instance<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -483,7 +479,7 @@ public class ReferenceModel_ReferenceSer
 			@SuppressWarnings("rawtypes")
 			@Inject
 			@Reference
-			public Instance<ReferenceServiceObjects> m;
+			public Instance<BeanServiceObjects> m;
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getField("m"));
@@ -502,10 +498,10 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference ReferenceServiceObjects m) {};
+			public void set(@Reference BeanServiceObjects m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 	}
@@ -514,10 +510,10 @@ public class ReferenceModel_ReferenceSer
 	public void p_withoutServiceDefined_wildcard() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference ReferenceServiceObjects<?> m) {};
+			public void set(@Reference BeanServiceObjects<?> m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 	}
@@ -525,19 +521,19 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_withoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<Integer>
+			BeanServiceObjects<Integer>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference ReferenceServiceObjects<Integer> m) {};
+			public void set(@Reference BeanServiceObjects<Integer> m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -550,19 +546,19 @@ public class ReferenceModel_ReferenceSer
 	public void p_withServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			ReferenceServiceObjects
+			BeanServiceObjects
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@SuppressWarnings("rawtypes") @Reference(Integer.class) ReferenceServiceObjects m) {};
+			public void set(@SuppressWarnings("rawtypes") @Reference(Integer.class) BeanServiceObjects m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -574,19 +570,19 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_withServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<?>
+			BeanServiceObjects<?>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) ReferenceServiceObjects<?> m) {};
+			public void set(@Reference(Integer.class) BeanServiceObjects<?> m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -598,19 +594,19 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_withServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			ReferenceServiceObjects<Integer>
+			BeanServiceObjects<Integer>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) ReferenceServiceObjects<Integer> m) {};
+			public void set(@Reference(Integer.class) BeanServiceObjects<Integer> m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		ReferenceModel referenceModel = new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 
-		assertEquals(ReferenceServiceObjects.class, referenceModel.getBeanClass());
+		assertEquals(BeanServiceObjects.class, referenceModel.getBeanClass());
 		assertEquals(Integer.class, referenceModel.getServiceType());
 		assertEquals(type, referenceModel.getInjectionPointType());
 		assertFalse(referenceModel.dynamic());
@@ -623,10 +619,10 @@ public class ReferenceModel_ReferenceSer
 	public void p_withServiceDefined_wrongtype() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) ReferenceServiceObjects<Foo> m) {};
+			public void set(@Reference(Integer.class) BeanServiceObjects<Foo> m) {};
 		}
 
-		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", ReferenceServiceObjects.class).getParameters()[0]);
+		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", BeanServiceObjects.class).getParameters()[0]);
 
 		new ReferenceModel.Builder().injectionPoint(injectionPoint).build();
 	}
@@ -636,7 +632,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference Collection<ReferenceServiceObjects> m) {};
+			public void set(@Reference Collection<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -648,7 +644,7 @@ public class ReferenceModel_ReferenceSer
 	public void p_collectionWithoutServiceDefined_wildcard() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference Collection<ReferenceServiceObjects<?>> m) {};
+			public void set(@Reference Collection<BeanServiceObjects<?>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -659,12 +655,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_collectionWithoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<Integer>>
+			Collection<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference Collection<ReferenceServiceObjects<Integer>> m) {};
+			public void set(@Reference Collection<BeanServiceObjects<Integer>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -684,12 +680,12 @@ public class ReferenceModel_ReferenceSer
 	public void p_collectionWithServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects>
+			Collection<BeanServiceObjects>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@SuppressWarnings("rawtypes") @Reference(Integer.class) Collection<ReferenceServiceObjects> m) {};
+			public void set(@SuppressWarnings("rawtypes") @Reference(Integer.class) Collection<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -708,12 +704,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_collectionWithServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<?>>
+			Collection<BeanServiceObjects<?>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) Collection<ReferenceServiceObjects<?>> m) {};
+			public void set(@Reference(Integer.class) Collection<BeanServiceObjects<?>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -732,12 +728,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_collectionWithServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			Collection<ReferenceServiceObjects<Integer>>
+			Collection<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) Collection<ReferenceServiceObjects<Integer>> m) {};
+			public void set(@Reference(Integer.class) Collection<BeanServiceObjects<Integer>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -757,7 +753,7 @@ public class ReferenceModel_ReferenceSer
 	public void p_collectionWithServiceDefined_wrongtype() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) Collection<ReferenceServiceObjects<Foo>> m) {};
+			public void set(@Reference(Integer.class) Collection<BeanServiceObjects<Foo>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Collection.class).getParameters()[0]);
@@ -770,7 +766,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference List<ReferenceServiceObjects> m) {};
+			public void set(@Reference List<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -782,7 +778,7 @@ public class ReferenceModel_ReferenceSer
 	public void p_listWithoutServiceDefined_wildcard() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference List<ReferenceServiceObjects<?>> m) {};
+			public void set(@Reference List<BeanServiceObjects<?>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -793,12 +789,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_listWithoutServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<Foo>>
+			List<BeanServiceObjects<Foo>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference List<ReferenceServiceObjects<Foo>> m) {};
+			public void set(@Reference List<BeanServiceObjects<Foo>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -818,13 +814,13 @@ public class ReferenceModel_ReferenceSer
 	public void p_listWithServiceDefined_raw() throws Exception {
 		@SuppressWarnings("rawtypes")
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects>
+			List<BeanServiceObjects>
 		>(){}.getType();
 
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference(Integer.class) List<ReferenceServiceObjects> m) {};
+			public void set(@Reference(Integer.class) List<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -843,12 +839,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_listWithServiceDefined_wildcard() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<?>>
+			List<BeanServiceObjects<?>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) List<ReferenceServiceObjects<?>> m) {};
+			public void set(@Reference(Integer.class) List<BeanServiceObjects<?>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -867,12 +863,12 @@ public class ReferenceModel_ReferenceSer
 	@Test
 	public void p_listWithServiceDefined_typed() throws Exception {
 		Type type = new TypeReference<
-			List<ReferenceServiceObjects<Integer>>
+			List<BeanServiceObjects<Integer>>
 		>(){}.getType();
 
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) List<ReferenceServiceObjects<Integer>> m) {};
+			public void set(@Reference(Integer.class) List<BeanServiceObjects<Integer>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -892,7 +888,7 @@ public class ReferenceModel_ReferenceSer
 	public void p_listWithServiceDefined_wrongtype() throws Exception {
 		class C {
 			@Inject
-			public void set(@Reference(Integer.class) List<ReferenceServiceObjects<Foo>> m) {};
+			public void set(@Reference(Integer.class) List<BeanServiceObjects<Foo>> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", List.class).getParameters()[0]);
@@ -905,7 +901,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference Instance<ReferenceServiceObjects> m) {};
+			public void set(@Reference Instance<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Instance.class).getParameters()[0]);
@@ -918,7 +914,7 @@ public class ReferenceModel_ReferenceSer
 		class C {
 			@SuppressWarnings("rawtypes")
 			@Inject
-			public void set(@Reference Instance<ReferenceServiceObjects> m) {};
+			public void set(@Reference Instance<BeanServiceObjects> m) {};
 		}
 
 		InjectionPoint injectionPoint = new MockInjectionPoint(C.class.getMethod("set", Instance.class).getParameters()[0]);

Modified: aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarAnnotated.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarAnnotated.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarAnnotated.java (original)
+++ aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarAnnotated.java Wed Apr 18 15:13:46 2018
@@ -28,7 +28,7 @@ import org.osgi.service.cdi.Configuratio
 import org.osgi.service.cdi.annotations.Configuration;
 import org.osgi.service.cdi.annotations.Greedy;
 import org.osgi.service.cdi.annotations.PID;
-import org.osgi.service.cdi.annotations.Prototype;
+import org.osgi.service.cdi.annotations.PrototypeRequired;
 import org.osgi.service.cdi.annotations.Reference;
 import org.osgi.service.cdi.annotations.Service;
 
@@ -52,7 +52,7 @@ public class BarAnnotated {
 	Collection<Map.Entry<Map<String, Object>, Integer>> tupleIntegers;
 
 	@Inject
-	@Prototype
+	@PrototypeRequired
 	@Reference
 	Collection<ServiceReference<Foo>> serviceReferencesFoos;
 

Modified: aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarProducer.java
URL: http://svn.apache.org/viewvc/aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarProducer.java?rev=1829454&r1=1829453&r2=1829454&view=diff
==============================================================================
--- aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarProducer.java (original)
+++ aries/trunk/cdi/cdi-extender/src/test/java/org/apache/aries/cdi/container/test/beans/BarProducer.java Wed Apr 18 15:13:46 2018
@@ -14,14 +14,16 @@
 
 package org.apache.aries.cdi.container.test.beans;
 
+import static org.osgi.service.cdi.ServiceInstanceType.*;
+
 import java.math.BigDecimal;
 
 import javax.enterprise.inject.Produces;
 
 import org.apache.aries.cdi.extra.propertytypes.ServiceRanking;
-import org.osgi.service.cdi.annotations.Bundle;
 import org.osgi.service.cdi.annotations.Reference;
 import org.osgi.service.cdi.annotations.Service;
+import org.osgi.service.cdi.annotations.ServiceInstance;
 
 public class BarProducer {
 	@Produces
@@ -32,7 +34,7 @@ public class BarProducer {
 
 	@Produces
 	@Service(Integer.class)
-	@Bundle
+	@ServiceInstance(BUNDLE)
 	@ServiceRanking(100)
 	Number fum = new BigDecimal(25);
 



Mime
View raw message