001
014
015 package com.liferay.portal.kernel.deploy.hot;
016
017 import com.liferay.portal.kernel.util.AutoResetThreadLocal;
018 import com.liferay.portal.kernel.util.GetterUtil;
019 import com.liferay.portal.kernel.util.PropsKeys;
020 import com.liferay.portal.kernel.util.PropsUtil;
021
022
026 public class DependencyManagementThreadLocal {
027
028 public static Boolean isEnabled() {
029 return _enabled.get();
030 }
031
032 public static void setEnabled(boolean enabled) {
033 _enabled.set(enabled);
034 }
035
036 private static ThreadLocal<Boolean> _enabled;
037
038 static {
039 if (GetterUtil.getBoolean(
040 PropsUtil.get(
041 PropsKeys.HOT_DEPLOY_DEPENDENCY_MANAGEMENT_ENABLED),
042 true)) {
043
044 _enabled = new AutoResetThreadLocal<Boolean>(
045 DependencyManagementThreadLocal.class + ".enabled", true);
046 }
047 else {
048 _enabled = new ThreadLocal<Boolean>() {
049
050 @Override
051 public Boolean get() {
052 return Boolean.FALSE;
053 }
054
055 };
056 }
057 }
058
059 }