All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.weld.bootstrap.event.WeldBeanConfigurator Maven / Gradle / Ivy

Go to download

This jar bundles all the bits of Weld and CDI required for running in a Servlet container.

There is a newer version: 6.0.0.Beta4
Show newest version
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2017, Red Hat, Inc., and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.bootstrap.event;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Function;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.BeanAttributes;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.Prioritized;
import javax.enterprise.inject.spi.configurator.BeanConfigurator;
import javax.enterprise.util.TypeLiteral;
import javax.interceptor.Interceptor.Priority;

/**
 * Represents an enhanced version of {@link BeanConfigurator}
 *
 * @author Matej Novotny
 */
public interface WeldBeanConfigurator extends BeanConfigurator {

    @Override
    WeldBeanConfigurator alternative(boolean value);

    @Override
    WeldBeanConfigurator name(String name);

    @Override
    WeldBeanConfigurator stereotypes(Set> stereotypes);

    @Override
    WeldBeanConfigurator addStereotypes(Set> stereotypes);

    @Override
    WeldBeanConfigurator addStereotype(Class stereotype);

    @Override
    WeldBeanConfigurator qualifiers(Set qualifiers);

    @Override
    WeldBeanConfigurator qualifiers(Annotation... qualifiers);

    @Override
    WeldBeanConfigurator addQualifiers(Set qualifiers);

    @Override
    WeldBeanConfigurator addQualifiers(Annotation... qualifiers);

    @Override
    WeldBeanConfigurator addQualifier(Annotation qualifier);

    @Override
    WeldBeanConfigurator scope(Class scope);

    @Override
    WeldBeanConfigurator types(Set types);

    @Override
    WeldBeanConfigurator types(Type... types);

    @Override
    WeldBeanConfigurator addTransitiveTypeClosure(Type type);

    @Override
    WeldBeanConfigurator addTypes(Set types);

    @Override
    WeldBeanConfigurator addTypes(Type... types);

    @Override
    WeldBeanConfigurator addType(TypeLiteral typeLiteral);

    @Override
    WeldBeanConfigurator addType(Type type);

    @Override
    WeldBeanConfigurator read(BeanAttributes beanAttributes);

    @Override
     WeldBeanConfigurator read(AnnotatedType type);

    @Override
    WeldBeanConfigurator disposeWith(BiConsumer> callback);

    @Override
    WeldBeanConfigurator destroyWith(BiConsumer> callback);

    @Override
     WeldBeanConfigurator produceWith(Function, U> callback);

    @Override
     WeldBeanConfigurator createWith(Function, U> callback);

    @Override
    WeldBeanConfigurator id(String id);

    @Override
    WeldBeanConfigurator injectionPoints(Set injectionPoints);

    @Override
    WeldBeanConfigurator injectionPoints(InjectionPoint... injectionPoints);

    @Override
    WeldBeanConfigurator addInjectionPoints(Set injectionPoints);

    @Override
    WeldBeanConfigurator addInjectionPoints(InjectionPoint... injectionPoints);

    @Override
    WeldBeanConfigurator addInjectionPoint(InjectionPoint injectionPoint);

    @Override
    WeldBeanConfigurator beanClass(Class beanClass);

    /**
     * Allows to set a priority to an alternative bean hence selecting it globally.
     * Has the same effect as putting {@link Priority} annotation on an actual bean class
     * or implementing {@link Prioritized} interface with custom bean classes.
     * This method has no effect on custom beans which are not alternatives.
     *
     * @param priority the priority of this bean
     * @return self
     */
    WeldBeanConfigurator priority(int priority);
}