KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > jython > JythonRunnerMBeanDescription


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.tools.jython;
10
11 import java.lang.reflect.Method JavaDoc;
12
13 import mx4j.MBeanDescriptionAdapter;
14
15 /**
16  * Management interface descriptions for the JythonRunner MBean.
17  *
18  * @version $Revision: 1.7 $
19  */

20 public class JythonRunnerMBeanDescription extends MBeanDescriptionAdapter
21 {
22    public String JavaDoc getMBeanDescription()
23    {
24       return "Runs a jython script for management purposes";
25    }
26
27    public String JavaDoc getAttributeDescription(String JavaDoc attribute)
28    {
29       if (attribute.equals("NotificationType"))
30       {
31          return "The Notification type that triggers the script execution";
32       }
33       if (attribute.equals("ObservedObject"))
34       {
35          return "The ObjectName being observed";
36       }
37       if (attribute.equals("UseText"))
38       {
39          return "Indicates wether a text based or file based script is used";
40       }
41       if (attribute.equals("Script"))
42       {
43          return "The script text";
44       }
45       if (attribute.equals("ScriptURL"))
46       {
47          return "The script's URL";
48       }
49       if (attribute.equals("CacheScript"))
50       {
51          return "Indicates whether the script is read every time or only once";
52       }
53       return super.getAttributeDescription(attribute);
54    }
55
56    public String JavaDoc getOperationDescription(Method JavaDoc operation)
57    {
58       String JavaDoc name = operation.getName();
59       if (name.equals("runScript"))
60       {
61          return "Runs the jython script";
62       }
63       return super.getOperationDescription(operation);
64    }
65 }
66
Popular Tags