KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > services > loggingmonitor > LoggingMonitorMBean


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.services.loggingmonitor;
23
24 import javax.management.MalformedObjectNameException JavaDoc;
25
26 import org.jboss.system.ServiceMBean;
27 import org.w3c.dom.Element JavaDoc;
28
29 /**
30  * This is the management interface of the LoggingMonitor service which provides
31  * the ability to create monitoring logs for various MBeans and their
32  * attributes.
33  *
34  * @author <a HREF="mailto:jimmy.wilson@acxiom.com">James Wilson</a>
35  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
36  * @version $Revision: 37459 $
37  */

38 public interface LoggingMonitorMBean extends ServiceMBean
39 {
40    /**
41     * The name of the file to which this monitor's information
42     * will be logged.
43     */

44    void setFilename(String JavaDoc filename);
45    String JavaDoc getFilename();
46
47    /**
48     * Flag to indicate whether or not this monitor's log file should have
49     * information appended to it, if it already exists. (default is true)
50     */

51    void setAppendToFile(boolean appendToFile);
52    boolean getAppendToFile();
53
54    /**
55     * This monitor's log file rollover period. Valid values are
56     * MONTH, WEEK, DAY, HALFDAY, HOUR, and MINUTE (case insensitive).
57     * (default is DAY)
58     */

59    void setRolloverPeriod(String JavaDoc rolloverPeriod);
60    String JavaDoc getRolloverPeriod();
61
62    /**
63     * The period to delay between monitoring snapshots.
64     * (non-zero positive value)
65     */

66    void setMonitorPeriod(long monitorPeriod);
67    long getMonitorPeriod();
68
69    /**
70     * The PatternLayout for logging entries
71     * (default is "%d %-5p [%c] %m%n")
72     */

73    void setPatternLayout(String JavaDoc patternLayout);
74    String JavaDoc getPatternLayout();
75    
76    /**
77     * This monitor's log file rollover format as determined by the
78     * <code>RolloverPeriod</code> attribute.
79     */

80     String JavaDoc getRolloverFormat();
81     
82    /**
83     * Sets the monitored objects configuration.
84     *
85     * @param monitoredObjects the objects to be monitored specified in the
86     * following format:
87     * <pre>
88     * &lt;attribute name="MonitoredObjects"&gt;
89     * &lt;configuration&gt;
90     * &lt;monitoredmbean name="[object name]" logger="[logger name]"&gt;
91     * &lt;attribute&gt;[attribute name]&lt;/attribute&gt;
92     * &lt;attribute&gt;[attribute name]&lt;/attribute&gt;
93     * ...
94     * &lt;/monitoredmbean&gt;
95     * &lt;/configuration&gt;
96     * &lt;/attribute&gt;
97     * </pre>
98     *
99     * @throws MalformedObjectNameException if the monitored objects
100     * configuration contains an invalid
101     * object name.
102     */

103    void setMonitoredObjects(Element JavaDoc monitoredObjects) throws MalformedObjectNameException JavaDoc;
104
105 }
106
Popular Tags