Class MonitoringFeature
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.MonitoringFeature
-
- All Implemented Interfaces:
javax.ws.rs.core.Feature
public final class MonitoringFeature extends java.lang.Object implements javax.ws.rs.core.Feature
Feature that enables calculating ofmonitoring statistics
and optionally also enables exposure of monitoring MBeans.Calculation of
MonitoringStatistics
is necessary in order to expose monitoring MBeans, so by default this feature always enables calculation ofMonitoringStatistics
. Additionally, the feature can be configured by settingtrue
tosetmBeansEnabled(boolean)
in order to enable exposure of monitoring MBeans. The same can be achieved by configuration of a propertyServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED
which overrides the setting defined by thesetmBeansEnabled(boolean)
method.The MonitoringStatistics can be controlled also by definition of a property
When auto-discovery is enabled then monitoring statistics and exposure of MBeans can be controlled only by properties above without a need to explicitly register this feature.ServerProperties.MONITORING_STATISTICS_ENABLED
which overrides the registration of this feature.- See Also:
for more details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MonitoringFeature.ApplicationInfoInjectionFactory
private static class
MonitoringFeature.StatisticsInjectionFactory
private static class
MonitoringFeature.StatisticsListener
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
private boolean
mBeansEnabled
private boolean
monitoringEnabled
private boolean
statisticsEnabled
-
Constructor Summary
Constructors Constructor Description MonitoringFeature()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(javax.ws.rs.core.FeatureContext context)
void
setmBeansEnabled(boolean mBeansEnabled)
Set whether the feature should also enable exposure of monitoring statistics MBeans.
-
-
-
Method Detail
-
configure
public boolean configure(javax.ws.rs.core.FeatureContext context)
- Specified by:
configure
in interfacejavax.ws.rs.core.Feature
-
setmBeansEnabled
public void setmBeansEnabled(boolean mBeansEnabled)
Set whether the feature should also enable exposure of monitoring statistics MBeans. The set value can be overwritten by the definition of the propertyServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED
.- Parameters:
mBeansEnabled
-true
is monitoring MBeans should be exposed.
-
-