Search in sources :

Example 1 with ExposedBindingImpl

use of org.elasticsearch.common.inject.internal.ExposedBindingImpl in project elasticsearch by elastic.

the class BindingProcessor method isOkayDuplicate.

/**
     * We tolerate duplicate bindings only if one exposes the other.
     *
     * @param original the binding in the parent injector (candidate for an exposing binding)
     * @param binding  the binding to check (candidate for the exposed binding)
     */
private boolean isOkayDuplicate(Binding<?> original, BindingImpl<?> binding) {
    if (original instanceof ExposedBindingImpl) {
        ExposedBindingImpl exposed = (ExposedBindingImpl) original;
        InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector();
        return (exposedFrom == binding.getInjector());
    }
    return false;
}
Also used : ExposedBindingImpl(org.elasticsearch.common.inject.internal.ExposedBindingImpl)

Example 2 with ExposedBindingImpl

use of org.elasticsearch.common.inject.internal.ExposedBindingImpl in project crate by crate.

the class BindingProcessor method isOkayDuplicate.

/**
 * We tolerate duplicate bindings only if one exposes the other.
 *
 * @param original the binding in the parent injector (candidate for an exposing binding)
 * @param binding  the binding to check (candidate for the exposed binding)
 */
private boolean isOkayDuplicate(Binding<?> original, BindingImpl<?> binding) {
    if (original instanceof ExposedBindingImpl) {
        ExposedBindingImpl exposed = (ExposedBindingImpl) original;
        InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector();
        return (exposedFrom == binding.getInjector());
    }
    return false;
}
Also used : ExposedBindingImpl(org.elasticsearch.common.inject.internal.ExposedBindingImpl)

Aggregations

ExposedBindingImpl (org.elasticsearch.common.inject.internal.ExposedBindingImpl)2