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;
}
Aggregations