1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
package org.demosys.web; |
7 |
|
import org.demosys.task.MemoryTaskService; |
8 |
|
import org.demosys.task.TaskService; |
9 |
|
import org.demosys.web.iteration.IterationService; |
10 |
|
import org.demosys.web.iteration.impl.MemoryIterationService; |
11 |
|
import org.demosys.web.project.ProjectService; |
12 |
|
import org.demosys.web.project.impl.MemoryProjectService; |
13 |
|
import org.demosys.web.story.StoryService; |
14 |
|
import org.demosys.web.story.impl.MemoryStoryService; |
15 |
|
import org.demosys.web.user.UserService; |
16 |
|
import org.demosys.web.user.impl.MemoryUserService; |
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
18 |
public class ServiceLocator { |
22 |
12 |
private static ServiceLocator _locator = null; |
23 |
18 |
private StoryService _storyService = new MemoryStoryService(); |
24 |
18 |
private IterationService iterationService = new MemoryIterationService(); |
25 |
18 |
private TaskService taskService = new MemoryTaskService(); |
26 |
18 |
private ProjectService projectService = new MemoryProjectService(); |
27 |
24 |
private UserService _userService = new MemoryUserService(); |
28 |
4 |
|
29 |
6 |
public UserService getUserService() { |
30 |
48 |
return _userService; |
31 |
6 |
} |
32 |
6 |
|
33 |
6 |
|
34 |
|
public ProjectService getProjectService() { |
35 |
0 |
return projectService; |
36 |
14 |
} |
37 |
|
|
38 |
|
|
39 |
|
public TaskService getTaskService() { |
40 |
0 |
return taskService; |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
public synchronized void shutdown() { |
52 |
9 |
_locator = null; |
53 |
9 |
} |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
3 |
|
59 |
3 |
|
60 |
|
|
61 |
|
public StoryService getStoryService() { |
62 |
0 |
return _storyService; |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
public IterationService getIterationService() { |
67 |
0 |
return iterationService; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
public static final synchronized ServiceLocator getServiceLocator() { |
72 |
51 |
if (_locator == null) { |
73 |
18 |
_locator = new ServiceLocator(); |
74 |
|
} |
75 |
|
|
76 |
51 |
return _locator; |
77 |
|
} |
78 |
17 |
} |