Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext.refresh()


      String partTwo = URLEncoder.encode(absolutePath.substring(absolutePath.lastIndexOf("/") + 1), "UTF-8");
      absolutePath = partOne + "/" + partTwo;
     
      File springFile = new File(new File(absolutePath), SPRING_CONFIG);
      appCtx.setConfigLocation("file:" + springFile.getAbsolutePath());
      appCtx.refresh();
     
      return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");

  }
 
View Full Code Here


         Validate.notNull(beanRepo, "Must specify beanRepo");

         FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
               new String[] { this.beanRepo }, false);
         appContext.setClassLoader(new Serializer().getClassLoader());
         appContext.refresh();
         CatalogRepositoryFactory factory = (CatalogRepositoryFactory) appContext
               .getBean(this.catalogRepositoryId, CatalogRepositoryFactory.class);
         CatalogRepository catalogRepository = factory.createRepository();
         Set<Catalog> catalogs = catalogRepository.deserializeAllCatalogs();
         printer.println("Deserialized Catalogs: " + catalogs.toString());
View Full Code Here

         FileSystemXmlApplicationContext repoAppContext =
            new FileSystemXmlApplicationContext(
               new String[] { this.beanRepo }, false);
         repoAppContext.setClassLoader(new Serializer().getClassLoader());
         repoAppContext.refresh();
         @SuppressWarnings("unchecked")
         Map<String, Catalog> catalogs = repoAppContext
               .getBeansOfType(Catalog.class);
         for (Catalog catalog : catalogs.values()) {
            printer.println("Adding catalog: " + catalog.getId());
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

    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();
View Full Code Here

    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);
View Full Code Here

  @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:");
View Full Code Here

  @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:");
View Full Code Here

  @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("Actions:");
        for (CatalogServiceServerAction action : ((Map<String, CatalogServiceServerAction>) appContext.getBeansOfType(CatalogServiceServerAction.class)).values()) {
            ps.println("  Action:");
            ps.println("    Id: " + action.getId());
View Full Code Here

 
  @Override
  public void performAction(CatalogServiceClient csClient) throws Exception {
    FileSystemXmlApplicationContext repoAppContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
    repoAppContext.setClassLoader(new Serializer().getClassLoader());
    repoAppContext.refresh();
    Map<String, Catalog> catalogs = repoAppContext.getBeansOfType(Catalog.class);
    for (Catalog catalog : catalogs.values())
      csClient.addCatalog(catalog);
  }
 
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.