As I understand it, JBoss* monitors a variety of file types in /deploy
and performs certain actions when the file changes. For example, JBoss will redeploy an EAR when its last-modified
time changes.
Therefore, I could use some really nasty code to make an EAR redeploy itself, like this:
URL url = this.getClass().getClassLoader().getResource("../RavenWeb.ear");
String path = url.getPath();
File ear = new File(path);
ear.setLastModified(System.currentTimeMillis());
But what I really want to do is just have JBoss redeploy the webapp when an external config file changes. Say the config file lives at C:/foo/bar.properties
.
Is there an MBean or some other way getting this done that won't get me mauled by velociraptors?
*I'm using JBoss 5.1.0, if it matters.