01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.security;
07:
08: import org.jasig.portal.properties.PropertiesManager;
09: import org.apache.commons.logging.Log;
10: import org.apache.commons.logging.LogFactory;
11:
12: /**
13: * @author Bernie Durfee (bdurfee@interactivebusiness.com)
14: */
15: public class PersonManagerFactory {
16:
17: private static final Log log = LogFactory
18: .getLog(PersonManagerFactory.class);
19:
20: private static IPersonManager m_personManager = null;
21: static {
22: // Retrieve the class name of the concrete IPersonManager implementation
23: String personManagerClass = PropertiesManager
24: .getProperty(
25: "org.jasig.portal.security.PersonManagerFactory.implementation",
26: null);
27: // Fail if this is not found
28: if (personManagerClass == null) {
29: log
30: .error("PersonManagerFactory: org.jasig.portal.security.PersonManagerFactory.implementation must be specified in portal.properties");
31: }
32: try {
33: // Create an instance of the IPersonManager as specified in portal.properties
34: m_personManager = (IPersonManager) Class.forName(
35: personManagerClass).newInstance();
36: } catch (Exception e) {
37: log.error("PersonManagerFactory: Could not instantiate "
38: + personManagerClass, e);
39: }
40: }
41:
42: /**
43: * Returns an instance of the IPersonManager specified in portal.properties
44: * @return instance of the IPersonManager
45: */
46: public static IPersonManager getPersonManagerInstance() {
47: return (m_personManager);
48: }
49: }
|