001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/entity/tags/sakai_2-4-1/entity-api/api/src/java/org/sakaiproject/entity/cover/EntityManager.java $
003: * $Id: EntityManager.java 7396 2006-04-06 03:46:58Z ggolden@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.entity.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * EntityManager is a static Cover for the {@link org.sakaiproject.entity.api.EntityManager EntityManager}; see that interface for usage details.
027: * </p>
028: */
029: public class EntityManager {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.entity.api.EntityManager getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.entity.api.EntityManager) ComponentManager
039: .get(org.sakaiproject.entity.api.EntityManager.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.entity.api.EntityManager) ComponentManager
043: .get(org.sakaiproject.entity.api.EntityManager.class);
044: }
045: }
046:
047: private static org.sakaiproject.entity.api.EntityManager m_instance = null;
048:
049: public static void registerEntityProducer(
050: org.sakaiproject.entity.api.EntityProducer param0,
051: java.lang.String param1) {
052: org.sakaiproject.entity.api.EntityManager service = getInstance();
053: if (service == null)
054: return;
055:
056: service.registerEntityProducer(param0, param1);
057: }
058:
059: public static java.util.List getEntityProducers() {
060: org.sakaiproject.entity.api.EntityManager service = getInstance();
061: if (service == null)
062: return null;
063:
064: return service.getEntityProducers();
065: }
066:
067: public static org.sakaiproject.entity.api.Reference newReference(
068: java.lang.String param0) {
069: org.sakaiproject.entity.api.EntityManager service = getInstance();
070: if (service == null)
071: return null;
072:
073: return service.newReference(param0);
074: }
075:
076: public static org.sakaiproject.entity.api.Reference newReference(
077: org.sakaiproject.entity.api.Reference param0) {
078: org.sakaiproject.entity.api.EntityManager service = getInstance();
079: if (service == null)
080: return null;
081:
082: return service.newReference(param0);
083: }
084:
085: public static java.util.List newReferenceList() {
086: org.sakaiproject.entity.api.EntityManager service = getInstance();
087: if (service == null)
088: return null;
089:
090: return service.newReferenceList();
091: }
092:
093: public static java.util.List newReferenceList(java.util.List param0) {
094: org.sakaiproject.entity.api.EntityManager service = getInstance();
095: if (service == null)
096: return null;
097:
098: return service.newReferenceList(param0);
099: }
100:
101: public static boolean checkReference(java.lang.String param0) {
102: org.sakaiproject.entity.api.EntityManager service = getInstance();
103: if (service == null)
104: return false;
105:
106: return service.checkReference(param0);
107: }
108: }
|