Last active
May 26, 2020 00:48
-
-
Save ktor/ea0f0cf116a7a64e8f19fc6c14e87e30 to your computer and use it in GitHub Desktop.
Reload portal properties without restart on liferay portal 6.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // credit: https://stackoverflow.com/questions/11931375/is-it-possible-to-reflect-changes-in-portal-ext-properties-without-restarting-wh/51781616#51781616 | |
| import java.lang.reflect.Method; | |
| import com.liferay.portal.kernel.util.PortalClassLoaderUtil; | |
| //Loading the PropsUtil class by using PortalClassLoader | |
| Class<?> prospsUtilClass = PortalClassLoaderUtil.getClassLoader().loadClass("com.liferay.portal.util.PropsUtil"); | |
| //getting the reload method of PropsUtil class | |
| Method reloadMethod = prospsUtilClass.getMethod("reload", null); | |
| //Invoking the static reload method | |
| reloadMethod.invoke(null, null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment