| | |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Map; |
| | | import java.util.Map.Entry; |
| | | import java.util.TreeMap; |
| | | |
| | | import org.opends.server.admin.std.server.StackTraceMonitorProviderCfg; |
| | |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | |
| | | AttributeType attrType = |
| | | DirectoryServer.getDefaultAttributeType("jvmThread"); |
| | | LinkedHashSet<AttributeValue> values = new LinkedHashSet<AttributeValue>(); |
| | | |
| | | AttributeBuilder builder = new AttributeBuilder(attrType); |
| | | for (Map.Entry<Thread,StackTraceElement[]> e : orderedStacks.values()) |
| | | { |
| | | Thread t = e.getKey(); |
| | |
| | | buffer.append(" ---------- "); |
| | | buffer.append(t.getName()); |
| | | buffer.append(" ----------"); |
| | | values.add(new AttributeValue(attrType, buffer.toString())); |
| | | builder.add(new AttributeValue(attrType, buffer.toString())); |
| | | |
| | | // Create an attribute for the stack trace. |
| | | if (stackElements != null) |
| | |
| | | } |
| | | buffer.append(")"); |
| | | |
| | | values.add(new AttributeValue(attrType, buffer.toString())); |
| | | builder.add(new AttributeValue(attrType, buffer.toString())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(); |
| | | attrs.add(new Attribute(attrType, "jvmThread", values)); |
| | | attrs.add(builder.toAttribute()); |
| | | |
| | | return attrs; |
| | | } |