Merge branch 'jetty-9' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project into jetty-9

This commit is contained in:
Joakim Erdfelt 2012-08-13 14:00:20 -07:00
commit 50d4babe90
28 changed files with 118 additions and 104 deletions

View File

@ -30,6 +30,8 @@ import javax.print.attribute.standard.MediaSize.ISO;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.StandardByteBufferPool;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.AggregateLifeCycle;
import org.eclipse.jetty.util.component.Dumpable;
import org.eclipse.jetty.util.log.Log;
@ -39,6 +41,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
/**
* <p>Partial implementation of {@link Connector}</p>
*/
@ManagedObject("Abstract implementation of the Connector Interface")
public abstract class AbstractConnector extends AggregateLifeCycle implements Connector, Dumpable
{
protected final Logger LOG = Log.getLogger(getClass());
@ -157,6 +160,7 @@ public abstract class AbstractConnector extends AggregateLifeCycle implements Co
/**
* @return Returns the number of acceptor threads.
*/
@ManagedAttribute("number of acceptor threads")
public int getAcceptors()
{
return _acceptors.length;
@ -328,6 +332,7 @@ public abstract class AbstractConnector extends AggregateLifeCycle implements Co
}
@Override
@ManagedAttribute("name of the connector")
public String getName()
{
return _name;

View File

@ -17,6 +17,8 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.ssl.SslContextFactory;
@ -25,6 +27,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
* and allows applications to send data to remote peers, by setting up
* the machinery needed to handle such tasks.</p>
*/
@ManagedObject("Connector Interface")
public interface Connector extends LifeCycle
{
/**
@ -60,6 +63,7 @@ public interface Connector extends LifeCycle
/**
* @return the dle timeout for connections in milliseconds
*/
@ManagedAttribute("maximum time a connection can be idle before being closed (in ms)")
public long getIdleTimeout();
/**

View File

@ -21,6 +21,9 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.HandlerWrapper;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.component.LifeCycle;
@ -40,6 +43,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
* before passing it to the next stage of handling.
*
*/
@ManagedObject("Jetty Handler")
public interface Handler extends LifeCycle, Destroyable
{
/* ------------------------------------------------------------ */
@ -59,8 +63,11 @@ public interface Handler extends LifeCycle, Destroyable
throws IOException, ServletException;
public void setServer(Server server);
@ManagedAttribute(value="the jetty server for this handler", readonly=true)
public Server getServer();
@ManagedOperation(value="destroy associated resources", impact="ACTION")
public void destroy();
}

View File

@ -13,6 +13,8 @@
package org.eclipse.jetty.server;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.LifeCycle;
/**
@ -22,18 +24,21 @@ import org.eclipse.jetty.util.component.LifeCycle;
* or many (see {@link org.eclipse.jetty.server.handler.HandlerList} or {@link org.eclipse.jetty.server.handler.HandlerCollection}.
*
*/
@ManagedObject("Handler of Multiple Handlers")
public interface HandlerContainer extends LifeCycle
{
/* ------------------------------------------------------------ */
/**
* @return array of handlers directly contained by this handler.
*/
@ManagedAttribute(value="handlers in this container", managed=true)
public Handler[] getHandlers();
/* ------------------------------------------------------------ */
/**
* @return array of all handlers contained by this handler and it's children
*/
@ManagedAttribute(value="all contained handlers", managed=true)
public Handler[] getChildHandlers();
/* ------------------------------------------------------------ */

View File

@ -27,6 +27,8 @@ import org.eclipse.jetty.http.PathMap;
import org.eclipse.jetty.util.DateCache;
import org.eclipse.jetty.util.RolloverFileOutputStream;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -39,12 +41,12 @@ import org.eclipse.jetty.util.log.Logger;
* servers, and almost all web log analysis software can understand these
* formats.
*
* @org.apache.xbean.XBean element="ncsaLog"
*/
/* ------------------------------------------------------------ */
/**
*/
@ManagedObject("NCSA standard format request log")
public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
{
private static final Logger LOG = Log.getLogger(NCSARequestLog.class);
@ -124,6 +126,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
*
* @return file name of the request log
*/
@ManagedAttribute("file of log")
public String getFilename()
{
return _filename;
@ -206,6 +209,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
*
* @return timezone string
*/
@ManagedAttribute("the timezone")
public String getLogTimeZone()
{
return _logTimeZone;
@ -228,6 +232,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
*
* @return number of days to keep a log file
*/
@ManagedAttribute("number of days that log files are kept")
public int getRetainDays()
{
return _retainDays;
@ -251,6 +256,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
*
* @return value of the flag
*/
@ManagedAttribute("use extended NCSA format")
public boolean isExtended()
{
return _extended;
@ -274,6 +280,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
*
* @return value of the flag
*/
@ManagedAttribute("existing log files are appends to the new one")
public boolean isAppend()
{
return _append;

View File

@ -31,12 +31,14 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.SelectChannelEndPoint;
import org.eclipse.jetty.io.SelectorManager;
import org.eclipse.jetty.io.SelectorManager.ManagedSelector;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.Name;
import org.eclipse.jetty.util.ssl.SslContextFactory;
/**
* <p>Implementation of {@link NetworkConnector} based on NIO classes.</p>
*/
@ManagedObject("HTTP connector using NIO ByteChannels and Selectors")
public class SelectChannelConnector extends AbstractNetworkConnector
{
private final SelectorManager _manager;

View File

@ -33,6 +33,8 @@ import org.eclipse.jetty.util.AttributesMap;
import org.eclipse.jetty.util.MultiException;
import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.Container;
import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.component.Dumpable;
@ -50,6 +52,7 @@ import org.eclipse.jetty.util.thread.ThreadPool;
* The server is itself a handler and a ThreadPool. Connectors use the ThreadPool methods
* to run jobs that will eventually call the handle method.
*/
@ManagedObject(value="Jetty HTTP Servlet server", wrapper="org.eclipse.jetty.server.ServerMBean")
public class Server extends HandlerWrapper implements Attributes
{
private static final Logger LOG = Log.getLogger(Server.class);
@ -120,6 +123,7 @@ public class Server extends HandlerWrapper implements Attributes
/* ------------------------------------------------------------ */
@ManagedAttribute("version of this server")
public static String getVersion()
{
return __version;
@ -164,6 +168,7 @@ public class Server extends HandlerWrapper implements Attributes
/**
* @return Returns the connectors.
*/
@ManagedAttribute(value="connectors for this server", managed=true)
public Connector[] getConnectors()
{
List<Connector> connectors = new ArrayList<>(_connectors);
@ -217,6 +222,7 @@ public class Server extends HandlerWrapper implements Attributes
/**
* @return Returns the threadPool.
*/
@ManagedAttribute(value="the server thread pool", managed=true)
public ThreadPool getThreadPool()
{
return _threadPool;
@ -225,6 +231,7 @@ public class Server extends HandlerWrapper implements Attributes
/**
* @return true if {@link #dumpStdErr()} is called after starting
*/
@ManagedAttribute("dump state to stderr after start")
public boolean isDumpAfterStart()
{
return _dumpAfterStart;
@ -241,6 +248,7 @@ public class Server extends HandlerWrapper implements Attributes
/**
* @return true if {@link #dumpStdErr()} is called before stopping
*/
@ManagedAttribute("dump state to stderr before stop")
public boolean isDumpBeforeStop()
{
return _dumpBeforeStop;
@ -478,6 +486,7 @@ public class Server extends HandlerWrapper implements Attributes
}
/* ------------------------------------------------------------ */
@ManagedAttribute("if true, include the server version in HTTP headers")
public boolean getSendServerVersion()
{
return _sendServerVersion;
@ -490,6 +499,7 @@ public class Server extends HandlerWrapper implements Attributes
}
/* ------------------------------------------------------------ */
@ManagedAttribute("if true, include the date in HTTP headers")
public boolean getSendDateHeader()
{
return _sendDateHeader;

View File

@ -18,6 +18,7 @@ import java.io.IOException;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.AggregateLifeCycle;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -28,6 +29,7 @@ import org.eclipse.jetty.util.log.Logger;
*
*
*/
@ManagedObject("Jetty Handler")
public abstract class AbstractHandler extends AggregateLifeCycle implements Handler
{
private static final Logger LOG = Log.getLogger(AbstractHandler.class);

View File

@ -624,7 +624,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
/**
* @return true if this context is accepting new requests
*/
@ManagedAttribute("False if this context is accepting new requests. True for graceful shutdown, which allows existing requests to complete")
@ManagedAttribute("false if this context is accepting new requests. true for graceful shutdown, which allows existing requests to complete")
public boolean isShutdown()
{
synchronized (this)
@ -1360,6 +1360,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
/**
* @return True if aliases are allowed
*/
@ManagedAttribute("true if alias checking is performed on resource")
public boolean isAliases()
{
return _aliases;

View File

@ -27,6 +27,8 @@ import org.eclipse.jetty.server.HandlerContainer;
import org.eclipse.jetty.server.HttpChannelState;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.util.LazyList;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -40,8 +42,8 @@ import org.eclipse.jetty.util.log.Logger;
* Multiple contexts may have the same context path and they are called in order until one
* handles the request.
*
* @org.apache.xbean.XBean element="contexts"
*/
@ManagedObject("Context Handler Collection")
public class ContextHandlerCollection extends HandlerCollection
{
private static final Logger LOG = Log.getLogger(ContextHandlerCollection.class);
@ -60,6 +62,7 @@ public class ContextHandlerCollection extends HandlerCollection
/**
* Remap the context paths.
*/
@ManagedOperation("update the mapping of context path to context")
public void mapContexts()
{
PathMap<Object> contextMap = new PathMap<Object>();

View File

@ -26,6 +26,8 @@ import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.ArrayUtil;
import org.eclipse.jetty.util.MultiException;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
/* ------------------------------------------------------------ */
/** A collection of handlers.
@ -36,8 +38,8 @@ import org.eclipse.jetty.util.MultiException;
* handlers.
* <p>
*
* @org.apache.xbean.XBean
*/
@ManagedObject("Handler of multiple handlers")
public class HandlerCollection extends AbstractHandlerContainer
{
private final boolean _mutableWhenRunning;
@ -61,6 +63,7 @@ public class HandlerCollection extends AbstractHandlerContainer
* @return Returns the handlers.
*/
@Override
@ManagedAttribute(value="Wrapped handlers", managed=true)
public Handler[] getHandlers()
{
return _handlers;

View File

@ -23,6 +23,8 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.LifeCycle;
/* ------------------------------------------------------------ */
@ -30,6 +32,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
* {@link LifeCycle life cycle} events to a delegate. This is primarily used to implement the <i>Decorator</i> pattern.
*
*/
@ManagedObject("Handler wrapping another Handler")
public class HandlerWrapper extends AbstractHandlerContainer
{
protected Handler _handler;
@ -46,6 +49,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
/**
* @return Returns the handlers.
*/
@ManagedAttribute(value="Wrapped Handler", managed=true)
public Handler getHandler()
{
return _handler;

View File

@ -26,9 +26,13 @@ import org.eclipse.jetty.continuation.ContinuationListener;
import org.eclipse.jetty.server.HttpChannelState;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.statistic.CounterStatistic;
import org.eclipse.jetty.util.statistic.SampleStatistic;
@ManagedObject("Request Statistics Gathering")
public class StatisticsHandler extends HandlerWrapper
{
private final AtomicLong _statsStartedAt = new AtomicLong();
@ -74,6 +78,7 @@ public class StatisticsHandler extends HandlerWrapper
/**
* Resets the current request statistics.
*/
@ManagedOperation(value="resets statistics", impact="ACTION")
public void statsReset()
{
_statsStartedAt.set(System.currentTimeMillis());
@ -189,6 +194,7 @@ public class StatisticsHandler extends HandlerWrapper
* active requests
* @see #getResumes()
*/
@ManagedAttribute("number of requests")
public int getRequests()
{
return (int)_requestStats.getTotal();
@ -198,6 +204,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of requests currently active.
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests currently active")
public int getRequestsActive()
{
return (int)_requestStats.getCurrent();
@ -207,6 +214,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the maximum number of active requests
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("maximum number of active requests")
public int getRequestsActiveMax()
{
return (int)_requestStats.getMax();
@ -216,6 +224,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the maximum time (in milliseconds) of request handling
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("maximum time spend handling requests (in ms)")
public long getRequestTimeMax()
{
return _requestTimeStats.getMax();
@ -225,6 +234,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the total time (in milliseconds) of requests handling
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("total time spend in all request handling (in ms)")
public long getRequestTimeTotal()
{
return _requestTimeStats.getTotal();
@ -236,6 +246,7 @@ public class StatisticsHandler extends HandlerWrapper
* @see #getRequestTimeTotal()
* @see #getRequests()
*/
@ManagedAttribute("mean time spent handling requests (in ms)")
public double getRequestTimeMean()
{
return _requestTimeStats.getMean();
@ -247,6 +258,7 @@ public class StatisticsHandler extends HandlerWrapper
* @see #getRequestTimeTotal()
* @see #getRequests()
*/
@ManagedAttribute("standard deviation for request handling (in ms)")
public double getRequestTimeStdDev()
{
return _requestTimeStats.getStdDev();
@ -257,6 +269,7 @@ public class StatisticsHandler extends HandlerWrapper
* since {@link #statsReset()} was last called, excluding
* active dispatches
*/
@ManagedAttribute("number of dispatches")
public int getDispatched()
{
return (int)_dispatchedStats.getTotal();
@ -267,6 +280,7 @@ public class StatisticsHandler extends HandlerWrapper
* since {@link #statsReset()} was last called, including
* resumed requests
*/
@ManagedAttribute("number of dispatches currently active")
public int getDispatchedActive()
{
return (int)_dispatchedStats.getCurrent();
@ -277,6 +291,7 @@ public class StatisticsHandler extends HandlerWrapper
* since {@link #statsReset()} was last called, including
* resumed requests
*/
@ManagedAttribute("maximum number of active dispatches being handled")
public int getDispatchedActiveMax()
{
return (int)_dispatchedStats.getMax();
@ -286,6 +301,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the maximum time (in milliseconds) of request dispatch
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("maximum time spend in dispatch handling")
public long getDispatchedTimeMax()
{
return _dispatchedTimeStats.getMax();
@ -295,6 +311,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the total time (in milliseconds) of requests handling
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("total time spent in dispatch handling (in ms)")
public long getDispatchedTimeTotal()
{
return _dispatchedTimeStats.getTotal();
@ -306,6 +323,7 @@ public class StatisticsHandler extends HandlerWrapper
* @see #getRequestTimeTotal()
* @see #getRequests()
*/
@ManagedAttribute("mean time spent in dispatch handling (in ms)")
public double getDispatchedTimeMean()
{
return _dispatchedTimeStats.getMean();
@ -317,6 +335,7 @@ public class StatisticsHandler extends HandlerWrapper
* @see #getRequestTimeTotal()
* @see #getRequests()
*/
@ManagedAttribute("standard deviation for dispatch handling (in ms)")
public double getDispatchedTimeStdDev()
{
return _dispatchedTimeStats.getStdDev();
@ -328,6 +347,7 @@ public class StatisticsHandler extends HandlerWrapper
* resumed requests
* @see #getResumes()
*/
@ManagedAttribute("number of requests suspended")
public int getSuspends()
{
return (int)_suspendStats.getTotal();
@ -337,6 +357,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of requests currently suspended.
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of currently suspended requests")
public int getSuspendsActive()
{
return (int)_suspendStats.getCurrent();
@ -346,6 +367,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the maximum number of current suspended requests
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("maximum number of suspended requests")
public int getSuspendsActiveMax()
{
return (int)_suspendStats.getMax();
@ -355,6 +377,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of requests that have been resumed
* @see #getExpires()
*/
@ManagedAttribute("number of requested that have been resumed")
public int getResumes()
{
return _resumes.get();
@ -364,6 +387,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of requests that expired while suspended.
* @see #getResumes()
*/
@ManagedAttribute("number of requests have have expired")
public int getExpires()
{
return _expires.get();
@ -373,6 +397,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of responses with a 1xx status returned by this context
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests with 1xx response status")
public int getResponses1xx()
{
return _responses1xx.get();
@ -382,6 +407,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of responses with a 2xx status returned by this context
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests with 2xx response status")
public int getResponses2xx()
{
return _responses2xx.get();
@ -391,6 +417,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of responses with a 3xx status returned by this context
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests with 3xx response status")
public int getResponses3xx()
{
return _responses3xx.get();
@ -400,6 +427,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of responses with a 4xx status returned by this context
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests with 4xx response status")
public int getResponses4xx()
{
return _responses4xx.get();
@ -409,6 +437,7 @@ public class StatisticsHandler extends HandlerWrapper
* @return the number of responses with a 5xx status returned by this context
* since {@link #statsReset()} was last called.
*/
@ManagedAttribute("number of requests with 5xx response status")
public int getResponses5xx()
{
return _responses5xx.get();
@ -417,6 +446,7 @@ public class StatisticsHandler extends HandlerWrapper
/**
* @return the milliseconds since the statistics were started with {@link #statsReset()}.
*/
@ManagedAttribute("time in milliseconds stats have been collected for")
public long getStatsOnMs()
{
return System.currentTimeMillis() - _statsStartedAt.get();
@ -425,6 +455,7 @@ public class StatisticsHandler extends HandlerWrapper
/**
* @return the total bytes of content sent in responses
*/
@ManagedAttribute("total number of bytes across all responses")
public long getResponsesBytesTotal()
{
return _responsesTotalBytes.get();

View File

@ -20,9 +20,11 @@ import java.util.Map;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.Attributes;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.annotation.Name;
@ManagedObject("ContextHandler mbean wrapper")
public class ContextHandlerMBean extends AbstractHandlerMBean
{
public ContextHandlerMBean(Object managedObject)

View File

@ -17,10 +17,13 @@ import org.eclipse.jetty.jmx.ObjectMBean;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
/**
*
*/
@ManagedObject("MBean Wrapper for Server")
public class ServerMBean extends ObjectMBean
{
private final long startupTime;
@ -33,11 +36,13 @@ public class ServerMBean extends ObjectMBean
server = (Server)managedObject;
}
@ManagedAttribute(value="contexts on this server", managed=true)
public Handler[] getContexts()
{
return server.getChildHandlersByClass(ContextHandler.class);
}
@ManagedAttribute("the startup time since January 1st, 1970 (in ms)")
public long getStartupTime()
{
return startupTime;

View File

@ -40,6 +40,9 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SessionIdManager;
import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.statistic.CounterStatistic;
@ -56,6 +59,7 @@ import org.eclipse.jetty.util.statistic.SampleStatistic;
* <p>
*/
@SuppressWarnings("deprecation")
@ManagedObject("Abstract Session Manager")
public abstract class AbstractSessionManager extends AbstractLifeCycle implements SessionManager
{
final static Logger __log = SessionHandler.LOG;
@ -135,11 +139,13 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
return _context.getContextHandler();
}
@ManagedAttribute("path of the session cookie, or null for default")
public String getSessionPath()
{
return _sessionPath;
}
@ManagedAttribute("if greater the zero, the time in seconds a session cookie will last for")
public int getMaxCookieAge()
{
return _maxCookieAge;
@ -266,6 +272,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return Returns the httpOnly.
*/
@ManagedAttribute("true if cookies use the http only flag")
public boolean getHttpOnly()
{
return _httpOnly;
@ -296,6 +303,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return Returns the SessionIdManager used for cross context session management
*/
@ManagedAttribute("Session ID Manager")
public SessionIdManager getSessionIdManager()
{
return _sessionIdManager;
@ -307,6 +315,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
* @return seconds
*/
@Override
@ManagedAttribute("defailt maximum time a session may be idle for (in s)")
public int getMaxInactiveInterval()
{
return _dftMaxIdleSecs;
@ -326,6 +335,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return maximum number of sessions
*/
@ManagedAttribute("maximum number of simultaneous sessions")
public int getSessionsMax()
{
return (int)_sessionsStats.getMax();
@ -335,6 +345,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return total number of sessions
*/
@ManagedAttribute("total number of sessions")
public int getSessionsTotal()
{
return (int)_sessionsStats.getTotal();
@ -361,6 +372,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
}
/* ------------------------------------------------------------ */
@ManagedAttribute("time before a session cookie is re-set (in s)")
public int getRefreshCookieAge()
{
return _refreshCookieAge;
@ -373,6 +385,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
* cookies are ALWAYS marked as secure. If false, a session cookie is
* ONLY marked as secure if _secureRequestOnly == true and it is a HTTPS request.
*/
@ManagedAttribute("if true, secure cookie flag is set on session cookies")
public boolean getSecureCookies()
{
return _secureCookies;
@ -402,6 +415,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/* ------------------------------------------------------------ */
@ManagedAttribute("the set session cookie")
public String getSessionCookie()
{
return _sessionCookie;
@ -471,6 +485,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
return null;
}
@ManagedAttribute("domain of the session cookie, or null for the default")
public String getSessionDomain()
{
return _sessionDomain;
@ -498,12 +513,14 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/* ------------------------------------------------------------ */
@ManagedAttribute("number of currently active sessions")
public int getSessions()
{
return (int)_sessionsStats.getCurrent();
}
/* ------------------------------------------------------------ */
@ManagedAttribute("name of use for URL session tracking")
public String getSessionIdPathParameterName()
{
return _sessionIdPathParameterName;
@ -580,6 +597,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* Reset statistics values
*/
@ManagedOperation(value="reset statistics", impact="ACTION")
public void statsReset()
{
_sessionsStats.reset(getSessions());
@ -784,6 +802,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return maximum amount of time session remained valid
*/
@ManagedAttribute("maximum amount of time sessions have remained active (in s)")
public long getSessionTimeMax()
{
return _sessionTimeStats.getMax();
@ -919,6 +938,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return total amount of time all sessions remained valid
*/
@ManagedAttribute("total time sessions have remained valid")
public long getSessionTimeTotal()
{
return _sessionTimeStats.getTotal();
@ -928,6 +948,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return mean amount of time session remained valid
*/
@ManagedAttribute("mean time sessions remain valid (in s)")
public double getSessionTimeMean()
{
return _sessionTimeStats.getMean();
@ -937,6 +958,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @return standard deviation of amount of time session remained valid
*/
@ManagedAttribute("standard deviation a session remained valid (in s)")
public double getSessionTimeStdDev()
{
return _sessionTimeStats.getStdDev();
@ -946,6 +968,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
/**
* @see org.eclipse.jetty.server.SessionManager#isCheckingRemoteSessionIdEncoding()
*/
@ManagedAttribute("check remote session id encoding")
public boolean isCheckingRemoteSessionIdEncoding()
{
return _checkingRemoteSessionIdEncoding;

View File

@ -1,24 +0,0 @@
ContextHandler: URI Context
aliases: True if alias checking is performed on resource
allowNullPathInfo: Checks if the /context is not redirected to /context/
classPath: RO: The file classpath
compactPath: True if URLs are compacted to replace the multiple '/'s with a single '/'
connectorNames: Names and ports of accepted connectors
contextAttributes: RO:MBean: Map of context attributes
contextPath: URI prefix of context
displayName: RO: Display name of the Context
errorHandler: MObject: The error handler to use for the context
initParams: Initial Parameter map for the context
maxFormContentSize: The maximum content size
removeContextAttribute(java.lang.String): MBean:ACTION: remove context attribute
removeContextAttribute(java.lang.String)[0]: name: The attribute name
resourceBase: Document root for the context
setContextAttribute(java.lang.String,java.lang.Object): MBean:ACTION: Set context attribute
setContextAttribute(java.lang.String,java.lang.Object)[0]: name: The attribute name
setContextAttribute(java.lang.String,java.lang.Object)[1]: value: The attribute value
setContextAttribute(java.lang.String,java.lang.String): MBean:ACTION: Set context attribute
setContextAttribute(java.lang.String,java.lang.String)[0]: name: The attribute name
setContextAttribute(java.lang.String,java.lang.String)[1]: value: The attribute value
shutdown: False if this context is accepting new requests. True for graceful shutdown, which allows existing requests to complete
virtualHosts: Virtual hosts accepted by the context
welcomeFiles: Partial URIs of directory welcome files

View File

@ -1,2 +0,0 @@
ContextHandlerCollection: Context Handler Collection
mapContexts(): Update the mapping of context path to context

View File

@ -1,2 +0,0 @@
HandlerCollection: Handler of multiple Handlers
handlers: MObject:Wrapped handlers

View File

@ -1,2 +0,0 @@
HandlerWrapper: Handler wrapping another Handler
handler: MObject:Wrapped handler

View File

@ -1,28 +0,0 @@
StatisticsHandler: Request Statistics gathering
statsOnMs: Time in milliseconds stats have been collected for.
statsReset(): Resets statistics.
requests: Number of requests since statsReset() called.
requestsActive: Number of requests currently active since statsReset() called.
requestsActiveMax: Maximum number of active requests since statsReset() called.
requestTimeMax: Maximum time in milliseconds of request handling since statsReset() called.
requestTimeTotal: Total time in milliseconds of all request handling since statsReset() called.
requestTimeMean: Mean of time in milliseconds of request handling since statsReset() called.
requestTimeStdDev: Standard deviation of time in milliseconds of request handling since statsReset() called.
dispatched: Number of dispatches since statsReset() called.
dispatchedActive: Number of dispatches currently active since statsReset() called.
dispatchedActiveMax: Maximum number of active dispatches since statsReset() called.
dispatchedTimeMax: Maximum time in milliseconds of dispatched handling since statsReset() called.
dispatchedTimeTotal: Total time in milliseconds of all dispatched handling since statsReset() called.
dispatchedTimeMean: Mean of time in milliseconds of dispatch handling since statsReset() called.
dispatchedTimeStdDev: Standard deviation of time in milliseconds of dispatch handling since statsReset() called.
suspends: Number of requests suspended since statsReset() called.
suspendsActive: Number of dispatches currently active since statsReset() called.
suspendsActiveMax: Maximum number of active dispatches since statsReset() called.
resumes: Number of requests resumed since statsReset() called.
expires: Number of requests expired since statsReset() called.
responses1xx: Number of responses with a 1xx status since statsReset() called.
responses2xx: Number of responses with a 2xx status since statsReset() called.
responses3xx: Number of responses with a 3xx status since statsReset() called.
responses4xx: Number of responses with a 4xx status since statsReset() called.
responses5xx: Number of responses with a 5xx status since statsReset() called.
responsesBytesTotal: Total number of bytes of all responses since statsReset() called.

View File

@ -1,3 +0,0 @@
Handler: Jetty Handler.
server: MObject:RO:The Jetty server for this handler
destroy(): destroy associated resources (eg MBean)

View File

@ -1,3 +0,0 @@
HandlerContainer: Handler of multiple Handlers
handlers: MObject:RO:Handlers in this container
childHandlers: MObject:RO:All contained handlers

View File

@ -1,6 +0,0 @@
NCSARequestLog : NCSA standard format request log
filename : Filename of log
retainDays : Number of days that the log files are kept
append : Existing log files are appended to the new one
extended : Use the extended NCSA format
LogTimeZone : The timezone

View File

@ -1 +0,0 @@
SelectChannelConnector: HTTP connector using NIO ByteChannels and Selectors

View File

@ -1,9 +0,0 @@
Server: Jetty HTTP Servlet server
connectors: MObject:HTTP Connectors for this server
version: RO: The version of this server
sendServerVersion: If true include the server version in HTTP headers
threadPool: MObject:The server Thread Pool
contexts: MMBean:RO:The contexts of this server
startupTime: MBean:RO:The startup time, in milliseconds, since January 1st 1970
dumpAfterStart: RW:Dump state to stderr after start
dumpBeforeStop: RW:Dump state to stderr before stop

View File

@ -1,19 +0,0 @@
AbstractSessionManager: Abstract Session Manager
httpOnly: True if cookies use the http only flag
idManager: MObject:RO:The ID Manager instance
maxCookieAge: if greater than zero, the time in seconds a session cookie will last for
maxInactiveInterval: default maximum time in seconds a session may be idle
refreshCookieAge: The time in seconds after which a session cookie is re-set
secureCookies: If true, the secure cookie flag is set on session cookies
sessionCookie: The set session cookie
sessionDomain: The domain of the session cookie or null for the default
sessionPath: The path of the session cookie or null for the default
sessionsTotal: The total number of sessions
sessionIdPathParameterName: The name to use for URL session tracking
statsReset(): Reset statistics
sessions: Current instantaneous number of sessions
sessionsMax: Maximum number of simultaneous sessions since statsReset() was called
sessionTimeMax: Maximum amount of time in seconds session remained valid since statsReset() was called
sessionTimeTotal: Total amount of time in seconds sessions remained valid since statsReset() was called
sessionTimeMean: Mean amount of time in seconds a session remained valid since statsReset() was called
sessionTimeStdDev: Standard deviation of amount of time in seconds a session remained valid since statsReset() was called