Search in sources :

Example 1 with JagGrabRequestWorker

use of org.apollo.net.update.JagGrabRequestWorker in project apollo by apollo-rsps.

the class UpdateService method start.

@Override
public void start() {
    int release = context.getRelease().getReleaseNumber();
    try {
        Path base = Paths.get("data/fs/", Integer.toString(release));
        for (int i = 0; i < THREADS_PER_TYPE; i++) {
            workers.add(new JagGrabRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
            workers.add(new OnDemandRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
            workers.add(new HttpRequestWorker(dispatcher, new IndexedFileSystem(base, true)));
        }
    } catch (FileNotFoundException reason) {
        logger.log(Level.SEVERE, "Unable to find index or data files from the file system.", reason);
    }
    workers.forEach(service::submit);
}
Also used : Path(java.nio.file.Path) HttpRequestWorker(org.apollo.net.update.HttpRequestWorker) JagGrabRequestWorker(org.apollo.net.update.JagGrabRequestWorker) OnDemandRequestWorker(org.apollo.net.update.OnDemandRequestWorker) FileNotFoundException(java.io.FileNotFoundException) IndexedFileSystem(org.apollo.cache.IndexedFileSystem)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 Path (java.nio.file.Path)1 IndexedFileSystem (org.apollo.cache.IndexedFileSystem)1 HttpRequestWorker (org.apollo.net.update.HttpRequestWorker)1 JagGrabRequestWorker (org.apollo.net.update.JagGrabRequestWorker)1 OnDemandRequestWorker (org.apollo.net.update.OnDemandRequestWorker)1