You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2013/04/28 18:59:21 UTC
svn commit: r1476797 -
/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/
Author: rpopma
Date: Sun Apr 28 16:59:20 2013
New Revision: 1476797
URL: http://svn.apache.org/r1476797
Log:
fixed Checkstyle errors
Modified:
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Assert.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientEditConfigPanel.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientGUI.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/AppenderAdmin.java Sun Apr 28 16:59:20 2013
@@ -50,7 +50,12 @@ public class AppenderAdmin implements Ap
}
}
- /** @see AppenderAdminMBean#PATTERN */
+ /**
+ * Returns the {@code ObjectName} of this mbean.
+ *
+ * @return the {@code ObjectName}
+ * @see AppenderAdminMBean#PATTERN
+ */
public ObjectName getObjectName() {
return objectName;
}
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Assert.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Assert.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Assert.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Assert.java Sun Apr 28 16:59:20 2013
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.jm
/**
* Utility class providing common validation logic.
*/
-public class Assert {
+public final class Assert {
private Assert() {
}
@@ -44,6 +44,7 @@ public class Assert {
* }
* </pre>
*
+ * @param <T> the type of the parameter to check and return
* @param checkMe the parameter to check
* @param name name of the parameter to use in the error message if
* {@code null}
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientEditConfigPanel.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientEditConfigPanel.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientEditConfigPanel.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientEditConfigPanel.java Sun Apr 28 16:59:20 2013
@@ -40,6 +40,8 @@ import javax.swing.JTextField;
*/
public class ClientEditConfigPanel extends JPanel {
private static final long serialVersionUID = -7544651740950723394L;
+ private static final int HORIZONTAL_GAP = 20;
+ private static final int ERR_MSG_INITIAL_BUFFER_SIZE = 2048;
private static final int LOCATION_TEXT_COLS = 50;
private static final int CONFIG_TEXT_COLS = 60;
private static final int CONFIG_TEXT_ROWS = 20;
@@ -86,6 +88,12 @@ public class ClientEditConfigPanel exten
}
};
+ public ClientEditConfigPanel(LoggerContextAdminMBean contextAdmin) {
+ this.contextAdmin = contextAdmin;
+ createWidgets();
+ populateWidgets();
+ }
+
private void handle(String msg, Exception ex) {
StringWriter sr = new StringWriter(BUFFER_SIZE);
PrintWriter pw = new PrintWriter(sr);
@@ -101,17 +109,11 @@ public class ClientEditConfigPanel exten
"Reconfiguration complete", JOptionPane.INFORMATION_MESSAGE);
}
- public ClientEditConfigPanel(LoggerContextAdminMBean contextAdmin) {
- this.contextAdmin = contextAdmin;
- createWidgets();
- populateWidgets();
- }
-
private void populateWidgets() {
try {
configTextArea.setText(contextAdmin.getConfigText());
} catch (Exception ex) {
- StringWriter sw = new StringWriter(2048);
+ StringWriter sw = new StringWriter(ERR_MSG_INITIAL_BUFFER_SIZE);
ex.printStackTrace(new PrintWriter(sw));
configTextArea.setText(sw.toString());
}
@@ -139,7 +141,7 @@ public class ClientEditConfigPanel exten
north.add(locationLabel);
north.add(locationTextField);
north.add(buttonSendLocation);
- north.add(Box.createRigidArea(new Dimension(20, 0)));
+ north.add(Box.createRigidArea(new Dimension(HORIZONTAL_GAP, 0)));
north.add(buttonSendConfigText);
this.setLayout(new BorderLayout());
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientGUI.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientGUI.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientGUI.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ClientGUI.java Sun Apr 28 16:59:20 2013
@@ -48,9 +48,9 @@ import javax.swing.UIManager.LookAndFeel
* GUI that connects to a Java process via JMX and allows the user to view and
* modify the log4j2 configuration, as well as monitor status logs.
*
- * @see http
- * ://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole
- * .html
+ * @see <a href=
+ * "http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html
+ * >http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html</a >
*/
public class ClientGUI extends JPanel implements NotificationListener {
private static final long serialVersionUID = -253621277232291174L;
@@ -119,11 +119,12 @@ public class ClientGUI extends JPanel im
* http://www.componative.com/content/controller/developer/insights
* /jconsole3/
*
- * @param args
- * must have at least one parameter, which specifies the location
- * to connect to. Must be of the form {@code host:port} or
- * {@code service:jmx:rmi:///jndi/rmi://<host>:<port>/jmxrmi} or
+ * @param args must have at least one parameter, which specifies the
+ * location to connect to. Must be of the form {@code host:port}
+ * or {@code service:jmx:rmi:///jndi/rmi://<host>:<port>/jmxrmi}
+ * or
* {@code service:jmx:rmi://<host>:<port>/jndi/rmi://<host>:<port>/jmxrmi}
+ * @throws Exception if anything goes wrong
*/
public static void main(String[] args) throws Exception {
if (args.length < 1) {
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/ContextSelectorAdmin.java Sun Apr 28 16:59:20 2013
@@ -43,7 +43,12 @@ public class ContextSelectorAdmin implem
}
}
- /** @see ContextSelectorAdminMBean#NAME */
+ /**
+ * Returns the {@code ObjectName} of this mbean.
+ *
+ * @return the {@code ObjectName}
+ * @see ContextSelectorAdminMBean#NAME
+ */
public ObjectName getObjectName() {
return objectName;
}
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerConfigAdmin.java Sun Apr 28 16:59:20 2013
@@ -54,7 +54,12 @@ public class LoggerConfigAdmin implement
}
}
- /** @see LoggerConfigAdminMBean#PATTERN */
+ /**
+ * Returns the {@code ObjectName} of this mbean.
+ *
+ * @return the {@code ObjectName}
+ * @see LoggerConfigAdminMBean#PATTERN
+ */
public ObjectName getObjectName() {
return objectName;
}
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java Sun Apr 28 16:59:20 2013
@@ -62,7 +62,8 @@ public class LoggerContextAdmin extends
* Constructs a new {@code LoggerContextAdmin} with the {@code Executor} to
* be used for sending {@code Notification}s asynchronously to listeners.
*
- * @param executor
+ * @param executor used to send notifications asynchronously
+ * @param loggerContext the instrumented object
*/
public LoggerContextAdmin(LoggerContext loggerContext, Executor executor) {
super(executor, createNotificationInfo());
@@ -78,7 +79,8 @@ public class LoggerContextAdmin extends
}
private static MBeanNotificationInfo createNotificationInfo() {
- String[] notifTypes = new String[] { NOTIF_TYPE_RECONFIGURED };
+ String[] notifTypes = new String[] {//
+ NOTIF_TYPE_RECONFIGURED };
String name = Notification.class.getName();
String description = "Configuration reconfigured";
return new MBeanNotificationInfo(notifTypes, name, description);
@@ -192,6 +194,7 @@ public class LoggerContextAdmin extends
try {
in.close();
} catch (Exception ignored) {
+ // ignored
}
}
}
@@ -221,7 +224,12 @@ public class LoggerContextAdmin extends
return getConfig().getProperties();
}
- /** @see LoggerContextAdminMBean#PATTERN */
+ /**
+ * Returns the {@code ObjectName} of this mbean.
+ *
+ * @return the {@code ObjectName}
+ * @see LoggerContextAdminMBean#PATTERN
+ */
public ObjectName getObjectName() {
return objectName;
}
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdminMBean.java Sun Apr 28 16:59:20 2013
@@ -17,7 +17,6 @@
package org.apache.logging.log4j.core.jmx;
import java.io.IOException;
-import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
@@ -60,8 +59,8 @@ public interface LoggerContextAdminMBean
* Sets the configuration location to the specified URI. This will cause the
* instrumented {@code LoggerContext} to reconfigure.
*
- * @param configLocationURI location of the configuration file in
- * {@link URI} format.
+ * @param configLocation location of the configuration file in
+ * {@link java.net.URI} format.
* @throws URISyntaxException if the format of the specified
* configLocationURI is incorrect
* @throws IOException if an error occurred reading the specified location
@@ -75,6 +74,8 @@ public interface LoggerContextAdminMBean
* {@code setConfigText}.
*
* @return the configuration text
+ * @throws IOException if a problem occurred reading the contents of the
+ * config file.
*/
String getConfigText() throws IOException;
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java Sun Apr 28 16:59:20 2013
@@ -45,9 +45,12 @@ import org.apache.logging.log4j.status.S
* All instrumentation for Log4J2 classes can be disabled by setting system
* property {@code -Dlog4j2.disable.jmx=true}.
*/
-public class Server {
+public final class Server {
private static final String PROPERTY_DISABLE_JMX = "log4j2.disable.jmx";
+
+ private Server() {
+ }
/**
* Either returns the specified name as is, or returns a quoted value
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java?rev=1476797&r1=1476796&r2=1476797&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java Sun Apr 28 16:59:20 2013
@@ -43,7 +43,7 @@ public class StatusLoggerAdmin extends N
* Constructs a new {@code StatusLoggerAdmin} with the {@code Executor} to
* be used for sending {@code Notification}s asynchronously to listeners.
*
- * @param executor
+ * @param executor used to send notifications asynchronously
*/
public StatusLoggerAdmin(Executor executor) {
super(executor, createNotificationInfo());
@@ -56,8 +56,8 @@ public class StatusLoggerAdmin extends N
}
private static MBeanNotificationInfo createNotificationInfo() {
- String[] notifTypes = new String[] { NOTIF_TYPE_DATA,
- NOTIF_TYPE_MESSAGE };
+ String[] notifTypes = new String[] {//
+ NOTIF_TYPE_DATA, NOTIF_TYPE_MESSAGE };
String name = Notification.class.getName();
String description = "StatusLogger has logged an event";
return new MBeanNotificationInfo(notifTypes, name, description);
@@ -107,7 +107,12 @@ public class StatusLoggerAdmin extends N
sendNotification(notifData);
}
- /** @see StatusLoggerAdminMBean#NAME */
+ /**
+ * Returns the {@code ObjectName} of this mbean.
+ *
+ * @return the {@code ObjectName}
+ * @see StatusLoggerAdminMBean#NAME
+ */
public ObjectName getObjectName() {
return objectName;
}