Could you please give an example, how I can invoke the WroConfiguration.reloadCache()
method via JMX?
I use Wildfly, singleton startup ejb, in case it does matter.
JMX is switched on: jmxEnabled=true
Here is an example and requirements in Java EE environment:
cacheUpdatePeriod=0 modelUpdatePeriod=0 debug=false disableCache=true jmxEnabled=true ...
try { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("wro4j-ROOT:type=WroConfiguration"); mbs.invoke(name, "reloadCache", null, null); mbs.invoke(name, "reloadModel", null, null); } catch (InstanceNotFoundException e) { logger.warn("Could not find wro4j MBean. It has not been initiated yet"); } catch (Exception e) { logger.error(e); }