Changeset 5291


Ignore:
Timestamp:
05/27/14 07:41:55 (10 years ago)
Author:
Marie Hinrichs
Message:

Added some comments in WebAppListener?.java about code changes needed for testing.
Fixed dependency problem.

Location:
SRUAggregator/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/pom.xml

    r5044 r5291  
    145145            <artifactId>javax.servlet-api</artifactId>
    146146            <version>3.1.0</version>
     147            <scope>provided</scope>
    147148        </dependency>
    148149    </dependencies>
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/WebAppListener.java

    r5041 r5291  
    77import eu.clarin.sru.client.SRUThreadedClient;
    88import eu.clarin.sru.client.fcs.ClarinFCSRecordParser;
    9 import eu.clarin.sru.fcs.aggregator.cache.EndpointUrlFilter;
    109import eu.clarin.sru.fcs.aggregator.sopt.CenterRegistryI;
    1110import eu.clarin.sru.fcs.aggregator.sopt.CenterRegistryLive;
     
    1514import java.io.IOException;
    1615import java.io.InputStream;
    17 import java.util.Date;
    1816import java.util.HashSet;
    1917import java.util.Set;
    20 import java.util.Timer;
    2118import java.util.concurrent.ExecutorService;
    2219import java.util.concurrent.Executors;
     
    2724import javax.naming.InitialContext;
    2825import javax.naming.NamingException;
    29 import javax.servlet.ServletContext;
    3026import opennlp.tools.tokenize.TokenizerModel;
    31 import org.joda.time.DateTime;
    3227import org.zkoss.zk.ui.WebApp;
    3328import org.zkoss.zk.ui.util.WebAppCleanup;
     
    7873        webapp.setAttribute(LANGUAGES, languages);
    7974
     75        // toggle following 2 comments to test user interface
    8076        setUpScanCache(webapp);
    8177        //setUpScanCacheForReadOnly(webapp);
     
    10399        if (!aggregatorDir.exists()) {
    104100            LOGGER.severe("Aggregator directory does not exist and cannot be created: "
    105                         + aggregatorDir.getAbsolutePath());
     101                    + aggregatorDir.getAbsolutePath());
    106102        }
    107103        File scanDir = new File(aggregatorDir, SCAN_DIR_NAME);
     
    144140        CenterRegistryI centerRegistry = new CenterRegistryLive();
    145141        SRUThreadedClient sruScanClient = (SRUThreadedClient) webapp.getAttribute(WebAppListener.SHARED_SRU_CLIENT);
    146         //EndpointUrlFilter filter = new EndpointUrlFilter();
    147         //filter.urlShouldContainAnyOf("leipzig");
    148         //filter.urlShouldContainAnyOf("uni-tuebingen.de");
    149         //filter.urlShouldContainAnyOf("uni-tuebingen.de", ".mpi.nl");
    150         //filter.urlShouldContainAnyOf("dspin.dwds.de", "lindat.");
    151         //ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, filter, CACHE_MAX_DEPTH);
     142
     143        // Comment-out when testing:
    152144        ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, null, cacheMaxDepth);
     145
     146        // For Testing:
     147//        EndpointUrlFilter filter = new EndpointUrlFilter();
     148//        //filter.urlShouldContainAnyOf("leipzig");
     149//        //filter.urlShouldContainAnyOf("uni-tuebingen.de");
     150//        filter.urlShouldContainAnyOf("uni-tuebingen.de", ".mpi.nl");
     151//        //filter.urlShouldContainAnyOf("dspin.dwds.de", "lindat.");
     152//        ScanCrawler scanCrawler = new ScanCrawler(centerRegistry, sruScanClient, filter, cacheMaxDepth);
    153153        ScanCache scanCache;
    154154
     
    196196        try {
    197197            // Wait a while for existing tasks to terminate
    198             if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS, 
     198            if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS,
    199199                    TimeUnit.MILLISECONDS)) {
    200200                pool.shutdownNow(); // Cancel currently executing tasks
    201201                // Wait a while for tasks to respond to being cancelled
    202                 if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS, 
     202                if (!pool.awaitTermination(WAITING_TIME_FOR_POOL_SHUTDOWN_MS,
    203203                        TimeUnit.MILLISECONDS)) {
    204204                    LOGGER.info("Pool did not terminate");
Note: See TracChangeset for help on using the changeset viewer.