KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > server > interceptor > MBeanServerInterceptorConfiguratorMBeanDescription


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.server.interceptor;
10
11 import java.lang.reflect.Constructor JavaDoc;
12 import java.lang.reflect.Method JavaDoc;
13
14 import mx4j.MBeanDescriptionAdapter;
15
16 /**
17  * Management interface description for the MBeanServerInterceptorConfigurator MBean.
18  *
19  * @version $Revision: 1.3 $
20  */

21 public class MBeanServerInterceptorConfiguratorMBeanDescription extends MBeanDescriptionAdapter
22 {
23    public String JavaDoc getMBeanDescription()
24    {
25       return "Configurator for MBeanServer to MBean interceptors";
26    }
27
28    public String JavaDoc getConstructorDescription(Constructor JavaDoc ctor)
29    {
30       if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)"))
31       {
32          return "Creates a new instance of MBeanServer to MBean interceptor configurator";
33       }
34       return super.getConstructorDescription(ctor);
35    }
36
37    public String JavaDoc getConstructorParameterName(Constructor JavaDoc ctor, int index)
38    {
39       if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)"))
40       {
41          switch (index)
42          {
43             case 0:
44                return "server";
45          }
46       }
47       return super.getConstructorParameterName(ctor, index);
48    }
49
50    public String JavaDoc getConstructorParameterDescription(Constructor JavaDoc ctor, int index)
51    {
52       if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)"))
53       {
54          switch (index)
55          {
56             case 0:
57                return "The MBeanServer that uses this configurator";
58          }
59       }
60       return super.getConstructorParameterDescription(ctor, index);
61    }
62
63    public String JavaDoc getAttributeDescription(String JavaDoc attribute)
64    {
65       if (attribute.equals("Running"))
66       {
67          return "The running status of the configurator";
68       }
69       return super.getAttributeDescription(attribute);
70    }
71
72    public String JavaDoc getOperationDescription(Method JavaDoc operation)
73    {
74       String JavaDoc name = operation.getName();
75       if (name.equals("addInterceptor"))
76       {
77          return "Appends an interceptor to the interceptor chain";
78       }
79       if (name.equals("registerInterceptor"))
80       {
81          return "Appends an MBean interceptor to the interceptor chain and registers it";
82       }
83       if (name.equals("clearInterceptors"))
84       {
85          return "Removes all the interceptors added via addInterceptor(MBeanServerInterceptor interceptor)";
86       }
87       if (name.equals("start"))
88       {
89          return "Starts the configurator so that the MBeanServer can accept incoming calls";
90       }
91       if (name.equals("stop"))
92       {
93          return "Stops the configurator so that the MBeanServer cannot accept incoming calls";
94       }
95       return super.getOperationDescription(operation);
96    }
97
98    public String JavaDoc getOperationParameterName(Method JavaDoc method, int index)
99    {
100       String JavaDoc name = method.getName();
101       if (name.equals("addInterceptor"))
102       {
103          switch (index)
104          {
105             case 0:
106                return "interceptor";
107          }
108       }
109       if (name.equals("registerInterceptor"))
110       {
111          switch (index)
112          {
113             case 0:
114                return "interceptor";
115             case 1:
116                return "name";
117          }
118       }
119       return super.getOperationParameterName(method, index);
120    }
121
122    public String JavaDoc getOperationParameterDescription(Method JavaDoc method, int index)
123    {
124       String JavaDoc name = method.getName();
125       if (name.equals("addInterceptor"))
126       {
127          switch (index)
128          {
129             case 0:
130                return "The interceptor to be appended to the interceptor chain";
131          }
132       }
133       if (name.equals("registerInterceptor"))
134       {
135          switch (index)
136          {
137             case 0:
138                return "The interceptor to be appended to the interceptor chain";
139             case 1:
140                return "The ObjectName under which register the interceptor";
141          }
142       }
143       return super.getOperationParameterDescription(method, index);
144    }
145 }
146
Popular Tags