parent
bbb7f2188c
commit
815764c279
|
@ -29,6 +29,7 @@ import org.eclipse.jetty.deploy.providers.WebAppProvider;
|
|||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.ConnectorStatistics;
|
||||
import org.eclipse.jetty.server.DebugListener;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
|
@ -185,6 +186,7 @@ public class LikeJettyXml
|
|||
StatisticsHandler stats = new StatisticsHandler();
|
||||
stats.setHandler(server.getHandler());
|
||||
server.setHandler(stats);
|
||||
ConnectorStatistics.addToAllConnectors(server);
|
||||
|
||||
|
||||
// === jetty-requestlog.xml ===
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.eclipse.jetty.server.jmx;
|
|||
|
||||
import org.eclipse.jetty.jmx.ObjectMBean;
|
||||
import org.eclipse.jetty.server.AbstractConnector;
|
||||
import org.eclipse.jetty.server.ConnectionFactory;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
|
||||
@ManagedObject("MBean Wrapper for Connectors")
|
||||
|
@ -31,10 +32,23 @@ public class AbstractConnectorMBean extends ObjectMBean
|
|||
super(managedObject);
|
||||
_connector=(AbstractConnector)managedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectContextBasis()
|
||||
{
|
||||
return String.format("%s@%x",_connector.getDefaultProtocol(),_connector.hashCode());
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (ConnectionFactory f:_connector.getConnectionFactories())
|
||||
{
|
||||
String protocol=f.getProtocol();
|
||||
if (protocol!=null)
|
||||
{
|
||||
if (buffer.length()>0)
|
||||
buffer.append("|");
|
||||
buffer.append(protocol);
|
||||
}
|
||||
}
|
||||
|
||||
return String.format("%s@%x",buffer.toString(),_connector.hashCode());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue