*/
@WebListener
public class ContextListener implements ServletContextListener {
- private ScheduledExecutorService scheduler;
+ private ScheduledExecutorService webjob_scheduler;
+ //private ScheduledExecutorService localjob_scheduler;
CassandraCreate cc = new CassandraCreate();
/**
System.out.println("ProteoCache session start......");
cc.Connection();
- scheduler = Executors.newSingleThreadScheduledExecutor();
- scheduler.scheduleAtFixedRate(new Runnable() {
+ webjob_scheduler = Executors.newSingleThreadScheduledExecutor();
+ webjob_scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
- cc.Parsing();
+ cc.Parsing("http");
+ //cc.Parsing("file");
}
- }, 0, 60, TimeUnit.SECONDS);
+ }, 0, 20, TimeUnit.SECONDS);
+/*
+ localjob_scheduler = Executors.newSingleThreadScheduledExecutor();
+ localjob_scheduler.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+ cc.Parsing("http");
+ //cc.Parsing("file");
+ }
+ }, 0, 20000, TimeUnit.SECONDS);
+*/
}
/**
public void contextDestroyed(ServletContextEvent arg0) {
cc.Closing();
System.out.println("Shut down ProteoCache......");
- scheduler.shutdownNow();
+ webjob_scheduler.shutdownNow();
+ //localjob_scheduler.shutdownNow();
}
}