Package com.caucho.config.inject

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


    if (raClass == null)
      throw error(L.l("resource-adapter class does not exist for activation-spec '{0}'.  Make sure the .rar file for the driver is properly installed.",
                      _activationSpec.getClass().getName()));

    InjectManager webBeans = InjectManager.create();

    ResourceAdapter ra
      = (ResourceAdapter) webBeans.getReference(raClass);

    if (ra == null) {
      throw error(L.l("resource-adapter '{0}' must be configured in a <connector> tag.",
                      raClass.getName()));
    }
View Full Code Here


  }
 
  @Override
  public void start()
  {
    InjectManager cdiManager = InjectManager.getCurrent();
   
    if (_authenticator == null) {
      Bean<Authenticator> bean = findAuthenticator(cdiManager);
     
      if (bean != null) {
        CreationalContext<Authenticator> env
          = cdiManager.createCreationalContext(bean);
       
        _authenticator = (Authenticator)
           cdiManager.getReference(bean, Authenticator.class, env);
      }
    }
  }
View Full Code Here

    if (getInit() != null)
      bean.setInit(getInit());

    String loc = getInstanceClass().getName() + ": ";
    InjectManager webBeans = InjectManager.create();

    bean.setMessageConsumerMax(_messageConsumerMax);

    if (_destination != null) {
      bean.setDestinationValue((Destination) _destination);
    }
    else if (_activationSpec != null) {
      bean.setActivationSpec(_activationSpec);
    }
    else {
      Class destinationType = _destinationType;

      if (_destinationType == null)
        destinationType = Destination.class;

      Set<Bean<?>> beanSet;

      if (_destinationName != null)
        beanSet = webBeans.getBeans(_destinationName);
      else
        beanSet = webBeans.getBeans(destinationType);

      Object destComp = null;

      if (beanSet.size() > 0) {
        Bean destBean = webBeans.resolve(beanSet);
        CreationalContext env = webBeans.createCreationalContext(destBean);

        destComp
          = webBeans.getReference(destBean, destBean.getBeanClass(), env);
      }

      if (destComp == null)
        throw new ConfigException(L.l("{0}: '{1}' is an unknown destination type '{2}'",
                                      loc,
                                      _destinationName,
                                      _destinationType.getName()));

      bean.setDestinationValue((Destination) destComp);

      beanSet = webBeans.getBeans(ConnectionFactory.class);

      Bean factoryBean = webBeans.resolve(beanSet);
      CreationalContext env = webBeans.createCreationalContext(factoryBean);

      Object comp = webBeans.getReference(factoryBean);

      if (comp == null)
        throw new ConfigException(L.l("ejb-message-bean requires a configured JMS ConnectionFactory"));
      bean.setConnectionFactoryValue((ConnectionFactory) comp);
    }
View Full Code Here

                            ArrayList<AnnotatedType<? super X>> remoteApi)
  {
    super(ejbName, beanType, localApi, localBean, remoteApi,
          Stateless.class.getSimpleName());
   
    InjectManager manager = InjectManager.create();
   
    _aspectBeanFactory
      = new StatelessAspectBeanFactory<X>(manager, getBeanType());
    _scheduledBeanFactory
      = new StatelessScheduledAspectBeanFactory<X>(manager, getBeanType());
View Full Code Here

                        AnnotatedType<X> annotatedType,
                        EjbLazyGenerator<X> lazyGenerator)
  {
    super(ejbContainer, ejbName, moduleName, rawAnnType, annotatedType);

    InjectManager webBeans = InjectManager.create();
   
    UserTransaction ut = webBeans.getReference(UserTransaction.class);
    _lazyGenerator = lazyGenerator;
   
    // ejb/0fbl
    _context = new MessageDrivenContextImpl(this, ut);
  }
View Full Code Here

     
        javaGen.compilePendingJava();
     
        _proxyImplClass = (Class<X>) javaGen.loadClass(fullClassName);
       
        InjectManager cdiManager = InjectManager.create(getClassLoader());
       
        AnnotatedType annType = ReflectionAnnotatedFactory.introspectType(_proxyImplClass);
       
        _builder = new InjectionTargetBuilder(cdiManager,
                                              annType,
View Full Code Here

  @Override
  protected void bindContext()
  {
    super.bindContext();
   
    InjectManager manager = InjectManager.create();
    BeanBuilder<?> factory = manager.createBeanFactory(_context.getClass());

    manager.addBean(factory.singleton(_context));
  }
View Full Code Here

  }
 
  @Override
  protected AspectFactory<X> createAspectFactory()
  {
    InjectManager manager = InjectManager.getCurrent();
   
    AspectFactory<X> next = new MethodTailFactory<X>(this);
   
    next = new InterceptorFactory<X>(this, next, manager);
    next = new XaFactory<X>(this, next);
View Full Code Here

      } catch (NamingException e) {
        log.log(Level.FINER, e.toString(), e);
      }
    }
   
    InjectManager beanManager = InjectManager.create();
   
    Set<Bean<?>> beans;

    if (name != null) {
      Named named = Names.create(name);

      beans = beanManager.getBeans(type, named);
    }
    else {
      beans = beanManager.getBeans(type);
    }
   
    Bean<?> bean = beanManager.resolve(beans);
   
    if (bean == null) {
      throw new ConfigException(L.l("'{0}' with name='{1}' is an unknown JMS resource",
                                    type.getName(), name));
    }
   
    return (T) beanManager.getReference(bean);
  }
View Full Code Here

  }
  @Override
  protected AspectFactory<X> createAspectFactory()
  {
    InjectManager manager = InjectManager.getCurrent();
   
    AspectFactory<X> next = new StatelessScheduledMethodTailFactory<X>(this);
   
    next = new InterceptorFactory<X>(this, next, manager);
    next = new XaFactory<X>(this, next);
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.