Package com.caucho.config.inject

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


        getInit().configure(resourceObject);

      if (_ra != null && resourceObject instanceof ResourceAdapterAssociation)
        ((ResourceAdapterAssociation) resourceObject).setResourceAdapter(_ra);

      InjectManager manager = InjectManager.create();

      BeanBuilder factory
        = manager.createBeanFactory(resourceObject.getClass());
     
      if (getName() != null) {
        Jndi.bindDeepShort(getName(), resourceObject);

        manager.addBean(factory.name(getName()).singleton(resourceObject));
      }
      else
        manager.addBean(factory.singleton(resourceObject));
    }
View Full Code Here


    throws Exception
  {
    if (_object != null)
      return _object;

    InjectManager cdiManager = InjectManager.create();
    _target = cdiManager.createInjectionTarget(_listenerClass);

    CreationalContext<T> env = cdiManager.createCreationalContext(null);

    _object = _target.produce(env);
    _target.inject(_object, env);

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

    return new CandiExpr(parser.parse());
  }
 
  public static <T> ReferenceFactory<T> getInjectFactory(Class<T> cl)
  {
    InjectManager cdiManager = InjectManager.create();
   
    Bean<T> bean = cdiManager.createManagedBean(cl);
   
    return cdiManager.getReferenceFactory(bean);
  }
View Full Code Here

  }

  @PostConstruct
  public void init()
  {
    InjectManager manager = InjectManager.create();
   
    BeanBuilder<? extends XmppProtocol> factory = manager.createBeanFactory(getClass());
    manager.addBean(factory.singleton(this));

    _marshalFactory = new XmppMarshalFactory();
  }
View Full Code Here

      page._caucho_setUpdateInterval(_updateInterval);
      page._caucho_isModified();

      try {
        InjectManager beanManager = InjectManager.create();
       
        InjectionTarget inject = beanManager.createInjectionTarget(page.getClass());

        CreationalContext<?> env = new OwnerCreationalContext(null);

        inject.inject(page, env);
       
View Full Code Here

  public JspApplicationContextImpl(WebApp webApp)
  {
    _webApp = webApp;

    InjectManager injectManager = _webApp.getBeanManager();
   
    ExpressionFactory factory = new JspExpressionFactoryImpl(this);
   
    _expressionFactory = injectManager.wrapExpressionFactory(factory);
   
    _contextLocal.set(this);
  }
View Full Code Here

        Filter filter = _instances.get(filterName);

        if (filter != null)
          return filter;

        InjectManager beanManager = InjectManager.create();

        _bean = beanManager.createInjectionTarget(filterClass);

        filter = config.getFilter();

        CreationalContext env = beanManager.createCreationalContext(null);
        if (filter == null)
          filter = (Filter) _bean.produce(env);

        _bean.inject(filter, env);
View Full Code Here

      if (brokerManager != null)
        brokerManager.addBroker(alias, _bamBroker);
    }

    InjectManager cdiManager = InjectManager.getCurrent();

    cdiManager.addBean(cdiManager.createBeanFactory(ManagedBroker.class)
                       .name("bamBroker").singleton(_bamBroker));

    // webBeans.addExtension(_bamBroker);

    // XXX: webBeans.addRegistrationListener(new BamRegisterListener());
View Full Code Here

  }

  @Override
  protected Object createTest() throws Exception
  {
    InjectManager manager = getResinContext().getInstance(InjectManager.class);

    // Make the test class a CDI bean, but do not actually register it with CDI.
    return manager.createTransientObject(_testClass);
  }
View Full Code Here

      String name = _jndiName;

      Jndi.bindDeepShort(name, this);
    }

    InjectManager manager = InjectManager.create();
    BeanFactory<?> factory = manager.createBeanFactory(DataSource.class);

    String name = _name;
   
    if (name == null)
      name = _jndiName;
   
    if (name == null)
      name = _var;

    if (_bindingList.size() > 0) {
      factory.binding(_bindingList);
    }
    else {
      if (name != null)
        factory.binding(Names.create(name));
     
      factory.binding(CurrentLiteral.CURRENT);
    }

    if (name != null)
      factory.name(name);

    // factory.stereotype(CauchoDeployment.class);

    manager.addBean(factory.singleton(this));

    _queryAdmin.register();
    _databaseAdmin.register();
  }
View Full Code Here

TOP

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

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.