change addToAllConnectors method to addBeanToAllConnectors
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
623d1be7c7
commit
8faa71818f
|
@ -180,7 +180,7 @@ public class LikeJettyXml
|
|||
StatisticsHandler stats = new StatisticsHandler();
|
||||
stats.setHandler(server.getHandler());
|
||||
server.setHandler(stats);
|
||||
server.addToAllConnectors(new ConnectionStatistics());
|
||||
server.addBeanToAllConnectors(new ConnectionStatistics());
|
||||
|
||||
// === Rewrite Handler
|
||||
RewriteHandler rewrite = new RewriteHandler();
|
||||
|
|
|
@ -45,7 +45,7 @@ public class OneServletContextJmxStats
|
|||
context.addServlet(DefaultServlet.class, "/");
|
||||
|
||||
// Add Connector Statistics tracking to all connectors
|
||||
server.addToAllConnectors(new ConnectionStatistics());
|
||||
server.addBeanToAllConnectors(new ConnectionStatistics());
|
||||
return server;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<New id="StatsHandler" class="org.eclipse.jetty.server.handler.StatisticsHandler"></New>
|
||||
</Arg>
|
||||
</Call>
|
||||
<Call name="addToAllConnectors">
|
||||
<Call name="addBeanToAllConnectors">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.io.ConnectionStatistics"/>
|
||||
</Arg>
|
||||
|
|
|
@ -267,15 +267,16 @@ public class Server extends HandlerWrapper implements Attributes
|
|||
}
|
||||
|
||||
/**
|
||||
* Add a {@link Connection.Listener} as a bean to all connectors on the server, this
|
||||
* will register the listener with all connections accepted by the connectors.
|
||||
* @param listener the listener to be added.
|
||||
* Add a bean to all connectors on the server.
|
||||
* If the bean is an instance of {@link Connection.Listener} it will also be
|
||||
* registered as a listener on all connections accepted by the connectors.
|
||||
* @param bean the bean to be added.
|
||||
*/
|
||||
public void addToAllConnectors(Connection.Listener listener)
|
||||
public void addBeanToAllConnectors(Object bean)
|
||||
{
|
||||
for (Connector connector : getConnectors())
|
||||
{
|
||||
connector.addBean(listener);
|
||||
connector.addBean(bean);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
package org.eclipse.jetty.server;
|
||||
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.ConnectionStatistics;
|
||||
|
||||
@Deprecated
|
||||
|
@ -26,7 +25,7 @@ public class ServerConnectionStatistics extends ConnectionStatistics
|
|||
{
|
||||
/**
|
||||
* @param server the server to use to add {@link ConnectionStatistics} to all Connectors.
|
||||
* @deprecated use {@link Server#addToAllConnectors(Connection.Listener)} instead.
|
||||
* @deprecated use {@link Server#addBeanToAllConnectors(Object)} instead.
|
||||
*/
|
||||
public static void addToAllConnectors(Server server)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue