Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5313 - in branches/new-structure-with-base2/ps-mdm-ls/src/main: java/org/perfsonar/service/lookupservice resources/perfsonar/conf

Subject: perfsonar development work

List archive

perfsonar: r5313 - in branches/new-structure-with-base2/ps-mdm-ls/src/main: java/org/perfsonar/service/lookupservice resources/perfsonar/conf


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5313 - in branches/new-structure-with-base2/ps-mdm-ls/src/main: java/org/perfsonar/service/lookupservice resources/perfsonar/conf
  • Date: Thu, 15 Oct 2009 07:45:13 -0400

Author: trzaszcz
Date: 2009-10-15 07:45:13 -0400 (Thu, 15 Oct 2009)
New Revision: 5313

Modified:

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java

branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/perfsonar/conf/configuration.xml
Log:
refactoring

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
2009-10-15 11:44:32 UTC (rev 5312)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
2009-10-15 11:45:13 UTC (rev 5313)
@@ -15,6 +15,10 @@

protected static final Logger logger = Logger
.getLogger(LSCleanupSchedulerAction.class.getName());
+
+ private boolean isInitialized=false;
+ private LSCleanupServiceEngine engine;
+ private int ttl;

// -----------------------------------------------------------
Constructors

@@ -26,27 +30,26 @@

// TODO: run Action should throw an exception
public void runAction() {
-
- LSCleanupServiceEngine engine;
+
try {
-
- // create Service Engine for Cleanup
- engine = new LSCleanupServiceEngine();
-
- // get TTL from configuration file
- try {
- int ttl =
Integer.parseInt(getOption("lsTTL").getValue());
- engine.setLsTTL(ttl);
- logger.debug("Setting LS TTL to [" + ttl +
"]");
- } catch (Exception ex) {
- logger.debug("Taking default LS TTL");
+ if(!isInitialized){
+ // create Service Engine for Cleanup
+ engine=new LSCleanupServiceEngine();
+ try {
+ ttl =
Integer.parseInt(getOption("lsTTL").getValue());
+ engine.setLsTTL(ttl);
+ logger.debug("Setting LS TTL to [" +
ttl + "]");
+ } catch (Exception ex) {
+ logger.debug("Taking default LS TTL");
+ }
+ isInitialized=true;
}

// run cleanup
engine.cleanup(null);

} catch (PerfSONARException e) {
-
+ logger.error(e);
}

}

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/perfsonar/conf/configuration.xml
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/perfsonar/conf/configuration.xml
2009-10-15 11:44:32 UTC (rev 5312)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/perfsonar/conf/configuration.xml
2009-10-15 11:45:13 UTC (rev 5313)
@@ -1,6 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>

-<!-- $Id: configuration-ls.xml 4684 2009-09-28 trzaszcz $ -->

<configuration xmlns="http://service.perfsonar.org/ns/config/base/0.9/";>




  • perfsonar: r5313 - in branches/new-structure-with-base2/ps-mdm-ls/src/main: java/org/perfsonar/service/lookupservice resources/perfsonar/conf, svnlog, 10/15/2009

Archive powered by MHonArc 2.6.16.

Top of Page