X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fstat%2Fservlet%2FStatisticCollector.java;h=91eed46dbc28a0cb600a38efbcc1c7cd195f63ac;hb=91dc99b9b18e403c97b1c4e0ead8f754991714a5;hp=04897905356dad1a1b23c075653d22557d0db81a;hpb=18ab5ac43d48a62414e7d6e6e4d96e250e1ea923;p=jabaws.git diff --git a/webservices/compbio/stat/servlet/StatisticCollector.java b/webservices/compbio/stat/servlet/StatisticCollector.java index 0489790..91eed46 100644 --- a/webservices/compbio/stat/servlet/StatisticCollector.java +++ b/webservices/compbio/stat/servlet/StatisticCollector.java @@ -1,3 +1,20 @@ +/* Copyright (c) 2011 Peter Troshin + * + * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 + * + * This library is free software; you can redistribute it and/or modify it under the terms of the + * Apache License version 2 as published by the Apache Software Foundation + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache + * License for more details. + * + * A copy of the license is in apache_license.txt. It is also available here: + * @see: http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Any republication or derived work distributed in source code form + * must include this copyright and license notice. + */ package compbio.stat.servlet; import java.util.concurrent.Executors; @@ -56,10 +73,9 @@ public class StatisticCollector implements ServletContextListener { log.info("Initializing statistics collector"); executor = Executors.newScheduledThreadPool(2); - // FIXME Nullpointer if jobsout is not available? + if (collectClusterStats()) { - // TODO remove work out of the constructor Tomcat takes ages to - // start! + ExecutionStatCollector clusterCollector = new ExecutionStatCollector( clusterWorkDir, clusterMaxRuntime); clustercf = executor.scheduleAtFixedRate(clusterCollector, 60, @@ -83,7 +99,6 @@ public class StatisticCollector implements ServletContextListener { } else { log.info("Local statistics collector is disabled or not configured! "); } - } static String getClusterJobDir() {