|
38 | 38 | * can define scripts whose name depends on the event being processed, and the |
39 | 39 | * realm of the object that generated it. |
40 | 40 | * This way you can set a configuration like this: |
| 41 | + * <pre>{@code |
41 | 42 | * <log-listener class="org.jpos.bsh.BSHLoglistener"> |
42 | 43 | * <property name="source" value="general.bsh"/> |
43 | | - * <property name="source" value="tag_$tag.bsh"/> <!--this is to handle |
44 | | - * specific tags--> |
45 | | - * <property name="source" value="realm_$realm.bsh"/> <!-- to handle specific |
46 | | - * realms--> |
47 | | - * <property name="source" value="tag_$tag_realm_$realm.bsh"/> <!-- to handle |
48 | | - * specific tags from specific realms--> |
| 44 | + * <property name="source" value="tag_$tag.bsh"/> |
| 45 | + * <property name="source" value="realm_$realm.bsh"/> |
| 46 | + * <property name="source" value="tag_$tag_realm_$realm.bsh"/> |
49 | 47 | * </log-listener> |
50 | | - * <!-- the following lines are for html doc--> |
51 | | - * <br> |
52 | | - * <pre> |
53 | | - * <font color="#008080"><</font><font color="#008080">log-listener</font><font color="#008080"> </font><font color="#2e8b57"><b>class</b></font>=<font color="#ff00ff">"org.jpos.bsh.BSHLoglistener"</font><font color="#008080">></font> |
54 | | - * <font color="#008080"><</font><font color="#008080">property</font><font color="#008080"> </font><font color="#2e8b57"><b>name</b></font>=<font color="#ff00ff">"source"</font><font color="#008080"> </font><font color="#2e8b57"><b>value</b></font>=<font color="#ff00ff">"general.bsh"</font><font color="#008080">/></font> |
55 | | - * <font color="#008080"><</font><font color="#008080">property</font><font color="#008080"> </font><font color="#2e8b57"><b>name</b></font>=<font color="#ff00ff">"source"</font><font color="#008080"> </font><font color="#2e8b57"><b>value</b></font>=<font color="#ff00ff">"tag_$tag.bsh"</font><font color="#008080">/></font> <font color="#0000ff"><!</font><font color="#0000ff">--this is to handle specific tags--</font><font color="#0000ff">></font> |
56 | | - * <font color="#008080"><</font><font color="#008080">property</font><font color="#008080"> </font><font color="#2e8b57"><b>name</b></font>=<font color="#ff00ff">"source"</font><font color="#008080"> </font><font color="#2e8b57"><b>value</b></font>=<font color="#ff00ff">"realm_$realm.bsh"</font><font color="#008080">/></font> <font color="#0000ff"><!</font><font color="#0000ff">-- to handle specific realms--</font><font color="#0000ff">></font> |
57 | | - * <font color="#008080"><</font><font color="#008080">property</font><font color="#008080"> </font><font color="#2e8b57"><b>name</b></font>=<font color="#ff00ff">"source"</font><font color="#008080"> </font><font color="#2e8b57"><b>value</b></font>=<font color="#ff00ff">"tag_$tag_realm_$realm.bsh"</font><font color="#008080">/></font> <font color="#0000ff"><!</font><font color="#0000ff">-- to handle specific tags from specific realms--</font><font color="#0000ff">></font> |
58 | | - * <font color="#008080"></log-listener></font> |
59 | | - * </pre> |
60 | | - * <!-- end of lines for html doc--> |
| 48 | + * }</pre> |
61 | 49 | * If a source with the given name is not found, or it canbe read, it is not processed, so this lets |
62 | 50 | * you change what is processed in real time, if you put a file called |
63 | 51 | * tag_SystemMonitor_realm_monitor.bsh it will be executed whenever the system |
64 | 52 | * monitor is run.<BR> |
65 | 53 | * If you want to filter an event so that the remaining log listeners don't see |
66 | 54 | * it, you have to set event = null in your script.<br> |
67 | | - * <table border=1 color="black"> |
68 | | - * <caption>Other Configuration Options: </caption> |
69 | | - * <th><td> Name </td><td>Type </td><td>Description</td></th> |
70 | | - * <tr><td> filter-by-default </td><td>boolean </td><td> |
71 | | - * If true, filter the events if no script is processed, this way you can put a |
72 | | - * Log Listener that filters every thing unless you put some script file, even if |
73 | | - * it is empty, you also can dynamically change what kind of message are filtered |
74 | | - * by placing empty files with names like tag_SystemMonitor_realm_monitor.bsh in |
75 | | - * the previous example, if you "touch" a file with this name these events will |
76 | | - * begin to be processed.</TD></TR> |
77 | | - * <TR><TD> preload-scripts </TD><TD>boolean </TD><TD>If true scripts a |
78 | | - * loaded once, and kept in memory, being realoaded only if they are touched. This |
79 | | - * is good when you have lots of RAM memory but ou have troubles with |
80 | | - * speed</TD></TR> |
81 | | - * <TR><TD> save-name-space </TD><TD>boolean </TD><TD>If true the namespace |
82 | | - * of the script instance will be saved so that in the next event you can access |
83 | | - * them from the script, by default it's off, this property is overriden if the |
84 | | - * script exposes a boolean variable named saveNameSpace</TD></TR> |
85 | | - * <TR><TD> reload </TD><TD>long </TD><TD>this property is used |
86 | | - * if the preload-script property is true, is the time in milliseconds between |
87 | | - * updates in the script, during this time BSHLogListener will not check if the |
88 | | - * script source was modified or deleted on disk </TD></TR> |
89 | | - * </TABLE> |
| 55 | + * <table> |
| 56 | + * <caption>Other Configuration Options</caption> |
| 57 | + * <thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead> |
| 58 | + * <tbody> |
| 59 | + * <tr><td>{@code filter-by-default}</td><td>boolean</td><td> |
| 60 | + * If true, filter the events if no script is processed, so you can dynamically |
| 61 | + * control what is logged by placing or removing script files.</td></tr> |
| 62 | + * <tr><td>{@code preload-scripts}</td><td>boolean</td><td> |
| 63 | + * If true, scripts are loaded once and kept in memory, reloaded only when touched.</td></tr> |
| 64 | + * <tr><td>{@code save-name-space}</td><td>boolean</td><td> |
| 65 | + * If true, the BeanShell namespace is preserved between events (default: false). |
| 66 | + * Overridden by a {@code saveNameSpace} variable in the script.</td></tr> |
| 67 | + * <tr><td>{@code reload}</td><td>long</td><td> |
| 68 | + * When {@code preload-scripts} is true, the interval in milliseconds between |
| 69 | + * script modification checks.</td></tr> |
| 70 | + * </tbody> |
| 71 | + * </table> |
90 | 72 | */ |
91 | 73 | public class BSHLogListener implements org.jpos.util.LogListener, org.jpos.core.Configurable { |
92 | 74 | /**Holds the configuration for this object*/ |
|
0 commit comments