Formatting cleanups and added Javadocs.
This commit is contained in:
parent
b38597a5bc
commit
da72bff86a
|
@ -24,53 +24,69 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||||
import org.eclipse.jetty.util.component.LifeCycle;
|
import org.eclipse.jetty.util.component.LifeCycle;
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/**
|
||||||
/** ThreadPool.
|
* <p>A pool for threads.</p>
|
||||||
*
|
* <p>A specialization of Executor interface that provides reporting methods (eg {@link #getThreads()})
|
||||||
* A specialization of Executor interface that provides reporting methods (eg {@link #getThreads()})
|
* and the option of configuration methods (e.g. @link {@link SizedThreadPool#setMaxThreads(int)}).</p>
|
||||||
* and the option of configuration methods (e.g. @link {@link SizedThreadPool#setMaxThreads(int)}).
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@ManagedObject("Pool of Threads")
|
@ManagedObject("Pool of Threads")
|
||||||
public interface ThreadPool extends Executor
|
public interface ThreadPool extends Executor
|
||||||
{
|
{
|
||||||
/* ------------------------------------------------------------ */
|
|
||||||
/**
|
/**
|
||||||
* Blocks until the thread pool is {@link LifeCycle#stop stopped}.
|
* Blocks until the thread pool is {@link LifeCycle#stop stopped}.
|
||||||
|
*
|
||||||
* @throws InterruptedException if thread was interrupted
|
* @throws InterruptedException if thread was interrupted
|
||||||
*/
|
*/
|
||||||
public void join() throws InterruptedException;
|
public void join() throws InterruptedException;
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
|
||||||
/**
|
/**
|
||||||
* @return The total number of threads currently in the pool
|
* @return The total number of threads currently in the pool
|
||||||
*/
|
*/
|
||||||
@ManagedAttribute("number of threads in pool")
|
@ManagedAttribute("number of threads in pool")
|
||||||
public int getThreads();
|
public int getThreads();
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
|
||||||
/**
|
/**
|
||||||
* @return The number of idle threads in the pool
|
* @return The number of idle threads in the pool
|
||||||
*/
|
*/
|
||||||
@ManagedAttribute("number of idle threads in pool")
|
@ManagedAttribute("number of idle threads in pool")
|
||||||
public int getIdleThreads();
|
public int getIdleThreads();
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
|
||||||
/**
|
/**
|
||||||
* @return True if the pool is low on threads
|
* @return True if the pool is low on threads
|
||||||
*/
|
*/
|
||||||
@ManagedAttribute("indicates the pool is low on available threads")
|
@ManagedAttribute("indicates the pool is low on available threads")
|
||||||
public boolean isLowOnThreads();
|
public boolean isLowOnThreads();
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/**
|
||||||
/* ------------------------------------------------------------ */
|
* <p>Specialized sub-interface of ThreadPool that allows to get/set
|
||||||
|
* the minimum and maximum number of threads of the pool.</p>
|
||||||
|
*/
|
||||||
public interface SizedThreadPool extends ThreadPool
|
public interface SizedThreadPool extends ThreadPool
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @return the minimum number of threads
|
||||||
|
*/
|
||||||
int getMinThreads();
|
int getMinThreads();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the maximum number of threads
|
||||||
|
*/
|
||||||
int getMaxThreads();
|
int getMaxThreads();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param threads the minimum number of threads
|
||||||
|
*/
|
||||||
void setMinThreads(int threads);
|
void setMinThreads(int threads);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param threads the maximum number of threads
|
||||||
|
*/
|
||||||
void setMaxThreads(int threads);
|
void setMaxThreads(int threads);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a ThreadPoolBudget for this sized thread pool,
|
||||||
|
* or null of no ThreadPoolBudget can be returned
|
||||||
|
*/
|
||||||
default ThreadPoolBudget getThreadPoolBudget()
|
default ThreadPoolBudget getThreadPoolBudget()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue