1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.struts.flow.core;
17
18 /***
19 * Simple static factory for getting interface implementations. Should be
20 * replaced later by something more pluggable.
21 *
22 *@author <a href="mailto:davjon@sas.com">David M Johnson</a>
23 */
24 public class Factory {
25
26 private static Logger logger = new Logger();
27 private static ContinuationsManager continuationsManager = null;
28
29 /***
30 * Sets the logger
31 *
32 *@param log The new logger value
33 */
34 public static void setLogger(Logger log) {
35 logger = log;
36 }
37
38
39 /***
40 * Gets the logger
41 *
42 *@return The logger value
43 */
44 public static Logger getLogger() {
45 return logger;
46 }
47
48
49 /***
50 * Gets the continuationsManager
51 *
52 *@return The continuationsManager value
53 */
54 public static ContinuationsManager getContinuationsManager() {
55 if (continuationsManager == null) {
56 try {
57 continuationsManager = new ContinuationsManagerImpl();
58 } catch (Exception e) {
59 throw new RuntimeException("ERROR initializing ContinationsManager", e);
60 }
61 }
62 return continuationsManager;
63 }
64
65 }
66