diff --git a/source/java/org/alfresco/repo/management/JmxDumpUtil.java b/source/java/org/alfresco/repo/management/JmxDumpUtil.java index 69b212fd0c..a7fd066eee 100644 --- a/source/java/org/alfresco/repo/management/JmxDumpUtil.java +++ b/source/java/org/alfresco/repo/management/JmxDumpUtil.java @@ -21,7 +21,10 @@ package org.alfresco.repo.management; import java.io.IOException; import java.io.PrintWriter; import java.lang.reflect.Array; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.Comparator; +import java.util.Date; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -34,6 +37,7 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; import javax.management.openmbean.CompositeData; + /** * A utility class providing a method to dump a local or remote MBeanServer's entire object tree for support purposes. * Nested arrays and CompositeData objects in MBean attribute values are handled. @@ -67,6 +71,8 @@ public class JmxDumpUtil */ public static void dumpConnection(MBeanServerConnection connection, PrintWriter out) throws IOException { + JmxDumpUtil.showStartBanner(out); + // Get all the object names Set objectNames = connection.queryNames(null, null); @@ -81,6 +87,7 @@ public class JmxDumpUtil newObjectNames.addAll(objectNames); objectNames = newObjectNames; + // Dump each MBean for (ObjectName objectName : objectNames) { @@ -351,4 +358,14 @@ public class JmxDumpUtil return value.toString().length(); } } + + /** + * Show a message stating the JmxDumper has been started, with the current date and time. + */ + private static void showStartBanner(PrintWriter out) + { + DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + out.println(JmxDumpUtil.class.getSimpleName() + " started: " + df.format(new Date())); + out.println(); + } }