+ @ManagedAttribute("The priority delta to apply to acceptor threads")
+ public int getAcceptorPriorityDelta()
+ {
+ return _acceptorPriorityDelta;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the acceptor thread priority delta.
+ * <p>This allows the acceptor thread to run at a different priority.
+ * Typically this would be used to lower the priority to give preference
+ * to handling previously accepted connections rather than accepting
+ * new connections</p>
+ * @param acceptorPriorityDelta
+ */
+ public void setAcceptorPriorityDelta(int acceptorPriorityDelta)
+ {
+ int old=_acceptorPriorityDelta;
+ _acceptorPriorityDelta = acceptorPriorityDelta;
+ if (old!=acceptorPriorityDelta && isStarted())
+ {
+ for (Thread thread : _acceptors)
+ thread.setPriority(Math.max(Thread.MIN_PRIORITY,Math.min(Thread.MAX_PRIORITY,thread.getPriority()-old+acceptorPriorityDelta)));
+ }
+ }