KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > logging > Log4jServiceMBean


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.logging;
23
24 import java.io.IOException JavaDoc;
25 import java.net.MalformedURLException JavaDoc;
26 import java.net.URL JavaDoc;
27
28 import javax.management.ObjectName JavaDoc;
29
30 import org.jboss.mx.util.ObjectNameFactory;
31 import org.jboss.system.ServiceMBean;
32
33 /**
34  * MBean interface.
35  */

36 public interface Log4jServiceMBean extends ServiceMBean
37 {
38    /** The default object name */
39    ObjectName JavaDoc OBJECT_NAME = ObjectNameFactory.create("jboss.system:type=Log4jService,service=Logging");
40
41    /** Notification type used to indicate a log4j reconfiguration */
42    String JavaDoc RECONFIGURE_NOTIFICATION_TYPE = "jboss.logging.log4j.reconfigure";
43    
44    // Attributes ----------------------------------------------------
45

46    /**
47     * The catch <tt>System.out</tt> flag.
48     * @param flag True to enable, false to disable.
49     */

50    void setCatchSystemOut(boolean flag);
51    boolean getCatchSystemOut();
52    
53    /**
54     * The catch <tt>System.err</tt> flag.
55     * @param flag True to enable, false to disable.
56     */

57    void setCatchSystemErr(boolean flag);
58    boolean getCatchSystemErr();
59
60    /**
61     * The org.apache.log4j.helpers.LogLog.setQuietMode flag
62     * @return True if enabled, false if disabled.
63     */

64    void setLog4jQuietMode(boolean flag);
65    boolean getLog4jQuietMode();
66    
67    /**
68     * The refresh period.
69     */

70    void setRefreshPeriod(int refreshPeriod);
71    int getRefreshPeriod();
72
73    /**
74     * The Log4j configuration URL.
75     */

76    void setConfigurationURL(URL JavaDoc url);
77    URL JavaDoc getConfigurationURL();
78    
79    // Operations ----------------------------------------------------
80

81    /**
82     * Sets the level for a logger of the give name.
83     * <p>Values are trimmed before used.
84     *
85     * @param name The name of the logger to change level
86     * @param levelName The name of the level to change the logger to.
87     */

88    void setLoggerLevel(String JavaDoc name, String JavaDoc levelName);
89
90    /**
91     * Sets the levels of each logger specified by the given comma seperated list of logger names.
92     * @see #setLoggerLevel
93     *
94     * @param list A comma seperated list of logger names.
95     * @param levelName The name of the level to change the logger to.
96     */

97    void setLoggerLevels(String JavaDoc list, String JavaDoc levelName);
98
99    /**
100     * Gets the level of the logger of the give name.
101     *
102     * @param name The name of the logger to inspect.
103     */

104    String JavaDoc getLoggerLevel(String JavaDoc name);
105
106    /**
107     * Force the logging system to reconfigure.
108     */

109    void reconfigure() throws IOException JavaDoc;
110
111    /**
112     * Hack to reconfigure and change the URL. This is needed until
113     * we have a JMX HTML Adapter that can use PropertyEditor to coerce.
114     *
115     * @param url The new configuration url
116     */

117    void reconfigure(String JavaDoc url) throws IOException JavaDoc, MalformedURLException JavaDoc;
118
119 }
120
Popular Tags