Added some JMX support.
[jsvc.git] / src / dolda / jsvc / scgi / DSContext.java
index 350e1c5..09fe1a9 100644 (file)
@@ -9,6 +9,7 @@ public class DSContext extends SimpleContext {
     public final long mtime;
     public final ThreadContext tg;
     private final Environment env;
+    public final dolda.jsvc.jmx.Context mbean;
 
     private static String mangle(File f) {
        String ret = f.getName();
@@ -34,9 +35,14 @@ public class DSContext extends SimpleContext {
        this.env = env;
        loadconfig();
        this.tg = ThreadContext.create(this, loader);
+       mbean = new dolda.jsvc.jmx.Context(tg);
     }
     
     private void loadconfig() {
+       if(env.root != null) {
+           File sroot = new File(new File(env.root, "store"), name());
+           sysconfig.put("jsvc.storage", "file:" + sroot.getPath());
+       }
        sysconfig.putAll(env.sysconfig);
     }