/** * Return the underlying {@link SelectorThread}. Only advanced users * should manipulate that class. * @return {@link SelectorThread} */ public SelectorThread getSelectorThread(){ supportHttp(); return (SelectorThread)grizzlyListener; }
/** * Set the maximum number of threads in a thread pool. * @param maxThreads the maximum number of threads in a thread pool. */ public void setMaxThreads(int maxThreads) { supportHttp(); ((SelectorThread)grizzlyListener).setMaxThreads(maxThreads); }
/** * Return a {@link Statistics} instance that can be used to gather * statistics. By default, the {@link Statistics} object <strong>is not</strong> * gathering statistics. Invoking {@link Statistics#startGatheringStatistics} * will do it. */ public Statistics getStatistics() { supportHttp(); if (statistics == null) { statistics = new Statistics(((SelectorThread) grizzlyListener)); } return statistics; }
/** * Set the initial number of threads in a thread pool. * @param coreThreads the initial number of threads in a thread pool. */ public void setCoreThreads(int coreThreads) { supportHttp(); ((SelectorThread)grizzlyListener).setCoreThreads(coreThreads); }
/** * Enable JMX Management by configuring the {@link Management} * @param jmxManagement An instance of the {@link Management} interface */ public void enableJMX(Management jmxManagement) { supportHttp(); if (jmxManagement == null) { return; } ((SelectorThread) grizzlyListener).setManagement(jmxManagement); try { ObjectName sname = new ObjectName(mBeanName); jmxManagement.registerComponent(grizzlyListener, sname, null); } catch (Exception ex) { SelectorThread.logger().log(Level.SEVERE, "Enabling JMX failed", ex); } }