Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.XmlBeanFactory.containsBean()


            server = new FtpServer();
        }
        else if( args.length == 2 ) {
            LOG.info("Using xml configuration file " + args[1] + "...");
            XmlBeanFactory bf = new XmlBeanFactory(new FileSystemResource(args[1]));
            if(bf.containsBean("server")) {
                server = (FtpServer) bf.getBean("server");
            } else {
                String[] beanNames = bf.getBeanNamesForType(FtpServer.class);
                if(beanNames.length == 1) {
                    server = (FtpServer) bf.getBean(beanNames[0]);
View Full Code Here


        } else if( (args.length == 1) && args[0].equals("-?") ) {
            usage();
        } else if( args.length == 1 ) {
            System.out.println("Using XML configuration file " + args[0] + "...");
            XmlBeanFactory bf = new XmlBeanFactory(new FileSystemResource(args[0]));
            if(bf.containsBean("server")) {
                server = (FtpServer) bf.getBean("server");
            } else {
                String[] beanNames = bf.getBeanNamesForType(FtpServer.class);
                if(beanNames.length == 1) {
                    server = (FtpServer) bf.getBean(beanNames[0]);
View Full Code Here

          String[] errors = be.getMessage().split(";");
          throw new CreationException(errors[errors.length-1]);
        }
       
        // see whether we have properties
        if (beanFactory.containsBean("moduleProperties")) {
            Map<String, String> properties = (Map<String, String>) beanFactory.getBean("moduleProperties");
            return properties;
        } else {
            return Collections.emptyMap();
        }
View Full Code Here

          logger.error("Unable to load Tatool file.", be);
            throw new RuntimeException("Unable to load Tatool file.", be);
        }
       
        // see whether we have properties
        if (beanFactory.containsBean("moduleExporters")) {
          Map<String, DataExporter> exporters = (Map<String, DataExporter>) beanFactory.getBean("moduleExporters");
            return exporters;
        } else {
            return Collections.emptyMap();
        }
View Full Code Here

          logger.error("Unable to load Tatool file.", be);
            throw new RuntimeException("Unable to load Tatool file.");
        }
       
        // check whether we have the mandatory beans (rootElement)
        if (! beanFactory.containsBean(ROOT_ELEMENT)) {
          logger.error("Unable to load Tatool file. Root element missing!");
          throw new CreationException("Unable to load Tatool file. Root element missing!");      
        }
       
        // fetch the rootElement
View Full Code Here

  public static XmlBeanFactory loadBeanFactory(Resource r) {
    XmlBeanFactory beanFactory = new XmlBeanFactory(r);
   
    try {
      if (beanFactory.containsBean("customEditorConfigurer")) {
        CustomEditorConfigurer configurer = (CustomEditorConfigurer) beanFactory.getBean("customEditorConfigurer");   
        configurer.postProcessBeanFactory(beanFactory);
      }
    } catch (NoSuchBeanDefinitionException nsbde) {
      throw new RuntimeException(nsbde);
View Full Code Here

                 // TODO: inform user that module configuration is broken
                 throw new RuntimeException("Unable to load Tatool file.", be);
             }
            
             // see whether we have exporters
             if (beanFactory.containsBean("moduleExporters")) {
               Map<String, DataExporter> exporters = (Map<String, DataExporter>) beanFactory.getBean("moduleExporters");
                 return exporters;
             } else {
                 return Collections.emptyMap();
             }
View Full Code Here

          String[] errors = be.getMessage().split(";");
          throw new CreationException(errors[errors.length-1]);
        }
       
        // see whether we have properties
        if (beanFactory.containsBean("moduleProperties")) {
            Map<String, String> properties = (Map<String, String>) beanFactory.getBean("moduleProperties");
            return properties;
        } else {
            return Collections.emptyMap();
        }
View Full Code Here

          logger.error("Unable to load Tatool file.", be);
            throw new RuntimeException("Unable to load Tatool file.", be);
        }
       
        // see whether we have properties
        if (beanFactory.containsBean("moduleExporters")) {
          Map<String, DataExporter> exporters = (Map<String, DataExporter>) beanFactory.getBean("moduleExporters");
            return exporters;
        } else {
            return Collections.emptyMap();
        }
View Full Code Here

          logger.error("Unable to load Tatool file.", be);
            throw new RuntimeException("Unable to load Tatool file.");
        }
       
        // check whether we have the mandatory beans (rootElement)
        if (! beanFactory.containsBean(ROOT_ELEMENT)) {
          logger.error("Unable to load Tatool file. Root element missing!");
          throw new CreationException("Unable to load Tatool file. Root element missing!");      
        }
       
        // fetch the rootElement
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.