001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.services.loggingmonitor;
023:
024: import javax.management.MalformedObjectNameException;
025:
026: import org.jboss.system.ServiceMBean;
027: import org.w3c.dom.Element;
028:
029: /**
030: * This is the management interface of the LoggingMonitor service which provides
031: * the ability to create monitoring logs for various MBeans and their
032: * attributes.
033: *
034: * @author <a href="mailto:jimmy.wilson@acxiom.com">James Wilson</a>
035: * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
036: * @version $Revision: 57210 $
037: */
038: public interface LoggingMonitorMBean extends ServiceMBean {
039: /**
040: * The name of the file to which this monitor's information
041: * will be logged.
042: */
043: void setFilename(String filename);
044:
045: String getFilename();
046:
047: /**
048: * Flag to indicate whether or not this monitor's log file should have
049: * information appended to it, if it already exists. (default is true)
050: */
051: void setAppendToFile(boolean appendToFile);
052:
053: boolean getAppendToFile();
054:
055: /**
056: * This monitor's log file rollover period. Valid values are
057: * MONTH, WEEK, DAY, HALFDAY, HOUR, and MINUTE (case insensitive).
058: * (default is DAY)
059: */
060: void setRolloverPeriod(String rolloverPeriod);
061:
062: String getRolloverPeriod();
063:
064: /**
065: * The period to delay between monitoring snapshots.
066: * (non-zero positive value)
067: */
068: void setMonitorPeriod(long monitorPeriod);
069:
070: long getMonitorPeriod();
071:
072: /**
073: * The PatternLayout for logging entries
074: * (default is "%d %-5p [%c] %m%n")
075: */
076: void setPatternLayout(String patternLayout);
077:
078: String getPatternLayout();
079:
080: /**
081: * This monitor's log file rollover format as determined by the
082: * <code>RolloverPeriod</code> attribute.
083: */
084: String getRolloverFormat();
085:
086: /**
087: * Sets the monitored objects configuration.
088: *
089: * @param monitoredObjects the objects to be monitored specified in the
090: * following format:
091: * <pre>
092: * <attribute name="MonitoredObjects">
093: * <configuration>
094: * <monitoredmbean name="[object name]" logger="[logger name]">
095: * <attribute>[attribute name]</attribute>
096: * <attribute>[attribute name]</attribute>
097: * ...
098: * </monitoredmbean>
099: * </configuration>
100: * </attribute>
101: * </pre>
102: *
103: * @throws MalformedObjectNameException if the monitored objects
104: * configuration contains an invalid
105: * object name.
106: */
107: void setMonitoredObjects(Element monitoredObjects)
108: throws MalformedObjectNameException;
109:
110: }
|