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.provider;
07:
08: import org.jasig.portal.PortalException;
09:
10: /**
11: * A factory for account store implementation.
12: *
13: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com"">pkharchenko@interactivebusiness.com"</a>}
14: * @version $Revision: 36690 $
15: */
16: public class AccountStoreFactory {
17: private static IAccountStore accountStoreImpl = null;
18:
19: /**
20: * Returns an instance of the {@link RDBMAccountStore}.
21: * Production installations are highly unlikely to use this factory, so the implementation choice is hard-coded in the factory.
22: * @return an IAccountStore implementation
23: * @exception PortalException if an error occurs
24: */
25: public static IAccountStore getAccountStoreImpl()
26: throws PortalException {
27: if (accountStoreImpl == null) {
28: initialize();
29: }
30: return accountStoreImpl;
31: }
32:
33: private static void initialize() throws PortalException {
34: try {
35: // Create an instance of the IAccountStore as specified in portal.properties
36: accountStoreImpl = new RDBMAccountStore();
37: } catch (Exception e) {
38: throw new PortalException(
39: "AccountStoreFactory: Could obtain an instance of RDBMAccountStore",
40: e);
41: }
42: }
43: }
|