1
22
23 package com.liferay.portal.security.auth;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
28 import com.liferay.portal.util.PropsValues;
29
30
35 public class FullNameValidatorFactory {
36
37 public static FullNameValidator getInstance() {
38 if (_fullNameValidator == null) {
39 if (_log.isDebugEnabled()) {
40 _log.debug(
41 "Instantiate " + PropsValues.USERS_FULL_NAME_VALIDATOR);
42 }
43
44 ClassLoader classLoader = PortalClassLoaderUtil.getClassLoader();
45
46 try {
47 _fullNameValidator = (FullNameValidator)classLoader.loadClass(
48 PropsValues.USERS_FULL_NAME_VALIDATOR).newInstance();
49 }
50 catch (Exception e) {
51 _log.error(e, e);
52 }
53 }
54
55 if (_log.isDebugEnabled()) {
56 _log.debug("Return " + _fullNameValidator.getClass().getName());
57 }
58
59 return _fullNameValidator;
60 }
61
62 public static void setInstance(FullNameValidator fullNameValidator) {
63 if (_log.isDebugEnabled()) {
64 _log.debug("Set " + fullNameValidator.getClass().getName());
65 }
66
67 _fullNameValidator = fullNameValidator;
68 }
69
70 private static Log _log =
71 LogFactoryUtil.getLog(FullNameValidatorFactory.class);
72
73 private static FullNameValidator _fullNameValidator = null;
74
75 }