Search in sources :

Example 1 with PrivateBinder

use of org.elasticsearch.common.inject.PrivateBinder in project elasticsearch by elastic.

the class PrivateElementsImpl method applyTo.

@Override
public void applyTo(Binder binder) {
    PrivateBinder privateBinder = binder.withSource(source).newPrivateBinder();
    for (Element element : getElements()) {
        element.applyTo(privateBinder);
    }
    // ensure exposedKeysToSources is populated
    getExposedKeys();
    for (Map.Entry<Key<?>, Object> entry : exposedKeysToSources.entrySet()) {
        privateBinder.withSource(entry.getValue()).expose(entry.getKey());
    }
}
Also used : PrivateBinder(org.elasticsearch.common.inject.PrivateBinder) Element(org.elasticsearch.common.inject.spi.Element) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) Key(org.elasticsearch.common.inject.Key)

Aggregations

Collections.unmodifiableMap (java.util.Collections.unmodifiableMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Key (org.elasticsearch.common.inject.Key)1 PrivateBinder (org.elasticsearch.common.inject.PrivateBinder)1 Element (org.elasticsearch.common.inject.spi.Element)1