Component instantiation happens only when someone requests {@link XMLInputFactory}, so this is as lazy as it gets.
TODO: if we need to let people choose StAX implementation, this is the place to do it. @author Kohsuke Kawaguchi
265266267268269270271272273274275276
protected void registerMonitoringStatsProviders() { final String nameLocal = name; final GrizzlyMonitoring monitoring = grizzlyService.getMonitoring(); monitoring.registerThreadPoolStatsProvider(nameLocal); monitoring.registerKeepAliveStatsProvider(nameLocal); monitoring.registerFileCacheStatsProvider(nameLocal); monitoring.registerConnectionQueueStatsProvider(nameLocal); }
275276277278279280281282283284285286
monitoring.registerConnectionQueueStatsProvider(nameLocal); } protected void unregisterMonitoringStatsProviders() { final String localName = name; final GrizzlyMonitoring monitoring = grizzlyService.getMonitoring(); monitoring.unregisterThreadPoolStatsProvider(localName); monitoring.unregisterKeepAliveStatsProvider(localName); monitoring.unregisterFileCacheStatsProvider(localName); monitoring.unregisterConnectionQueueStatsProvider(localName); }
158159160161162163164
private final Queue<Callable<Void>> serverReadyListeners = new ConcurrentLinkedQueue<Callable<Void>>(); public GrizzlyService() { futures = new ArrayList<Future<Result<Thread>>>(); monitoring = new GrizzlyMonitoring(); }
355356357358359360361362363364365366
return grizzlyListener; } protected void registerMonitoringStatsProviders() { final String name = networkListener.getName(); final GrizzlyMonitoring monitoring = grizzlyService.getMonitoring(); monitoring.registerThreadPoolStatsProvider(name); monitoring.registerKeepAliveStatsProvider(name); monitoring.registerFileCacheStatsProvider(name); monitoring.registerConnectionQueueStatsProvider(name); }
365366367368369370371372373374375376
monitoring.registerConnectionQueueStatsProvider(name); } protected void unregisterMonitoringStatsProviders() { final String name = networkListener.getName(); final GrizzlyMonitoring monitoring = grizzlyService.getMonitoring(); monitoring.unregisterThreadPoolStatsProvider(name); monitoring.unregisterKeepAliveStatsProvider(name); monitoring.unregisterFileCacheStatsProvider(name); monitoring.unregisterConnectionQueueStatsProvider(name); }
138139140141142143144
private DynamicConfigListener configListener; public GrizzlyService() { futures = new ArrayList<Future<Result<Thread>>>(); monitoring = new GrizzlyMonitoring(); }
216217218219220221222223224
} @Override protected KeepAlive configureKeepAlive(Http http) { final KeepAlive keepAlive = super.configureKeepAlive(http); keepAlive.getMonitoringConfig().addProbes(new KeepAliveMonitor( grizzlyService.getMonitoring(), name, keepAlive)); return keepAlive; }
237238239240241242243244245
protected ThreadPoolConfig configureThreadPoolConfig(final NetworkListener networkListener, final ThreadPool threadPool) { final ThreadPoolConfig config = super.configureThreadPoolConfig( networkListener, threadPool); config.getInitialMonitoringConfig().addProbes(new ThreadPoolMonitor( grizzlyService.getMonitoring(), name, config)); return config; }
7980818283848586878889909192939495969798
null, Thread.NORM_PRIORITY)); if (monitoring != null) { StatsProvider statsProvider = monitoring.getThreadPoolStatsProvider(monitoringId); if (statsProvider != null) { statsProvider.setStatsObject(this); } statsProvider = monitoring.getConnectionQueueStatsProvider(monitoringId); if (statsProvider != null) { statsProvider.setStatsObject(this); } ThreadPoolConfig config = getConfiguration(); // force related events to be fired though the values aren't