01: package org.objectweb.celtix.bus.management.jmx.export;
02:
03: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedAttribute;
04: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedNotification;
05: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedNotifications;
06: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedOperation;
07: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedOperationParameter;
08: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedOperationParameters;
09: import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedResource;
10: import org.objectweb.celtix.management.Instrumentation;
11:
12: @ManagedResource(componentName="AnnotationTest",description="My Managed Bean",persistPolicy="OnUpdate",currencyTimeLimit=15,log=false,logFile="jmx.log",persistPeriod=200,persistLocation="/local/work",persistName="bar.jmx")
13: @ManagedNotifications({@ManagedNotification(name="My Notification",notificationTypes={"type.foo","type.bar"})})
14: public class AnnotationTestInstrumentation implements Instrumentation {
15:
16: private String name;
17:
18: private String nickName;
19:
20: private int age;
21:
22: private boolean isSuperman;
23:
24: @ManagedAttribute(description="The Age Attribute",currencyTimeLimit=15)
25: public int getAge() {
26: return age;
27: }
28:
29: public void setAge(int a) {
30: this .age = a;
31: }
32:
33: @ManagedOperation(currencyTimeLimit=30)
34: public long myOperation() {
35: return 1L;
36: }
37:
38: @ManagedAttribute(description="The Name Attribute",currencyTimeLimit=20,defaultValue="bar",persistPolicy="OnUpdate")
39: public void setName(String n) {
40: this .name = n;
41: }
42:
43: @ManagedAttribute(defaultValue="bar",persistPeriod=300)
44: public String getName() {
45: return name;
46: }
47:
48: @ManagedAttribute(defaultValue="barasd",description="The Nick Name Attribute")
49: public String getNickName() {
50: return this .nickName;
51: }
52:
53: public void setNickName(String n) {
54: this .nickName = n;
55: }
56:
57: @ManagedAttribute(description="The Is Superman Attribute")
58: public void setSuperman(boolean super man) {
59: this .isSuperman = super man;
60: }
61:
62: public boolean isSuperman() {
63: return isSuperman;
64: }
65:
66: @ManagedOperation(description="Add Two Numbers Together")
67: @ManagedOperationParameters({@ManagedOperationParameter(name="x",description="Left operand"),@ManagedOperationParameter(name="y",description="Right operand")})
68: public int add(int x, int y) {
69: return x + y;
70: }
71:
72: public String getInstrumentationName() {
73: return "AnnotationTestInstrumentation";
74: }
75:
76: public Object getComponent() {
77: return this ;
78: }
79:
80: public String getUniqueInstrumentationName() {
81: return "AnnotationTestInstrumentation";
82: }
83:
84: }
|