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