Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.ListableBeanFactory


    ".spring.beans.resource";

  public ExtensionsRegistry createRegistry(String registryId,
      JRPropertiesMap properties)
  {
    ListableBeanFactory beanFactory = getBeanFactory(registryId, properties);
    return new SpringExtensionsRegistry(beanFactory);
  }
View Full Code Here


    private void autoDetectRuleSets(Set ruleSets) {
        if (!(beanFactory instanceof ListableBeanFactory)) {
            log.warn("Cannot auto-detect RuleSets, beanFactory is not instanceof ListableBeanFactory: beanFactory.class=" + beanFactory.getClass());
            return;
        }
        ListableBeanFactory factory = (ListableBeanFactory) beanFactory;
        String[] factoryNames = factory.getBeanNamesForType(RuleSetFactoryBean.class);
        for (int i = 0; i < factoryNames.length; i++) {
            String beanName = factoryNames[i].substring(1);
            RuleSet ruleSet = (RuleSet) factory.getBean(beanName);
            ruleSets.add(ruleSet);
        }
    }
View Full Code Here

   */
  public void setBeanFactory(BeanFactory beanFactory) {

    Assert.isInstanceOf(ListableBeanFactory.class, beanFactory);

    ListableBeanFactory listableBeanFactory = (ListableBeanFactory) beanFactory;
    this.txPostProcessor = new TransactionalRepositoryProxyPostProcessor(listableBeanFactory, transactionManagerName);
    this.exceptionPostProcessor = new PersistenceExceptionTranslationRepositoryProxyPostProcessor(listableBeanFactory);
  }
View Full Code Here

   * @see org.springframework.transaction.PlatformTransactionManager
   */
  public void setBeanFactory(BeanFactory beanFactory) {
    if (this.resourceInterceptor.getResourceManager() == null &&
        beanFactory instanceof ListableBeanFactory) {
      ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
      ResourceManager rm = (ResourceManager)
          BeanFactoryUtils.beanOfTypeIncludingAncestors(lbf, ResourceManager.class);
      this.resourceInterceptor.setResourceManager(rm);
    }
  }
View Full Code Here

            if (!"".equals(nrOfCallsString)) {
                nrOfCalls = Integer.parseInt(nrOfCallsString);
            }

            ListableBeanFactory beanFactory = new FileSystemXmlApplicationContext("clientContext.xml");
            ClientApplication client = new ClientApplication(beanFactory);

            client.invokeContactManager(new UsernamePasswordAuthenticationToken(username, password), nrOfCalls);
            System.exit(0);
        }
View Full Code Here

      else
      {
         // by type injection
         if (beanFactory instanceof ListableBeanFactory)
         {
            ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
            Map beans = lbf.getBeansOfType(beanType);
            if (beans.size() > 1)
            {
               Object bean = beans.get(defaultBeanName);
               if (bean == null)
               {
View Full Code Here

      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);
      WorkflowStarterClient client = new WorkflowStarterClient(beanFactory);
      client.invokeOrderServices(orderId, nrOfCalls);
    }
  }
View Full Code Here

     * @see #setAttachments
     */
    public void postProcessBeanFactory(
            ConfigurableListableBeanFactory beanFactory) throws BeansException {

        ListableBeanFactory source = this.applicationContext == null ? beanFactory
                : this.applicationContext;
        attachAllResources(source);
        attachAllRestlets(source);

        if (getAttachments() != null) {
            for (Map.Entry<String, String> attachment : getAttachments()
                    .entrySet()) {
                String uri = attachment.getKey();
                String beanName = attachment.getValue();
                Class<?> beanType = source.getType(beanName);

                if (org.restlet.resource.ServerResource.class
                        .isAssignableFrom(beanType)) {
                    attachResource(uri, beanName, source);
                } else if (Restlet.class.isAssignableFrom(beanType)) {
View Full Code Here

   protected void testFacade() throws Throwable
   {
      log.warn("Testing Spring Facade ...");

      ListableBeanFactory factory = new KernelControllerListableBeanFactory(controller);
      // bean factory
      factory.getBean("MainDeployer");
      // TODO - other methods
      // listable
      if (factory.containsBeanDefinition("MainDeployer") == false)
         throw new IllegalArgumentException("Illegal impl");
      // TODO - other methods

      log.warn("Finished testing Spring Facade ...");
   }
View Full Code Here

      IEntityFactory entityFactory;

      @Override
      public EntityBeanFactory get() {
       
        final ListableBeanFactory lbf = EntityBeanFactory.loadBeanDefinitions(beanDefRef);
        return new EntityBeanFactory(lbf, entityFactory);
      }
    }).in(Scopes.SINGLETON);

    // IEntityGraphPopulator
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.ListableBeanFactory

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.