KickJava   Java API By Example, From Geeks To Geeks.

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


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.net.URL JavaDoc;
12 import javax.management.ObjectName JavaDoc;
13
14 /**
15  * Management interface for the JythonRunner MBean.
16  *
17  * @version $Revision: 1.6 $
18  */

19 public interface JythonRunnerMBean
20 {
21    /**
22     * Executes a given script.
23     * If useText is true the text passed will be run as a script otherwise
24     * the script will be loaded from the URL an executed
25     */

26    public void runScript();
27
28    /**
29     * Gets the specific notification type being listened
30     */

31    public String JavaDoc getNotificationType();
32
33    /**
34     * Sets the notification type being listened.
35     * If null any notification will trigger the execution of the script.
36     * Otherwise only notifications matching notificationName will trigger it
37     */

38    public void setNotificationType(String JavaDoc notificationName);
39
40    /**
41     * Sets the object being observed by this MBean.
42     * The MBean will register itself as a listener of targetMBeanName
43     */

44    public void setObservedObject(ObjectName JavaDoc targetMBeanName);
45
46    /**
47     * Gets the object being observed by this MBean
48     */

49    public ObjectName JavaDoc getObservedObject();
50
51    /**
52     * Indicates wether to use the script given in the ScripText variable or the one given in the script File.
53     */

54    public boolean getUseText();
55
56    /**
57     * Sets the content of the script. If you want to use a file, use ScriptFile instead.
58     */

59    public void setScript(String JavaDoc text);
60
61    /**
62     * Returns the script as text.
63     */

64    public String JavaDoc getScript();
65
66    /**
67     * Returns the URL pointing to the script source
68     */

69    public URL JavaDoc getScriptURL();
70
71    /**
72     * Sets the script source as URL. If the cache script variable is true the file will be loaded only once, otherwise everytime the script is executed
73     */

74    public void setScriptURL(URL JavaDoc file);
75
76    /**
77     * Returns whether the script should be kept in the cache.
78     * If true, no further attempts to read the script will be done afterwards. By default is false
79     */

80    public boolean getCacheScript();
81
82    /**
83     * Sets whether the script should be kept in the cache. If true, no further attempts to read the script will be done afterwards. By default is false
84     */

85    public void setCacheScript(boolean useCache);
86 }
87
Popular Tags