01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/integration/context/IntegrationContextFactory.java $
03: * $Id: IntegrationContextFactory.java 9347 2006-05-13 04:13:19Z daisyf@stanford.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the"License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.tool.assessment.integration.context;
21:
22: import org.apache.commons.logging.Log;
23: import org.apache.commons.logging.LogFactory;
24:
25: import org.sakaiproject.tool.assessment.integration.context.spring.FactoryUtil;
26: import org.sakaiproject.tool.assessment.integration.helper.ifc.AgentHelper;
27: import org.sakaiproject.tool.assessment.integration.helper.ifc.GradebookHelper;
28: import org.sakaiproject.tool.assessment.integration.helper.ifc.GradebookServiceHelper;
29: import org.sakaiproject.tool.assessment.integration.helper.ifc.PublishingTargetHelper;
30: import org.sakaiproject.tool.assessment.integration.helper.ifc.SectionAwareServiceHelper;
31: import org.sakaiproject.tool.assessment.integration.helper.ifc.ServerConfigurationServiceHelper;
32:
33: /**
34: * This is an abstract class. It defines the public methods available for
35: * the properties that it furnishes.
36: *
37: * @author Ed Smiley
38: */
39: public abstract class IntegrationContextFactory {
40: private static Log log = LogFactory
41: .getLog(IntegrationContextFactory.class);
42: private static IntegrationContextFactory instance;
43:
44: /**
45: * Static method returning an implementation instance of this factory.
46: * @return the factory singleton
47: */
48: public static IntegrationContextFactory getInstance() {
49: log.debug("IntegrationContextFactory.getInstance()");
50: if (instance == null) {
51: try {
52: FactoryUtil.setUseLocator(true);
53: instance = FactoryUtil.lookup();
54: } catch (Exception ex) {
55: log.error("Unable to read integration context: " + ex);
56: }
57: }
58: log.debug("instance=" + instance);
59: return instance;
60: }
61:
62: // the factory api
63: public abstract boolean isIntegrated();
64:
65: public abstract AgentHelper getAgentHelper();
66:
67: public abstract GradebookHelper getGradebookHelper();
68:
69: public abstract GradebookServiceHelper getGradebookServiceHelper();
70:
71: public abstract PublishingTargetHelper getPublishingTargetHelper();
72:
73: public abstract SectionAwareServiceHelper getSectionAwareServiceHelper();
74:
75: public abstract ServerConfigurationServiceHelper getServerConfigurationServiceHelper();
76: }
|