Package com.caucho.config.inject

Examples of com.caucho.config.inject.InjectManager$InjectBean


        _decoratorClass = method.invoke(null);
     
        Annotation []qualifiers = new Annotation[getBean().getQualifiers().size()];
        getBean().getQualifiers().toArray(qualifiers);
       
        InjectManager moduleBeanManager = InjectManager.create();

        _decoratorBeans = moduleBeanManager.resolveDecorators(getBean().getTypes(), qualifiers);
     
        method = instanceClass.getMethod("__caucho_init_decorators",
                                         List.class);
       
     
View Full Code Here


                           ArrayList<AnnotatedType<? super X>> remoteApi)
  {
    super(ejbName, beanType, localApi, localBean, remoteApi,
          Stateful.class.getSimpleName());

    InjectManager manager = InjectManager.create();

    _aspectBeanFactory
      = new StatefulAspectBeanFactory<X>(manager, getBeanType());
    _lifecycleAspectFactory
      = new LifecycleAspectBeanFactory<X>(_aspectBeanFactory, manager, getBeanType());
View Full Code Here

 
  public MessageGenerator(String ejbName, AnnotatedType<X> ejbClass)
  {
    super(toFullClassName(ejbName, ejbClass.getJavaClass().getName()), ejbClass);
   
    InjectManager manager = InjectManager.create();
   
    _aspectBeanFactory = new MessageAspectBeanFactory<X>(manager, getBeanType());
    _lifecycleAspectFactory = new LifecycleAspectBeanFactory<X>(_aspectBeanFactory, manager, getBeanType());
  }
View Full Code Here

 
  public ServerAuthManager()
  {
    _security = SecurityService.getCurrent();
   
    InjectManager cdiManager = InjectManager.getCurrent();
   
    _auth = cdiManager.getReference(Authenticator.class);
  }
View Full Code Here

  private void startActor(Bean bean,
                          String name,
                          int threadMax)
  {
    InjectManager beanManager = InjectManager.getCurrent();

    ActorHolder actor = (ActorHolder) beanManager.getReference(bean);

    actor.setBroker(this);

    String address = name;
View Full Code Here

    Environment.addCloseListener(new ActorClose(mailbox));
  }

  private void startActor(Bean bean, AdminService bamService)
  {
    InjectManager beanManager = InjectManager.getCurrent();

    ActorHolder actor = (ActorHolder) beanManager.getReference(bean);

    actor.setBroker(this);

    String address = bamService.name();
View Full Code Here

  {
    ProtocolProxyFactory proxyFactory = (ProtocolProxyFactory) getObject();

    Object proxy = proxyFactory.createProxy(iface);

    InjectManager beanManager = InjectManager.create();
   
    BeanBuilder<T> builder = beanManager.createBeanFactory(iface);

    if (getName() != null) {
      builder = builder.name(getName());

      addOptionalStringProperty("name", getName());
     
      builder.qualifier(Names.create(getName()));
     
      if (getBindingList().size() == 0)
        builder.qualifier(DefaultLiteral.DEFAULT);
    }

    for (Annotation binding : getBindingList()) {
      builder = builder.qualifier(binding);
    }

    for (Annotation stereotype : getStereotypeList()) {
      builder = builder.stereotype(stereotype.annotationType());
    }

    builder.stereotype(Configured.class);

    _bean = builder.singleton(proxy);

    beanManager.addBean(_bean);
  }
View Full Code Here

      if (_servletContext instanceof WebApp)
        ((WebApp) _servletContext).createJsp().setLoadTldOnInit(true);
    }

    InjectManager cdiManager = InjectManager.create();
    cdiManager.addConfiguredBean(servletClassName);
   
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    try {
      _servletClass = Class.forName(servletClassName, false, loader);

      if (_comp == null) {
        _comp = cdiManager.createInjectionTarget(_servletClass);
      }
    } catch (ClassNotFoundException e) {
      log.log(Level.ALL, e.toString(), e);
    }
  }
View Full Code Here

      } catch (NamingException e) {
        throw new ServletException(e);
      }
    }

    InjectManager cdiManager = InjectManager.create();

    if (_var != null) {
      validateClass(true);

      Object servlet = createServlet(false);

      BeanBuilder factory = cdiManager.createBeanFactory(servlet.getClass());
      if (_var != null)
        factory.name(_var);

      cdiManager.addBean(factory.singleton(servlet));
    }
  }
View Full Code Here

  {
    if (_bean != null) {
      // XXX: need to ask manager?
      CreationalContextImpl<?> env = new OwnerCreationalContext(_bean);
     
      InjectManager cdiManager = InjectManager.create();
     
      // server/5130
      Object value = cdiManager.findReference(_bean);
     
      if (value != null)
        return value;
      else
        return _bean.create(env);
    }

    Class<?> servletClass = getServletClass();

    Object servlet;
    if (_jspFile != null) {
      servlet = createJspServlet(_servletName, _jspFile);

      if (servlet == null)
        throw new ServletException(L.l("'{0}' is a missing JSP file.",
                                       _jspFile));
    }

    else if (servletClass != null) {
      InjectManager inject = InjectManager.create();

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

      CreationalContextImpl env = new OwnerCreationalContext(null);

      try {
View Full Code Here

TOP

Related Classes of com.caucho.config.inject.InjectManager$InjectBean

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.