From 573609f3b4bf7be62b774f27a6c530622c29d487 Mon Sep 17 00:00:00 2001 From: Sasha Sherstnev Date: Mon, 28 Oct 2013 20:24:39 +0000 Subject: [PATCH] Add still not-working code for the 2nd cassandra call --- server/compbio/listeners/ContextListener.java | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/server/compbio/listeners/ContextListener.java b/server/compbio/listeners/ContextListener.java index 2dfe373..3cbf723 100644 --- a/server/compbio/listeners/ContextListener.java +++ b/server/compbio/listeners/ContextListener.java @@ -16,7 +16,8 @@ import compbio.cassandra.CassandraCreate; */ @WebListener public class ContextListener implements ServletContextListener { - private ScheduledExecutorService scheduler; + private ScheduledExecutorService webjob_scheduler; + //private ScheduledExecutorService localjob_scheduler; CassandraCreate cc = new CassandraCreate(); /** @@ -26,13 +27,24 @@ public class ContextListener implements ServletContextListener { 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); +*/ } /** @@ -41,7 +53,8 @@ public class ContextListener implements ServletContextListener { public void contextDestroyed(ServletContextEvent arg0) { cc.Closing(); System.out.println("Shut down ProteoCache......"); - scheduler.shutdownNow(); + webjob_scheduler.shutdownNow(); + //localjob_scheduler.shutdownNow(); } } -- 1.7.10.2