use of org.apache.aries.blueprint.ExtendedServiceReferenceMetadata in project aries by apache.
the class RecipeBuilder method createReferenceListRecipe.
private Recipe createReferenceListRecipe(ReferenceListMetadata 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));
}
}
ReferenceListRecipe recipe = new ReferenceListRecipe(getName(metadata.getId()), blueprintContainer, metadata, filterRecipe, listenersRecipe, getDependencies(metadata));
return recipe;
}
use of org.apache.aries.blueprint.ExtendedServiceReferenceMetadata 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