X-Git-Url: http://dolda2000.com/gitweb/?p=jsvc.git;a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Fjmx%2FContext.java;fp=src%2Fdolda%2Fjsvc%2Fjmx%2FContext.java;h=2f062f67335ef94db4d0f8230b3b0809729b0109;hp=0000000000000000000000000000000000000000;hb=3299417335913b0886ca80ac0de62d76fc741dbe;hpb=152e6a84d89f748c1dc4877594702732a6147c4f diff --git a/src/dolda/jsvc/jmx/Context.java b/src/dolda/jsvc/jmx/Context.java new file mode 100644 index 0000000..2f062f6 --- /dev/null +++ b/src/dolda/jsvc/jmx/Context.java @@ -0,0 +1,30 @@ +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 info = new Hashtable(); + 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()); + } +}