Package com.caucho.config.inject

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


  {
    ProtocolProxyFactory proxyFactory = (ProtocolProxyFactory) getObject();

    Object proxy = proxyFactory.createProxy(_interface);

    InjectManager beanManager = InjectManager.create();

    BeanFactory factory = beanManager.createBeanFactory(_interface);

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

      addOptionalStringProperty("name", getName());
    }

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

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

    factory.stereotype(Configured.class);

    _bean = (AbstractBean) factory.singleton(proxy);

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


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

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

  CreationalContext<?> env = CreationalContextImpl.create();

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

  private void resolve()
  {
    Destination destination = null;

    InjectManager webBeans = InjectManager.create();

    String name = _mappedName;

    if (name == null)
      name = _messageDestinationName;
View Full Code Here

  }


  public void bindInjection()
  {
    InjectManager beanManager = InjectManager.create();
    ManagedBeanImpl<T> managedBean
      = beanManager.createManagedBean(_annotatedType);
   
    _bean = managedBean;
    setInjectionTarget(managedBean.getInjectionTarget());

    _timeoutMethod = getTimeoutMethod(_bean.getBeanClass());

    if (_timeoutMethod != null)
      _timerService = new EjbTimerService(_server);

    // Injection binding occurs in the start phase

    InjectManager inject = InjectManager.create();

    // server/4751
    if (_injectionTarget == null)
      _injectionTarget = inject.createInjectionTarget(_ejbClass);

    if (_timerService != null) {
      BeanFactory<TimerService> factory = inject.createBeanFactory(TimerService.class);
      inject.addBean(factory.singleton(_timerService));
    }
    /*
    ArrayList<ConfigProgram> injectList = new ArrayList<ConfigProgram>();
    InjectIntrospector.introspectInject(injectList, getEjbClass());
    // XXX: add inject from xml here
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

  public MessageServer(EjbContainer ejbContainer,
                       AnnotatedType<T> annotatedType)
  {
    super(ejbContainer, annotatedType);

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

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

    manager.addBean(factory.singleton(_context));
  }
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 void postStart()
  {
    ScheduleIntrospector introspector = new ScheduleIntrospector();

    InjectManager manager = InjectManager.create();
    AnnotatedType<T> type = manager.createAnnotatedType(getEjbClass());
    ArrayList<TimerTask> timers;

    timers = introspector.introspect(new StatelessTimeoutCaller(), type);

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

    try {
      thread.setContextClassLoader(_loader);

      super.init();

      InjectManager beanManager = InjectManager.create();
     
      AnnotatedType<?> annType = getAnnotatedType();
      SessionPool sessionPool = annType.getAnnotation(SessionPool.class);
     
      if (sessionPool != null) {
        if (sessionPool.maxIdle() >= 0)
          _sessionIdleMax = sessionPool.maxIdle();
       
        if (sessionPool.maxConcurrent() >= 0)
          _sessionConcurrentMax = sessionPool.maxConcurrent();
       
        if (sessionPool.maxConcurrentTimeout() >= 0)
          _sessionConcurrentTimeout = sessionPool.maxConcurrentTimeout();
       
      }

      BeanFactory<SessionContext> factory
        = beanManager.createBeanFactory(SessionContext.class);
     
      AbstractContext context = getSessionContext();
      context.setDeclaredRoles(_declaredRoles);

      beanManager.addBean(factory.singleton(context));
    } finally {
      thread.setContextClassLoader(oldLoader);
    }

    registerWebBeans();
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.