Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext


  protected Map<String, List<ProtocolFactory>> factoryMap;
 
  public SpringProtocolConfig(String configFile) {
    Validate.notNull(configFile, "SpringProtocolConfig configFile cannnot be NULL");
    factoryMap = new HashMap<String, List<ProtocolFactory>>();
    loadFactories(new FileSystemXmlApplicationContext(configFile));
  }
View Full Code Here


   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {

      FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
            this.beanRepo);

      try {
         ProductCrawler pc = (ProductCrawler) appContext
               .getBean(crawlerId != null ? crawlerId : getName());
         pc.setApplicationContext(appContext);
         if (pc.getDaemonPort() != -1 && pc.getDaemonWait() != -1) {
            new CrawlDaemon(pc.getDaemonWait(), pc, pc.getDaemonPort())
                  .startCrawling();
View Full Code Here

  @Override
    protected void setUp() throws Exception
  {
      super.setUp();
      ac =
          new FileSystemXmlApplicationContext(
              new String[] { "/deployment-descriptors/applicationContext.xml" });
      fieldMapping =
          (Map<String, SSAFSolrFieldTypeEnum>) ac.getBean("fieldMappings");
     
      ssafIndexImpl = (SSAFIndexImpl) ac.getBean("ssafStashBean");
View Full Code Here

         throws CmdLineActionException {
      try {
         Validate.notNull(catalogRepositoryId, "Must specify catalogRepositoryId");
         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());
         for (Catalog catalog : catalogs) {
View Full Code Here

   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         Validate.notNull(beanRepo, "Must specify beanRepo");

         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());
            getClient().addCatalog(catalog);
         }
View Full Code Here

      assertNotNull(pc.ingester);
   }

   public void testLoadAndValidateActions() {
      ProductCrawler pc = createDummyCrawler();
      pc.setApplicationContext(new FileSystemXmlApplicationContext(
            CRAWLER_CONFIG));
      pc.loadAndValidateActions();
      assertEquals(0, pc.actionRepo.getActions().size());

      pc = createDummyCrawler();
      pc.setApplicationContext(new FileSystemXmlApplicationContext(
            CRAWLER_CONFIG));
      pc.setActionIds(Lists.newArrayList("Unique", "DeleteDataFile"));
      pc.loadAndValidateActions();
      assertEquals(Sets.newHashSet(
            pc.getApplicationContext().getBean("Unique"),
View Full Code Here

            .getMetadata(INGEST_CLIENT_TRANSFER_SERVICE_FACTORY));
      crawler.setFilemgrUrl(pgeMetadata.getMetadata(INGEST_FILE_MANAGER_URL));
      String crawlerConfigFile = pgeMetadata.getMetadata(CRAWLER_CONFIG_FILE);
      if (!Strings.isNullOrEmpty(crawlerConfigFile)) {
         crawler.setApplicationContext(
               new FileSystemXmlApplicationContext(crawlerConfigFile));
         List<String> actionIds = pgeMetadata.getAllMetadata(ACTION_IDS);
         if (actionIds != null) {
            crawler.setActionIds(actionIds);
         }
      }
View Full Code Here

public class SpringCmdLineActionStore implements CmdLineActionStore {

   private ApplicationContext appContext;

   public SpringCmdLineActionStore(String springConfig) {
      appContext = new FileSystemXmlApplicationContext(springConfig);
      handleSpringSetContextInjectionType();
      handleSettingNameForCmdLineActions();
   }
View Full Code Here

  @Override
    protected void setUp() throws Exception
  {
    super.setUp();
    ac = new FileSystemXmlApplicationContext(new String[] {"/WebContent/WEB-INF/applicationContext.xml","/WebContent/WEB-INF/fieldMapping.xml"});
    searchAndRecordRetrievalClient = (SearchAndRecordRetrievalClient)ac.getBean("webServiceClient");
    System.out.println("Endpoint : "
        + searchAndRecordRetrievalClient.getEndpointURL());
  }
View Full Code Here

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

        ssafSearchImpl = (SSAFSearchImpl) ac.getBean( "ssafSolrSearchBean" );
    }
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.