Examples of ListableBeanFactory


Examples of org.springframework.beans.factory.ListableBeanFactory

    if (getEntityManagerFactory() == null) {
      if (!(beanFactory instanceof ListableBeanFactory)) {
        throw new IllegalStateException("Cannot retrieve EntityManagerFactory by persistence unit name " +
            "in a non-listable BeanFactory: " + beanFactory);
      }
      ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
      setEntityManagerFactory(EntityManagerFactoryUtils.findEntityManagerFactory(lbf, getPersistenceUnitName()));
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

    if (getEntityManagerFactory() == null) {
      if (!(beanFactory instanceof ListableBeanFactory)) {
        throw new IllegalStateException("Cannot retrieve EntityManagerFactory by persistence unit name " +
            "in a non-listable BeanFactory: " + beanFactory);
      }
      ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
      setEntityManagerFactory(EntityManagerFactoryUtils.findEntityManagerFactory(lbf, getPersistenceUnitName()));
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

    registerJobsAndTriggers();
  }

  protected Scheduler findScheduler(String schedulerName) throws SchedulerException {
    if (this.beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) this.beanFactory;
      String[] beanNames = lbf.getBeanNamesForType(Scheduler.class);
      for (String beanName : beanNames) {
        Scheduler schedulerBean = (Scheduler) lbf.getBean(beanName);
        if (schedulerName.equals(schedulerBean.getSchedulerName())) {
          return schedulerBean;
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

    registerJobsAndTriggers();
  }

  protected Scheduler findScheduler(String schedulerName) throws SchedulerException {
    if (this.beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) this.beanFactory;
      String[] beanNames = lbf.getBeanNamesForType(Scheduler.class);
      for (int i = 0; i < beanNames.length; i++) {
        Scheduler schedulerBean = (Scheduler) lbf.getBean(beanNames[i]);
        if (schedulerName.equals(schedulerBean.getSchedulerName())) {
          return schedulerBean;
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

   * @see org.springframework.transaction.PlatformTransactionManager
   */
  public void setBeanFactory(BeanFactory beanFactory) {
    if (this.transactionInterceptor.getTransactionManager() == null &&
        beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
      PlatformTransactionManager ptm = (PlatformTransactionManager)
          BeanFactoryUtils.beanOfTypeIncludingAncestors(lbf, PlatformTransactionManager.class);
      this.transactionInterceptor.setTransactionManager(ptm);
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

    registerJobsAndTriggers();
  }

  protected Scheduler findScheduler(String schedulerName) throws SchedulerException {
    if (this.beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) this.beanFactory;
      String[] beanNames = lbf.getBeanNamesForType(Scheduler.class);
      for (int i = 0; i < beanNames.length; i++) {
        Scheduler schedulerBean = (Scheduler) lbf.getBean(beanNames[i]);
        if (schedulerName.equals(schedulerBean.getSchedulerName())) {
          return schedulerBean;
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

   * @return a Collection of PhaseListener objects
   * @see #getBeanFactory
   * @see org.springframework.beans.factory.ListableBeanFactory#getBeansOfType(Class)
   */
  protected Collection getDelegates(FacesContext facesContext) {
    ListableBeanFactory bf = getBeanFactory(facesContext);
    return BeanFactoryUtils.beansOfTypeIncludingAncestors(bf, PhaseListener.class, true, false).values();
  }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

  protected void detectHandlers() throws BeansException {
    ApplicationContext context = getApplicationContext();
    String[] beanNames = context.getBeanNamesForType(Object.class);
    for (String beanName : beanNames) {
      Class<?> handlerType = context.getType(beanName);
      ListableBeanFactory bf = (context instanceof ConfigurableApplicationContext ?
          ((ConfigurableApplicationContext) context).getBeanFactory() : context);
      GenericBeanFactoryAccessor bfa = new GenericBeanFactoryAccessor(bf);
      RequestMapping mapping = bfa.findAnnotationOnBean(beanName, RequestMapping.class);
      if (mapping != null) {
        String[] modeKeys = mapping.value();
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

      int orderId = Integer.parseInt(args[0]);
      int nrOfCalls = 1;
      if (args.length > 1 && !"".equals(args[1])) {
        nrOfCalls = Integer.parseInt(args[1]);
      }
      ListableBeanFactory beanFactory = new FileSystemXmlApplicationContext(CLIENT_CONTEXT_CONFIG_LOCATION);
      OrderServiceClient client = new OrderServiceClient(beanFactory);
      client.invokeOrderServices(orderId, nrOfCalls);
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.ListableBeanFactory

   * annotation on the handler class and on any of its methods.
   */
  protected String[] determineUrlsForHandler(String beanName) {
    ApplicationContext context = getApplicationContext();
    Class<?> handlerType = context.getType(beanName);
    ListableBeanFactory bf = (context instanceof ConfigurableApplicationContext ?
        ((ConfigurableApplicationContext) context).getBeanFactory() : context);
    GenericBeanFactoryAccessor bfa = new GenericBeanFactoryAccessor(bf);
    RequestMapping mapping = bfa.findAnnotationOnBean(beanName, RequestMapping.class);

    if (mapping != null) {
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.