Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2738 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine

Subject: perfsonar development work

List archive

perfsonar: r2738 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2738 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine
  • Date: Mon, 27 Aug 2007 19:27:20 -0400

Author: michael.bischoff
Date: 2007-08-27 19:27:19 -0400 (Mon, 27 Aug 2007)
New Revision: 2738

Modified:

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ServiceEngineFactory.java
Log:
improved logging

Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ServiceEngineFactory.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ServiceEngineFactory.java
2007-08-27 23:05:59 UTC (rev 2737)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/engine/ServiceEngineFactory.java
2007-08-27 23:27:19 UTC (rev 2738)
@@ -36,66 +36,47 @@
throws PerfSONARException {

// get a logger
- LoggerComponent logger = (LoggerComponent)AuxiliaryComponentManager.
- getInstance().getComponent(ComponentNames.LOGGER);
+ LoggerComponent logger =
(LoggerComponent)AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);

Class engineClass = null;

// try to get the class for the given className
try {
-
engineClass = Class.forName(engineClassName);
-
} catch (ClassNotFoundException e) {
-
// class not found
- logger.fatal("ServiceEngineFactory: class not found for name: "
- + engineClassName);
- throw new PerfSONARException("ServiceEngineFactory:
ClassNotFound: "
- + engineClassName);
-
+ logger.fatal("ServiceEngineFactory: class not found for name:
"+engineClassName);
+ throw new PerfSONARException(
+ "error.common.service_engine.creation_failure",
+ "ServiceEngineFactory: ClassNotFound: "+
engineClassName
+ );
}

ServiceEngine engine = null;

// get an instance of it
try {
-
engine = (ServiceEngine) engineClass.newInstance();
-
} catch (ClassCastException e1) {
-
- logger.fatal(
- "ServiceEngineFactory: class cast exception while "
- + "trying to instantiate: " + engineClassName);
-
- throw new PerfSONARException("ServiceEngineFactory: class cast
exception while "
- + "trying to instantiate: " + engineClassName);
-
-
+ logger.fatal("ServiceEngineFactory: specified class doesn't
implement ServiceEngine: " + engineClassName);
+ throw new PerfSONARException(
+ "error.common.service_engine.creation_failure",
+ "ServiceEngineFactory: specified class("+engineClassName+")
doesn't implement ServiceEngine"
+ );
} catch (InstantiationException e1) {
-
- logger.fatal(
- "ServiceEngineFactory: class instantiaiton exception while "
- + "trying to instantiate: " + engineClassName);
-
- throw new PerfSONARException("ServiceEngineFactory: class
instantiation "
- + "exception for " + engineClassName);
-
+ logger.fatal("ServiceEngineFactory: Couldn't instanciate class
("+engineClassName+") Perhaps there isn't a no arg constructor?");
+ throw new PerfSONARException(
+ "error.common.service_engine.creation_failure",
+ "ServiceEngineFactory: Couldn't instanciate class
("+engineClassName+") Perhaps there isn't a no arg constructor?"
+ );
} catch (IllegalAccessException e1) {
-
- logger.fatal("ServiceEngineFactory: class instantiation is
illegal "
- + "for: " + engineClassName);
- throw new PerfSONARException("ServiceEngineFactory:
IllegalAccessException "
- + "while instantiating "+engineClassName);
-
+ logger.fatal("ServiceEngineFactory: IllegalAccessException
couldn't instanciate: " + engineClassName);
+ throw new PerfSONARException(
+ "error.common.service_engine.creation_failure",
+ "ServiceEngineFactory: IllegalAccessException couldn't
instanciate: "+engineClassName
+ );
}

-
return engine;
-
}
-
-
-
}




Archive powered by MHonArc 2.6.16.

Top of Page