perfsonar-dev - perfsonar: r4904 - branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration
Subject: perfsonar development work
List archive
perfsonar: r4904 - branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4904 - branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration
- Date: Fri, 23 Jan 2009 10:36:51 -0500
Author: roman
Date: 2009-01-23 10:36:51 -0500 (Fri, 23 Jan 2009)
New Revision: 4904
Modified:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
Log:
Modified:
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
===================================================================
---
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
2009-01-23 11:01:38 UTC (rev 4903)
+++
branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration/LSRegistrationAction.java
2009-01-23 15:36:51 UTC (rev 4904)
@@ -29,7 +29,14 @@
private static final Logger logger =
Logger.getLogger(LSRegistrationAction.class.getName());
+ protected RegisterDataSource dataSource = null;
+ protected LookupInformation lookupInformation = null;
+ protected LSRegistrator registrator = null;
+ protected URL[] lsURLs;
+ protected boolean initiated = false;
+
+
// -----------------------------------------------------------
Constructors
@@ -45,27 +52,35 @@
try {
- RegisterDataSource dataSource = getRegisterDataSource();
- LookupInformation lookupInformation = getLookupInformation();
- URL[] lsURLs = getLSAddresses();
-
- LSRegistrator registrator = getLSRegistrator();
- registrator.init(lookupInformation, dataSource, lsURLs);
-
+ if (!initiated) {
+ init();
+ initiated = true;
+ }
org.perfsonar.base2.service.requesthandler.ServiceMessage sm[] =
registrator.register();
- } catch (PerfSONARException psex) {
+ } catch (Exception ex) {
- logger.warn(
+ logger.error(
"Unable to run an action : "
+ getName() + ": "
- + psex.toString());
+ + ex.toString());
}
}
+ protected void init () throws PerfSONARException {
+
+ dataSource = getRegisterDataSource();
+ lookupInformation = getLookupInformation();
+ lsURLs = getLSAddresses();
+ registrator = getLSRegistrator();
+ registrator.init(lookupInformation, dataSource, lsURLs);
+
+ }
+
+
protected RegisterDataSource getRegisterDataSource() throws
PerfSONARException {
String className = DEFAULT_REGISTER_DATA_SOURCE;
- perfsonar: r4904 - branches/simple-service-with-base2/src/main/java/org/perfsonar/base2/service/registration, svnlog, 01/23/2009
Archive powered by MHonArc 2.6.16.