Merge branch 'master' of git.dolda2000.com:/srv/git/r/jsvc
[jsvc.git] / src / dolda / jsvc / jmx / Context.java
CommitLineData
32994173
FT
1package dolda.jsvc.jmx;
2
3import javax.management.*;
4import java.util.*;
5import dolda.jsvc.*;
6
7public class Context implements ContextMBean {
8 public final ObjectName name;
9 private final ThreadContext b;
10
11 public Context(ThreadContext ctx) {
12 this.b = ctx;
13 Hashtable<String, String> info = new Hashtable<String, String>();
14 info.put("type", "Context");
15 info.put("name", getname());
16 try {
17 name = new ObjectName("dolda.jsvc", info);
18 } catch(MalformedObjectNameException e) {
19 throw(new RuntimeException(e));
20 }
21 }
22
23 public long getrequests() {
24 return(b.requests());
25 }
26
27 public String getname() {
28 return(b.server().name());
29 }
30}