Search in sources :

Example 1 with MutableReferenceListener

use of org.apache.aries.blueprint.mutable.MutableReferenceListener in project aries by apache.

the class AbstractPropertyPlaceholder method processServiceReferenceMetadata.

private Metadata processServiceReferenceMetadata(ServiceReferenceMetadata component) {
    if (component instanceof MutableServiceReferenceMetadata) {
        ValueMetadata valueMetadata = ((MutableServiceReferenceMetadata) component).getExtendedFilter();
        if (valueMetadata != null) {
            ((MutableServiceReferenceMetadata) component).setExtendedFilter(doProcessValueMetadata(valueMetadata));
        }
    }
    for (ReferenceListener listener : component.getReferenceListeners()) {
        Target listenerComponent = listener.getListenerComponent();
        try {
            processingStack.add("Reference Listener " + listenerComponent + "->");
            if (listener instanceof MutableReferenceListener) {
                ((MutableReferenceListener) listener).setListenerComponent((Target) processMetadata(listenerComponent));
            } else {
                //Say that we can't change this listener, but continue processing
                //If the value is mutable then we may be ok!
                printWarning(listener, "Reference Binding Listener");
                processMetadata(listenerComponent);
            }
        } finally {
            processingStack.removeLast();
        }
    }
    return component;
}
Also used : MutableReferenceListener(org.apache.aries.blueprint.mutable.MutableReferenceListener) Target(org.osgi.service.blueprint.reflect.Target) ValueMetadata(org.osgi.service.blueprint.reflect.ValueMetadata) MutableReferenceListener(org.apache.aries.blueprint.mutable.MutableReferenceListener) ReferenceListener(org.osgi.service.blueprint.reflect.ReferenceListener) MutableServiceReferenceMetadata(org.apache.aries.blueprint.mutable.MutableServiceReferenceMetadata)

Aggregations

MutableReferenceListener (org.apache.aries.blueprint.mutable.MutableReferenceListener)1 MutableServiceReferenceMetadata (org.apache.aries.blueprint.mutable.MutableServiceReferenceMetadata)1 ReferenceListener (org.osgi.service.blueprint.reflect.ReferenceListener)1 Target (org.osgi.service.blueprint.reflect.Target)1 ValueMetadata (org.osgi.service.blueprint.reflect.ValueMetadata)1