Package org.jboss.weld.injection

Examples of org.jboss.weld.injection.CurrentInjectionPoint.push()


        // Generate a correct injection point for the bean, we do this by taking the original injection point and adjusting the
        // qualifiers and type
        InjectionPoint ip = new DynamicLookupInjectionPoint(getInjectionPoint(), getType(), getQualifiers());
        CurrentInjectionPoint currentInjectionPoint = getBeanManager().getServices().get(CurrentInjectionPoint.class);
        try {
            currentInjectionPoint.push(ip);
            return Reflections.<T> cast(getBeanManager().getReference(bean, getType(), getCreationalContext()));
        } finally {
            currentInjectionPoint.pop();
        }
    }
View Full Code Here


    public Set<Bean<?>> getBeans(InjectionPoint injectionPoint) {
        boolean registerInjectionPoint = isRegisterableInjectionPoint(injectionPoint);
        CurrentInjectionPoint currentInjectionPoint = null;
        if (registerInjectionPoint) {
            currentInjectionPoint = services.get(CurrentInjectionPoint.class);
            currentInjectionPoint.push(injectionPoint);
        }
        try {
            // We always cache, we assume that people don't use inline annotation literal declarations, a little risky but FAQd
            return beanResolver.resolve(new ResolvableBuilder(injectionPoint, this).create(), true);
        } finally {
View Full Code Here

        boolean delegateInjectionPoint = injectionPoint != null && injectionPoint.isDelegate();

        CurrentInjectionPoint currentInjectionPoint = null;
        if (registerInjectionPoint) {
            currentInjectionPoint = services.get(CurrentInjectionPoint.class);
            currentInjectionPoint.push(injectionPoint);
        }
        try {
            Type requestedType = null;
            if (injectionPoint != null) {
                requestedType = injectionPoint.getType();
View Full Code Here

        }
        final CurrentInjectionPoint currentInjectionPoint = container.services().get(CurrentInjectionPoint.class);
        currentCreationalContext.set(creationalContext);
        try {
            // Ensure that there is no injection point associated
            currentInjectionPoint.push(EmptyInjectionPoint.INSTANCE);
            return context.get(bean, creationalContext);
        } finally {
            currentInjectionPoint.pop();
            if (previousCreationalContext == null) {
                currentCreationalContext.remove();
View Full Code Here

    public Object invoke(Object o, Method method, Object[] parameters) throws Throwable {
        T instance;

        if (createdTypeData.isConstructorInjection()) {
            CurrentInjectionPoint currentInjectionPoint = Container.instance().services().get(CurrentInjectionPoint.class);
            currentInjectionPoint.push(ConstructorInjectionPoint.of(bean, (WeldConstructor<T>) createdTypeData.getCreatedTypeConstructor()));
            instance = newInstance(parameters);
            currentInjectionPoint.pop();
        } else {
            instance = newInstance(parameters);
            createdTypeData.getCreatedTypeInjectionTarget().inject(instance, creationalContext);
View Full Code Here

    @Override
    public Object getValue(BeanManager bm, Object[] factoryParameters) {
        CurrentInjectionPoint currentInjectionPointStack = Container.instance().services().get(CurrentInjectionPoint.class);
        ConstructorInjectionPoint currentInjectionPoint = (ConstructorInjectionPoint) currentInjectionPointStack.peek();
        currentInjectionPointStack.push(findParameterInjectionPoint(currentInjectionPoint));

        Object result = BeanInject.lookup(bm, beanType, qualifiers);

        currentInjectionPointStack.pop();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.