Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext


  @Override
    protected void setUp() throws Exception
  {
        super.setUp();
        ac =
            new FileSystemXmlApplicationContext(
                    new String[] { "/deployment-descriptors/applicationContext.xml" });

        ssafSearchImpl = (SSAFSearchImpl) ac.getBean("ssafSolrSearchBean");
  }
View Full Code Here


  public static void main(String[] args) throws IOException {
    int nrOfCalls = 1;
    if (args.length > 1 && !"".equals(args[1])) {
      nrOfCalls = Integer.parseInt(args[1]);
    }
    ApplicationContext context = new FileSystemXmlApplicationContext(CONTEXT_CONFIG_LOCATION);
    ImageDatabase idb = (ImageDatabase) context.getBean("imageDatabase");
    StandaloneImageTool tool = new StandaloneImageTool(idb);
    tool.listImages(nrOfCalls);
  }
View Full Code Here

        this.preconditions = new LinkedList<String>();
        this.preconditions.add("CheckThatDataFileSizeIsGreaterThanZero");
        this.preconditions.add("CheckThatDataFileExists");
        this.preconditions.add("CheckDataFileMimeType");
        File preCondFile = getTestDataFile("met_extr_preconditions.xml");
        this.evalUtils = new PreCondEvalUtils(new FileSystemXmlApplicationContext(preCondFile.toURL().toExternalForm()));
    }
View Full Code Here

  }
 
  public Set<Catalog> deserializeAllCatalogs()
      throws CatalogRepositoryException {
    try {
          FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
          appContext.setClassLoader(new Serializer().getClassLoader());
          appContext.refresh();
          return new HashSet<Catalog>(appContext.getBeansOfType(Catalog.class).values());
    } catch (Exception e) {
      throw new CatalogRepositoryException(e.getMessage(), e);
    }
  }
View Full Code Here

  private MetExtractorProductCrawler configureCrawler(String ecasUrlStr)
      throws MalformedURLException {
    MetExtractorProductCrawler crawler = new MetExtractorProductCrawler();
    crawler
        .setClientTransferer(DEFAULT_TRANSFER_FACTORY);
    crawler.setApplicationContext(new FileSystemXmlApplicationContext(CRAWLER_CONF_FILE));
    crawler.setCrawlForDirs(false);
    crawler.setFilemgrUrl(ecasUrlStr);
    crawler.setNoRecur(false);
    return crawler;
  }
View Full Code Here

  public static void main(String[] args) throws Exception {
    String propertiesFile = System.getProperty("org.apache.oodt.cas.catalog.properties.file");
    if (propertiesFile != null)
      System.getProperties().load(new FileInputStream(propertiesFile));
    String configFile = PathUtils.doDynamicReplacement(System.getProperty("org.apache.oodt.cas.catalog.server.config.file", "classpath:/org/apache/oodt/cas/catalog/config/catserv-server-config.xml"));
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { configFile }, false);
    appContext.setClassLoader(new Serializer().getClassLoader());
    appContext.refresh();
        List<CmdLineOptionInstance> optionInstances = CmdLineOptionUtils.loadValidateAndHandleInstances(appContext, args);
        CmdLineOptionInstance instance = CmdLineOptionUtils.getOptionInstanceByName("serverFactoryBeanId", optionInstances);
        CommunicationChannelServerFactory serverFactory = (CommunicationChannelServerFactory) appContext.getBean(instance.getValues().get(0), CommunicationChannelServerFactory.class);
        CommunicationChannelServer communicationChannelServer = serverFactory.createCommunicationChannelServer();
    communicationChannelServer.startup();
    System.out.println("\n---- Launched '" +  communicationChannelServer.getClass().getCanonicalName() + "' on port: " + communicationChannelServer.getPort() + " ----");

//   
View Full Code Here

  public static void main(String[] args) throws Exception {
    String propertiesFile = System.getProperty("org.apache.oodt.cas.catalog.properties.file");
    if (propertiesFile != null)
      System.getProperties().load(new FileInputStream(propertiesFile));
    String configFile = PathUtils.doDynamicReplacement(System.getProperty("org.apache..oodt.cas.catalog.client.config.file", "classpath:/org/apache/oodt/cas/catalog/config/catserv-client-config.xml"));
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { configFile }, false);
//    appContext.setClassLoader(new Serializer().getClassLoader());
    appContext.refresh();
        List<CmdLineOptionInstance> optionInstances = CmdLineOptionUtils.loadValidateAndHandleInstances(appContext, args);
        CmdLineOptionInstance instance = CmdLineOptionUtils.getOptionInstanceByName("clientFactoryBeanId", optionInstances);
    CatalogServiceClientFactory csClientFactory = (CatalogServiceClientFactory) appContext.getBean(instance.getValues().get(0), CatalogServiceClientFactory.class);
    CatalogServiceClient csClient = csClientFactory.createCatalogService();
        instance = CmdLineOptionUtils.getOptionInstanceByName("action", optionInstances);
    ((CatalogServiceServerAction) appContext.getBean(instance.getValues().get(0), CatalogServiceServerAction.class)).performAction(csClient);
  }
View Full Code Here

    return "";
  }

  @Override
  public void handleOption(CmdLineOption option, List<String> values) {
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
    appContext.setClassLoader(new Serializer().getClassLoader());
    appContext.refresh();
    PrintStream ps = new PrintStream(System.out);
        ps.println("ServerFactories:");
        for (String serverId : appContext.getBeanNamesForType(CommunicationChannelServerFactory.class)) {
          CommunicationChannelServerFactory serverFactory = (CommunicationChannelServerFactory) appContext.getBean(serverId, CommunicationChannelServerFactory.class);
            ps.println("  ServerFactory:");
            ps.println("    Id: " + serverId);
            ps.println("    Port: " + serverFactory.getPort());
            ps.println();
        }
View Full Code Here

public class SpringUtils {

  private static Logger LOG = Logger.getLogger(SpringUtils.class.getName());
 
  public static HashSet<Catalog> loadCatalogs(String catalogBeanRepo) throws Exception {
        FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(catalogBeanRepo);
        Map<String, Catalog> catalogsMap = appContext.getBeansOfType(Catalog.class);
        HashSet<Catalog> catalogs = new HashSet<Catalog>();
        for (String key : catalogsMap.keySet()) {
          Catalog curCatalog = catalogsMap.get(key);
          LOG.log(Level.INFO, "Loading catalog configuration for Catalog: '" + curCatalog + "'");
          if (catalogs.contains(curCatalog))
View Full Code Here

    return "";
  }

  @Override
  public void handleOption(CmdLineOption option, List<String> values) {
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
    appContext.setClassLoader(new Serializer().getClassLoader());
    appContext.refresh();
    PrintStream ps = new PrintStream(System.out);
        ps.println("ClientFactories:");
        for (String clientId : appContext.getBeanNamesForType(CatalogServiceClientFactory.class)) {
          CatalogServiceClientFactory clientFactory = (CatalogServiceClientFactory) appContext.getBean(clientId, CatalogServiceClientFactory.class);
            ps.println("  ClientFactory:");
            ps.println("    Id: " + clientId);
            ps.println("    URL: " + clientFactory.getServerUrl());
            ps.println();
        }
View Full Code Here

TOP

Related Classes of org.springframework.context.support.FileSystemXmlApplicationContext

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.