--- /dev/null
+package dolda.jsvc.jmx;
+
+import javax.management.*;
+import java.util.*;
+import dolda.jsvc.*;
+
+public class Context implements ContextMBean {
+ public final ObjectName name;
+ private final ThreadContext b;
+
+ public Context(ThreadContext ctx) {
+ this.b = ctx;
+ Hashtable<String, String> info = new Hashtable<String, String>();
+ info.put("type", "Context");
+ info.put("name", getname());
+ try {
+ name = new ObjectName("dolda.jsvc", info);
+ } catch(MalformedObjectNameException e) {
+ throw(new RuntimeException(e));
+ }
+ }
+
+ public long getrequests() {
+ return(b.requests());
+ }
+
+ public String getname() {
+ return(b.server().name());
+ }
+}