01: /**********************************************************************************
02: * $URL$
03: * $Id$
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.api;
21:
22: import org.apache.commons.logging.Log;
23: import org.apache.commons.logging.LogFactory;
24:
25: import org.sakaiproject.tool.assessment.api.spring.FactoryUtil;
26:
27: import org.sakaiproject.tool.assessment.shared.api.assessment.AssessmentServiceAPI;
28: import org.sakaiproject.tool.assessment.shared.api.assessment.ItemServiceAPI;
29: import org.sakaiproject.tool.assessment.shared.api.assessment.PublishedAssessmentServiceAPI;
30: import org.sakaiproject.tool.assessment.shared.api.assessment.SectionServiceAPI;
31: import org.sakaiproject.tool.assessment.shared.api.common.MediaServiceAPI;
32: import org.sakaiproject.tool.assessment.shared.api.common.TypeServiceAPI;
33: import org.sakaiproject.tool.assessment.shared.api.grading.GradebookServiceAPI;
34: import org.sakaiproject.tool.assessment.shared.api.grading.GradingServiceAPI;
35: import org.sakaiproject.tool.assessment.shared.api.qti.QTIServiceAPI;
36: import org.sakaiproject.tool.assessment.shared.api.questionpool.QuestionPoolServiceAPI;
37:
38: /**
39: * <p>Description: Factory for Samigo API</p>
40: * <p>This is an abstract class. It defines the public methods available for
41: * the properties that it furnishes. </p>
42: * @author Ed Smiley <esmiley@stanford.edu>
43: *
44: */
45: public abstract class SamigoApiFactory {
46: private static Log log = LogFactory.getLog(SamigoApiFactory.class);
47: private static SamigoApiFactory instance;
48:
49: /**
50: * Static method returning an implementation instance of this factory.
51: * @return the factory singleton
52: */
53: public static SamigoApiFactory getInstance() {
54: log.debug("SamigoApiFactory.getInstance()");
55: if (instance == null) {
56: try {
57: FactoryUtil.setUseLocator(true);
58: instance = FactoryUtil.lookup();
59: } catch (Exception ex) {
60: log.error("Unable to read integration context: " + ex);
61: }
62: }
63: log.debug("instance=" + instance);
64: return instance;
65: }
66:
67: // the factory api
68: public abstract AssessmentServiceAPI getAssessmentServiceAPI();
69:
70: public abstract ItemServiceAPI getItemServiceAPI();
71:
72: public abstract PublishedAssessmentServiceAPI getPublishedAssessmentServiceAPI();
73:
74: public abstract SectionServiceAPI getSectionServiceAPI();
75:
76: public abstract MediaServiceAPI getMediaServiceAPI();
77:
78: public abstract TypeServiceAPI getTypeServiceAPI();
79:
80: public abstract GradebookServiceAPI getGradebookServiceAPI();
81:
82: public abstract GradingServiceAPI getGradingServiceAPI();
83:
84: public abstract QTIServiceAPI getQtiServiceAPI();
85:
86: public abstract QuestionPoolServiceAPI getQuestionPoolServiceAPI();
87:
88: }
|