Hi,
We are using jfig to load configuration files in a webapp deployed under tomcat 8.x. Everything is working fine and we are getting values as expected the only issue is once we change the files those are not getting reflected at runtime but if we restart the server then new values are available.
I have attached the sample code below which we are using to load config files and attaching listeners:
One other thing to consider. I generally have some sort of GUI interface or
web service on my applications that will call JFig initialize. I realize
that's not exactly what you're looking for but it will at least give you a
manual way to process the updated files.
On Aug 25, 2014 12:47 AM, "prateekjain jain" prateekjainaa@users.sf.net
wrote:
Hi,
We are using jfig to load configuration files in a webapp deployed under
tomcat 8.x. Everything is working fine and we are getting values as
expected the only issue is once we change the files those are not getting
reflected at runtime but if we restart the server then new values are
available.
I have attached the sample code below which we are using to load config
files and attaching listeners:
public class FileLoader implements JFigListener {
private List<File> configurationFiles;private final static String DIR_TO_LOAD = FileUtils
.getEvnProperty("ICEX_HOME") + "/conf/tenants/";private Map<ICEXConfMapKey, JFigImpl=""> configMap = new HashMap<ICEXConfMapKey, JFigImpl="">();private static FileLoader loader;
public static FileLoader getInstance() {
if(null==loader) {
loader = new FileLoader();
}
return loader;}
public Collection<JFigImpl> getFigObjects() {
return configMap.values();}
public void loadFile(File file) {
ICEXConfMapKey key = makeICEXConfMapKey(file);
JFigImpl fig = (JFigImpl)explicitLoad(file);
configMap.put(key, fig);}
public JFigIF explicitLoad(File file) {
JFigLocatorIF i = new JFigLocator(file.getAbsolutePath());
JFigIF fig = null;
try {
fig = JFig.initialize(i);
fig.addConfigEventListener(loader);
} catch (JFigException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Hi,
We are using jfig to load configuration files in a webapp deployed under tomcat 8.x. Everything is working fine and we are getting values as expected the only issue is once we change the files those are not getting reflected at runtime but if we restart the server then new values are available.
I have attached the sample code below which we are using to load config files and attaching listeners:
public class FileLoader implements JFigListener {
}
It would be great if you have any pointers to this.
One other thing to consider. I generally have some sort of GUI interface or
web service on my applications that will call JFig initialize. I realize
that's not exactly what you're looking for but it will at least give you a
manual way to process the updated files.
On Aug 25, 2014 12:47 AM, "prateekjain jain" prateekjainaa@users.sf.net
wrote: