Examples of CreationalContextImpl


Examples of com.caucho.config.inject.CreationalContextImpl

      if (_comp == null) {
        _comp = inject.createInjectionTarget(servletClass);
      }

      CreationalContextImpl env = new OwnerCreationalContext(null);

      try {
        // server/1b40
        if (_comp != null) {
          servlet = _comp.produce(env);
View Full Code Here

Examples of com.caucho.config.inject.CreationalContextImpl

  public T getLocalObject(Class<?> api)
  {
    SingletonProxyFactory factory = getSessionContext().getProxyFactory(api);

    if (factory != null) {
      CreationalContextImpl env = new CreationalContextImpl();
      // XXX: should be bean
      return (T) factory.__caucho_createNew(null, env);
    } else
      return null;
  }
View Full Code Here

Examples of com.caucho.config.inject.CreationalContextImpl

       
        if (value != null)
          return value;
      }
     
      cxt = new CreationalContextImpl(bean, cxt);
    }
    else {
      cxt = new CreationalContextImpl(bean, null);
    }
   
    Object result = webBeans.getReference(bean, bean.getBeanClass(), cxt);

    if (result != null) {
View Full Code Here

Examples of com.caucho.config.inject.CreationalContextImpl

  public Object eval(CreationalContext<T> parentEnv)
  {
    if (_bean == null)
      bind();

    CreationalContext<T> beanEnv = new CreationalContextImpl(_bean, parentEnv);
   
    // XXX: getInstance for injection?
    return _beanManager.getReference(_bean, _type, beanEnv);
  }
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

    public Object getDependent(Component<?> dependentComponent)
    {
        Object object = null;
        DependentContext context = (DependentContext) getManager().getContext(Dependent.class);

        object = context.get(dependentComponent,new CreationalContextImpl());

        this.dependentObjects.put(object, dependentComponent);

        return object;
    }
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

    @SuppressWarnings("unchecked")
    public Object invoke(Object instance, Method method, Method proceed, Object[] arguments) throws Exception
    {
        Context webbeansContext = ManagerImpl.getManager().getContext(component.getScopeType());
        Object webbeansInstance = webbeansContext.get(this.component, new CreationalContextImpl());

        if (!ClassUtil.isObjectMethod(method.getName()) && InterceptorUtil.isWebBeansBusinessMethod(method))
        {
            if (this.calledMethod == null)
            {
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

            if (bm.isInUse()) { // try cdi bean
                if (JAXWS_AS_CDI_BEANS) {
                    try {
                        final Set<Bean<?>> beans = bm.getBeans(instance);
                        final Bean<?> bean = bm.resolve(beans);
                        final CreationalContextImpl creationalContext = bm.createCreationalContext(bean);
                        if (bean != null) {
                            final Bean<?> oldBean = creationalContext.putBean(bean);
                            try {
                                if (AbstractOwbBean.class.isInstance(bean)) {
                                    final AbstractOwbBean<?> aob = AbstractOwbBean.class.cast(bean);

                                    final Producer producer = aob.getProducer();
                                    implementor = producer.produce(creationalContext);
                                    if (producer instanceof InjectionTarget) {
                                        final InjectionTarget injectionTarget = (InjectionTarget) producer;
                                        injectionTarget.inject(implementor, creationalContext);
                                        injector = injectCxfResources(implementor); // we need it before postconstruct
                                        injectionTarget.postConstruct(implementor);
                                    }
                                    if (aob.getScope().equals(Dependent.class)) {
                                        creationalContext.addDependent(aob, instance);
                                    }
                                }
                            } finally {
                                creationalContext.putBean(oldBean);
                            }
                        } else {
                            implementor = bm.getReference(bean, instance, creationalContext);
                            injector = injectCxfResources(implementor);
                        }
                        if (WebBeansUtil.isDependent(bean)) { // should be isPseudoScope but should be ok for jaxws
                            toClean = creationalContext;
                        }
                    } catch (final Exception ie) {
                        LOGGER.info("Can't use cdi to create " + instance + " webservice: " + ie.getMessage());
                    }
                }
            }
            if (implementor == null) { // old pojo style
                final InjectionProcessor<Object> injectionProcessor = new InjectionProcessor<Object>(instance, port.getInjections(), null, null, unwrap(context), bindings);
                injectionProcessor.createInstance();
                implementor = injectionProcessor.getInstance();
                injector = injectCxfResources(implementor);
                if (!JAXWS_AS_CDI_BEANS && bm.isInUse()) {
                    final CreationalContextImpl creationalContext = bm.createCreationalContext(null);
                    OWBInjector.inject(bm, implementor, null);
                    toClean = creationalContext;
                }
                injector.invokePostConstruct();
            }
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

            if (bm.isInUse()) { // try cdi bean
                if (JAXWS_AS_CDI_BEANS) {
                    try {
                        final Set<Bean<?>> beans = bm.getBeans(instance);
                        final Bean<?> bean = bm.resolve(beans);
                        CreationalContextImpl creationalContext = bm.createCreationalContext(bean);
                        if (bean != null) {
                            Bean<?> oldBean = creationalContext.putBean(bean);
                            try {
                                if (AbstractOwbBean.class.isInstance(bean)) {
                                    final AbstractOwbBean<?> aob = AbstractOwbBean.class.cast(bean);

                                    final Producer producer = aob.getProducer();
                                    implementor = producer.produce(creationalContext);
                                    if (producer instanceof InjectionTarget) {
                                        final InjectionTarget injectionTarget = (InjectionTarget) producer;
                                        injectionTarget.inject(implementor, creationalContext);
                                        injector = injectCxfResources(implementor); // we need it before postconstruct
                                        injectionTarget.postConstruct(implementor);
                                    }
                                    if (aob.getScope().equals(Dependent.class)) {
                                        creationalContext.addDependent(aob, instance);
                                    }
                                }
                            } finally {
                                creationalContext.putBean(oldBean);
                            }
                        } else {
                            implementor = bm.getReference(bean, instance, creationalContext);
                            injector = injectCxfResources(implementor);
                        }
                        if (WebBeansUtil.isDependent(bean)) { // should be isPseudoScope but should be ok for jaxws
                            toClean = creationalContext;
                        }
                    } catch (final Exception ie) {
                        LOGGER.info("Can't use cdi to create " + instance + " webservice: " + ie.getMessage());
                    }
                }
            }
            if (implementor == null) { // old pojo style
                final InjectionProcessor<Object> injectionProcessor = new InjectionProcessor<Object>(instance, port.getInjections(), null, null, unwrap(context), bindings);
                injectionProcessor.createInstance();
                implementor = injectionProcessor.getInstance();
                injector = injectCxfResources(implementor);
                if (!JAXWS_AS_CDI_BEANS && bm.isInUse()) {
                    final CreationalContextImpl creationalContext = bm.createCreationalContext(null);
                    OWBInjector.inject(bm, implementor, null);
                    toClean = creationalContext;
                }
                injector.invokePostConstruct();
            }
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

        List<AbstractComponent<?>> comps = getComponents();

        Assert.assertEquals(4, getDeployedComponents());

        ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(0), new CreationalContextImpl());
        ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(1), new CreationalContextImpl());
        getInstanceByName("scope");
        ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(2), new CreationalContextImpl());

        ContextFactory.destroyApplicationContext(null);
        ContextFactory.destroySessionContext(session);
        ContextFactory.destroyRequestContext(null);
View Full Code Here

Examples of org.apache.webbeans.context.creational.CreationalContextImpl

        ContextFactory.initSessionContext(session);

        Assert.assertEquals(2, comps.size());

        ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(0), new CreationalContextImpl());
        Object object = ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(1), new CreationalContextImpl());

        Assert.assertTrue(object instanceof Singleton);

        Singleton single = (Singleton) object;
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.