Package org.elasticsearch.common.inject.spi

Examples of org.elasticsearch.common.inject.spi.InjectionPoint$Factory


    }

    public static void formatSource(Formatter formatter, Object source) {
        if (source instanceof Dependency) {
            Dependency<?> dependency = (Dependency<?>) source;
            InjectionPoint injectionPoint = dependency.getInjectionPoint();
            if (injectionPoint != null) {
                formatInjectionPoint(formatter, dependency, injectionPoint);
            } else {
                formatSource(formatter, dependency.getKey());
            }
View Full Code Here


    private <T> ConstructorInjector<T> createConstructor(TypeLiteral<T> type, Errors errors)
            throws ErrorsException {
        int numErrorsBefore = errors.size();

        InjectionPoint injectionPoint;
        try {
            injectionPoint = InjectionPoint.forConstructorOf(type);
        } catch (ConfigurationException e) {
            errors.merge(e.getErrorMessages());
            throw errors.toException();
        }

        SingleParameterInjector<?>[] constructorParameterInjectors
                = injector.getParametersInjectors(injectionPoint.getDependencies(), errors);
        MembersInjectorImpl<T> membersInjector = injector.membersInjectorStore.get(type, errors);

        ConstructionProxyFactory<T> factory = new DefaultConstructionProxyFactory<T>(injectionPoint);

        errors.throwIfNewErrors(numErrorsBefore);
View Full Code Here

                        loggerFactory, ImmutableSet.<InjectionPoint>of()));
    }

    private static class LoggerFactory implements InternalFactory<Logger>, Provider<Logger> {
        public Logger get(Errors errors, InternalContext context, Dependency<?> dependency) {
            InjectionPoint injectionPoint = dependency.getInjectionPoint();
            return injectionPoint == null
                    ? Logger.getAnonymousLogger()
                    : Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
        }
View Full Code Here

    private <T> ConstructorInjector<T> createConstructor(TypeLiteral<T> type, Errors errors)
            throws ErrorsException {
        int numErrorsBefore = errors.size();

        InjectionPoint injectionPoint;
        try {
            injectionPoint = InjectionPoint.forConstructorOf(type);
        } catch (ConfigurationException e) {
            errors.merge(e.getErrorMessages());
            throw errors.toException();
        }

        SingleParameterInjector<?>[] constructorParameterInjectors
                = injector.getParametersInjectors(injectionPoint.getDependencies(), errors);
        MembersInjectorImpl<T> membersInjector = injector.membersInjectorStore.get(type, errors);

        ConstructionProxyFactory<T> factory = new DefaultConstructionProxyFactory<>(injectionPoint);

        errors.throwIfNewErrors(numErrorsBefore);
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.inject.spi.InjectionPoint$Factory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.