001
014
015 package com.liferay.portal.security.auth;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.InstanceFactory;
020 import com.liferay.portal.security.pacl.PACLClassLoaderUtil;
021 import com.liferay.portal.util.PropsValues;
022
023
026 public class FullNameValidatorFactory {
027
028 public static FullNameValidator getInstance() {
029 if (_fullNameValidator == null) {
030 if (_log.isDebugEnabled()) {
031 _log.debug(
032 "Instantiate " + PropsValues.USERS_FULL_NAME_VALIDATOR);
033 }
034
035 ClassLoader classLoader =
036 PACLClassLoaderUtil.getPortalClassLoader();
037
038 try {
039 _fullNameValidator =
040 (FullNameValidator)InstanceFactory.newInstance(
041 classLoader, PropsValues.USERS_FULL_NAME_VALIDATOR);
042 }
043 catch (Exception e) {
044 _log.error(e, e);
045 }
046 }
047
048 if (_log.isDebugEnabled()) {
049 _log.debug("Return " + _fullNameValidator.getClass().getName());
050 }
051
052 return _fullNameValidator;
053 }
054
055 public static void setInstance(FullNameValidator fullNameValidator) {
056 if (_log.isDebugEnabled()) {
057 _log.debug("Set " + fullNameValidator.getClass().getName());
058 }
059
060 _fullNameValidator = fullNameValidator;
061 }
062
063 private static Log _log = LogFactoryUtil.getLog(
064 FullNameValidatorFactory.class);
065
066 private static FullNameValidator _fullNameValidator;
067
068 }