001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/tool/tags/sakai_2-4-1/tool-api/api/src/java/org/sakaiproject/tool/cover/ActiveToolManager.java $
003: * $Id: ActiveToolManager.java 21132 2007-02-08 14:49:12Z csev@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.cover;
021:
022: import java.util.List;
023: import java.io.File;
024:
025: import org.sakaiproject.component.cover.ComponentManager;
026: import org.sakaiproject.tool.api.Tool;
027:
028: import org.w3c.dom.Document;
029:
030: /**
031: * <p>
032: * ActiveToolManager is a static Cover for the {@link org.sakaiproject.tool.api.ActiveToolManager ActiveToolManager}; see that interface for usage details.
033: * </p>
034: */
035: public class ActiveToolManager {
036: /** Possibly cached component instance. */
037: private static org.sakaiproject.tool.api.ActiveToolManager m_instance = null;
038:
039: /**
040: * Access the component instance: special cover only method.
041: *
042: * @return the component instance.
043: */
044: public static org.sakaiproject.tool.api.ActiveToolManager getInstance() {
045: if (ComponentManager.CACHE_COMPONENTS) {
046: if (m_instance == null)
047: m_instance = (org.sakaiproject.tool.api.ActiveToolManager) ComponentManager
048: .get(org.sakaiproject.tool.api.ActiveToolManager.class);
049: return m_instance;
050: } else {
051: return (org.sakaiproject.tool.api.ActiveToolManager) ComponentManager
052: .get(org.sakaiproject.tool.api.ActiveToolManager.class);
053: }
054: }
055:
056: public static void register(org.sakaiproject.tool.api.Tool param0) {
057: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
058: if (manager == null)
059: return;
060:
061: manager.register(param0);
062: }
063:
064: public static void register(org.w3c.dom.Document param0) {
065: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
066: if (manager == null)
067: return;
068:
069: manager.register(param0);
070: }
071:
072: public static void register(java.io.InputStream param0) {
073: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
074: if (manager == null)
075: return;
076:
077: manager.register(param0);
078: }
079:
080: public static void register(java.io.File param0) {
081: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
082: if (manager == null)
083: return;
084:
085: manager.register(param0);
086: }
087:
088: public static org.sakaiproject.tool.api.Tool getTool(
089: java.lang.String param0) {
090: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
091: if (manager == null)
092: return null;
093:
094: return manager.getTool(param0);
095: }
096:
097: public static java.util.Set findTools(java.util.Set param0,
098: java.util.Set param1) {
099: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
100: if (manager == null)
101: return null;
102:
103: return manager.findTools(param0, param1);
104: }
105:
106: public static void register(org.sakaiproject.tool.api.Tool param0,
107: javax.servlet.ServletContext param1) {
108: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
109: if (manager == null)
110: return;
111:
112: manager.register(param0, param1);
113: }
114:
115: public static void register(org.w3c.dom.Document param0,
116: javax.servlet.ServletContext param1) {
117: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
118: if (manager == null)
119: return;
120:
121: manager.register(param0, param1);
122: }
123:
124: public static void register(java.io.InputStream param0,
125: javax.servlet.ServletContext param1) {
126: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
127: if (manager == null)
128: return;
129:
130: manager.register(param0, param1);
131: }
132:
133: public static void register(java.io.File param0,
134: javax.servlet.ServletContext param1) {
135: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
136: if (manager == null)
137: return;
138:
139: manager.register(param0, param1);
140: }
141:
142: public static List<Tool> parseTools(File param0) {
143: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
144: if (manager == null)
145: return null;
146:
147: return manager.parseTools(param0);
148: }
149:
150: public static List<Tool> parseTools(Document param0) {
151: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
152: if (manager == null)
153: return null;
154:
155: return manager.parseTools(param0);
156: }
157:
158: public static org.sakaiproject.tool.api.ActiveTool getActiveTool(
159: java.lang.String param0) {
160: org.sakaiproject.tool.api.ActiveToolManager manager = getInstance();
161: if (manager == null)
162: return null;
163:
164: return manager.getActiveTool(param0);
165: }
166: }
|