01: /*
02: * calculator
03: *
04: * Enhydra super-servlet specification object
05: *
06: */
07: package calculator.spec;
08:
09: import com.lutris.util.KeywordValueException;
10:
11: public class CalculatorManagerFactory {
12:
13: /**
14: * Constructor can't be used.
15: */
16: private CalculatorManagerFactory() {
17: }
18:
19: /**
20: * Create a CalculatroManager as state object/value object/data transfer object
21: */
22: public static CalculatorManager getCalculatorManager(
23: String fullClassName) throws KeywordValueException {
24:
25: CalculatorManager result = null;
26:
27: Class objectClass = null;
28:
29: try {
30: // Create the value object
31:
32: objectClass = Class.forName(fullClassName);
33:
34: result = (CalculatorManager) objectClass.newInstance();
35:
36: } catch (Exception ex) {
37: System.out.println("Error on creating the object" + ex);
38: }
39:
40: return result;
41: }
42: }
|