source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/manager/ComponentManager.java @ 1146

Last change on this file since 1146 was 1146, checked in by pharms, 11 years ago
  • complete refactoring of task tree model with a separation of task models and task instances
  • appropriate adaptation of task tree generation process
  • appropriate adaptation of commands and task tree visualization
  • Property svn:executable set to *
File size: 2.9 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.tasktrees.manager;
16
17import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;
18import de.ugoe.cs.autoquest.tasktrees.temporalrelation.TemporalRelationshipRuleManager;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;
20import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;
21import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;
22import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;
23
24/**
25 * TODO comment
26 *
27 * @version $Revision: $ $Date: 12.02.2012$
28 * @author 2012, last modified by $Author: patrick$
29 */
30public class ComponentManager {
31   
32    /** */
33    private static ComponentManager instance;
34
35    /** */
36    private TemporalRelationshipRuleManager temporalRelationshipRuleManager;
37
38    /** */
39    private TaskEqualityRuleManager taskEqualityRuleManager;
40
41    /** */
42    private ITaskBuilder taskBuilder;
43
44    /** */
45    private ITaskFactory taskFactory;
46
47    /**
48     *
49     */
50    public static TemporalRelationshipRuleManager getTemporalRelationshipRuleManager() {
51        return getInstance().temporalRelationshipRuleManager;
52    }
53
54    /**
55     *
56     */
57    public static TaskEqualityRuleManager getTaskEqualityRuleManager() {
58        return getInstance().taskEqualityRuleManager;
59    }
60
61    /**
62     *
63     */
64    public static ITaskBuilder getDefaultTaskBuilder() {
65        return getInstance().taskBuilder;
66    }
67
68    /**
69     *
70     */
71    public static ITaskFactory getDefaultTaskFactory() {
72        return getInstance().taskFactory;
73    }
74
75    /**
76     *
77     */
78    public static synchronized void clearInstance() {
79        instance = null;
80    }
81
82    /**
83     *
84     */
85    private static synchronized ComponentManager getInstance() {
86        if (instance == null) {
87            instance = new ComponentManager();
88            instance.init();
89        }
90        return instance;
91    }
92
93    /**
94     *
95     */
96    private void init() {
97        taskEqualityRuleManager = new TaskEqualityRuleManager();
98        taskEqualityRuleManager.init();
99
100        taskBuilder = new TaskBuilder();
101        taskFactory = new TaskFactory();
102
103        temporalRelationshipRuleManager = new TemporalRelationshipRuleManager
104            (taskEqualityRuleManager, taskFactory, taskBuilder);
105        temporalRelationshipRuleManager.init();
106    }
107
108}
Note: See TracBrowser for help on using the repository browser.