Search in sources :

Example 6 with ReferenceListener

use of org.osgi.service.blueprint.reflect.ReferenceListener in project aries by apache.

the class RecipeBuilder method createReferenceRecipe.

private ReferenceRecipe createReferenceRecipe(ReferenceMetadata metadata) {
    ValueRecipe filterRecipe = null;
    if (metadata instanceof ExtendedReferenceMetadata) {
        ValueMetadata filterMetadata = ((ExtendedServiceReferenceMetadata) metadata).getExtendedFilter();
        if (filterMetadata != null) {
            filterRecipe = (ValueRecipe) getValue(filterMetadata, null);
        }
    }
    CollectionRecipe listenersRecipe = null;
    if (metadata.getReferenceListeners() != null) {
        listenersRecipe = new CollectionRecipe(getName(null), ArrayList.class, Object.class.getName());
        for (ReferenceListener listener : metadata.getReferenceListeners()) {
            listenersRecipe.add(createRecipe(listener));
        }
    }
    ReferenceRecipe recipe = new ReferenceRecipe(getName(metadata.getId()), blueprintContainer, metadata, filterRecipe, listenersRecipe, getDependencies(metadata));
    return recipe;
}
Also used : ExtendedReferenceMetadata(org.apache.aries.blueprint.ExtendedReferenceMetadata) ValueMetadata(org.osgi.service.blueprint.reflect.ValueMetadata) ArrayList(java.util.ArrayList) ReferenceListener(org.osgi.service.blueprint.reflect.ReferenceListener) ExtendedServiceReferenceMetadata(org.apache.aries.blueprint.ExtendedServiceReferenceMetadata) ValueRecipe(org.apache.aries.blueprint.di.ValueRecipe) CollectionRecipe(org.apache.aries.blueprint.di.CollectionRecipe)

Aggregations

ReferenceListener (org.osgi.service.blueprint.reflect.ReferenceListener)6 ValueMetadata (org.osgi.service.blueprint.reflect.ValueMetadata)3 ArrayList (java.util.ArrayList)2 ExtendedReferenceMetadata (org.apache.aries.blueprint.ExtendedReferenceMetadata)2 ExtendedServiceReferenceMetadata (org.apache.aries.blueprint.ExtendedServiceReferenceMetadata)2 CollectionRecipe (org.apache.aries.blueprint.di.CollectionRecipe)2 ValueRecipe (org.apache.aries.blueprint.di.ValueRecipe)2 BeanArgument (org.osgi.service.blueprint.reflect.BeanArgument)2 BeanMetadata (org.osgi.service.blueprint.reflect.BeanMetadata)2 BeanProperty (org.osgi.service.blueprint.reflect.BeanProperty)2 MapEntry (org.osgi.service.blueprint.reflect.MapEntry)2 RegistrationListener (org.osgi.service.blueprint.reflect.RegistrationListener)2 ServiceMetadata (org.osgi.service.blueprint.reflect.ServiceMetadata)2 ServiceReferenceMetadata (org.osgi.service.blueprint.reflect.ServiceReferenceMetadata)2 WrappedServiceMetadata (org.apache.aries.application.modelling.WrappedServiceMetadata)1 ExtendedBeanMetadata (org.apache.aries.blueprint.ExtendedBeanMetadata)1 MutableReferenceListener (org.apache.aries.blueprint.mutable.MutableReferenceListener)1 MutableServiceReferenceMetadata (org.apache.aries.blueprint.mutable.MutableServiceReferenceMetadata)1 CollectionMetadata (org.osgi.service.blueprint.reflect.CollectionMetadata)1 ComponentMetadata (org.osgi.service.blueprint.reflect.ComponentMetadata)1