Package org.apache.webbeans.container

Examples of org.apache.webbeans.container.ManagerImpl


   
    private void validateInjectionPoints()
    {
        logger.info("Validation injection points is started");
       
        ManagerImpl manager = ManagerImpl.getManager();
        InjectionResolver resolver = InjectionResolver.getInstance();
        Set<Bean<?>> beans = manager.getBeans();
       
        if(beans != null && beans.size() > 0)
        {
            for(Bean<?> bean : beans)
            {
View Full Code Here


    private List<AbstractComponent<?>> componentList = new ArrayList<AbstractComponent<?>>();

    public MockManager()
    {
        this.manager = new ManagerImpl();
        ActivityManager.getInstance().setRootActivity(this.manager);
    }
View Full Code Here

    public void clear()
    {
        componentList.clear();       
       
        this.manager = new ManagerImpl();       
    
        ActivityManager.getInstance().setRootActivity(this.manager);       
    }
View Full Code Here

     * @return the current activity
     * @throws WebBeansException if more than one current activity exist
     */
    public ManagerImpl getCurrentActivity()
    {
        ManagerImpl currentActivity = null;
       
        Set<Context> contexts = this.currentActivityMap.keySet();
        List<ManagerImpl> managers = new ArrayList<ManagerImpl>();
        for(Context context : contexts)
        {
View Full Code Here

    }

    public static NotificationManager getInstance()
    {
        ManagerImpl manager =  ActivityManager.getInstance().getCurrentActivity();
       
        return manager.getNotificationManager();
    }
View Full Code Here

   
    private ManagerImpl rootManager = null;

    public WebBeansLifeCycle()
    {
        this.rootManager = new ManagerImpl();
        this.xmlDeployer = new WebBeansXMLConfigurator();
        this.deployer = new WebBeansContainerDeployer(xmlDeployer);
        this.jndiService = ServiceLoader.getService(JNDIService.class);
       
        rootManager.setXMLConfigurator(this.xmlDeployer);
View Full Code Here

   
    private void validateInjectionPoints()
    {
        logger.info("Validation of injection points are started");

        ManagerImpl manager = ManagerImpl.getManager();       
        Set<Bean<?>> beans = new HashSet<Bean<?>>();
       
        //Adding decorators to validate
        Set<Decorator> decorators = manager.getDecorators();
        for(Decorator decorator : decorators)
        {
            WebBeansDecorator wbDec = (WebBeansDecorator)decorator;
            beans.add(wbDec.getDelegateComponent());
        }
       
       
        logger.info("Validation of the decorator's injection points are started");
       
        //Validate Decorators
        validate(beans);
       
        beans.clear();
       
        //Adding interceptors to validate
        Set<javax.inject.manager.Interceptor> interceptors = manager.getInterceptors();
        for(javax.inject.manager.Interceptor interceptor : interceptors)
        {
            WebBeansInterceptor wbInt = (WebBeansInterceptor)interceptor;
            beans.add(wbInt.getDelegate());
        }
View Full Code Here

     * @return the newly created Simple WebBean Component
     * @throws WebBeansConfigurationException if any configuration exception occurs
     */
    public static <T> ComponentImpl<T> define(Class<T> clazz, WebBeansType type) throws WebBeansConfigurationException
    {
        ManagerImpl manager = ManagerImpl.getManager();

        checkSimpleWebBeanCondition(clazz);

        ComponentImpl<T> component = new ComponentImpl<T>(clazz, type);

        DefinitionUtil.defineSerializable(component);
        DefinitionUtil.defineStereoTypes(component, clazz.getDeclaredAnnotations());

        Class<? extends Annotation> deploymentType = DefinitionUtil.defineDeploymentType(component, clazz.getDeclaredAnnotations(), "There are more than one @DeploymentType annotation in Simple WebBean Component implementation class : " + component.getReturnType().getName());

        // Check if the deployment type is enabled.
        if (!WebBeansUtil.isDeploymentTypeEnabled(deploymentType))
        {
            return null;
        }

        Annotation[] clazzAnns = clazz.getDeclaredAnnotations();

        DefinitionUtil.defineApiTypes(component, clazz);
        DefinitionUtil.defineScopeType(component, clazzAnns, "Simple WebBean Component implementation class : " + clazz.getName() + " stereotypes must declare same @ScopeType annotations");
        WebBeansUtil.checkPassivationScope(component, component.getScopeType().getAnnotation(ScopeType.class));
        DefinitionUtil.defineBindingTypes(component, clazzAnns);
        DefinitionUtil.defineName(component, clazzAnns, WebBeansUtil.getSimpleWebBeanDefaultName(clazz.getSimpleName()));

        Constructor<T> constructor = WebBeansUtil.defineConstructor(clazz);
        component.setConstructor(constructor);
        DefinitionUtil.addConstructorInjectionPointMetaData(component, constructor);

        WebBeansUtil.checkSteroTypeRequirements(component, clazz.getDeclaredAnnotations(), "Simple WebBean Component implementation class : " + clazz.getName());

        Set<ProducerComponentImpl<?>> producerComponents = DefinitionUtil.defineProducerMethods(component);
        manager.getBeans().addAll(producerComponents);

        Set<ProducerFieldComponent<?>> producerFields = DefinitionUtil.defineProduerFields(component);
        manager.getBeans().addAll(producerFields);

        DefinitionUtil.defineDisposalMethods(component);
        DefinitionUtil.defineInjectedFields(component);
        DefinitionUtil.defineInjectedMethods(component);
        DefinitionUtil.defineObserverMethods(component, clazz);
View Full Code Here

TOP

Related Classes of org.apache.webbeans.container.ManagerImpl

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.