2 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
\r
4 * This library is free software; you can redistribute it and/or modify it under
\r
5 * the terms of the GNU Lesser General Public License as published by the Free
\r
6 * Software Foundation; either version 2.1 of the License, or (at your option)
\r
9 * This library is distributed in the hope that it will be useful, but WITHOUT
\r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
\r
15 package com.liferay.portal.security.ldap;
\r
17 import com.liferay.portal.kernel.log.Log;
\r
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
\r
19 import com.liferay.portal.security.pacl.PACLClassLoaderUtil;
\r
20 import com.liferay.portal.util.PropsValues;
\r
23 * @author Brian Wing Shun Chan
\r
25 public class ENTAttributesTransformerFactory {
\r
27 public static ENTAttributesTransformer getInstance() {
\r
29 if (_attributesTransformer == null) {
\r
30 if (_log.isDebugEnabled()) {
\r
32 "Instantiate " + PropsValues.LDAP_ATTRS_TRANSFORMER_IMPL);
\r
35 ClassLoader classLoader =
\r
36 PACLClassLoaderUtil.getPortalClassLoader();
\r
39 _attributesTransformer =
\r
40 (ENTAttributesTransformer)classLoader.loadClass(
\r
41 PropsValues.LDAP_ATTRS_TRANSFORMER_IMPL).newInstance();
\r
43 catch (Exception e) {
\r
48 if (_log.isDebugEnabled()) {
\r
49 _log.debug("Return " + _attributesTransformer.getClass().getName());
\r
52 return _attributesTransformer;
\r
55 public static void setInstance(
\r
56 ENTAttributesTransformer attributesTransformer) {
\r
58 if (_log.isDebugEnabled()) {
\r
59 _log.debug("Set " + attributesTransformer.getClass().getName());
\r
62 _attributesTransformer = attributesTransformer;
\r
65 private static Log _log = LogFactoryUtil.getLog(
\r
66 ENTAttributesTransformerFactory.class);
\r
68 private static ENTAttributesTransformer _attributesTransformer;
\r