GigaSpaces XAP 9.0 API

org.openspaces.pu.container.jee.jetty.holder
Class SharedThreadPool

java.lang.Object
  extended by org.openspaces.pu.container.jee.jetty.holder.SharedThreadPool
All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.ThreadPool

public class SharedThreadPool
extends Object
implements org.eclipse.jetty.util.thread.ThreadPool, org.eclipse.jetty.util.component.LifeCycle

A Jetty ThreadPool that shares a single instance of a thread pool. The first thread pool passed will win and be used.

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool
org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Constructor Summary
SharedThreadPool(org.eclipse.jetty.util.thread.ThreadPool delegate)
           
 
Method Summary
 void addLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener listener)
           
 boolean dispatch(Runnable runnable)
           
 int getIdleThreads()
           
 int getThreads()
           
 boolean isFailed()
           
 boolean isLowOnThreads()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStarting()
           
 boolean isStopped()
           
 boolean isStopping()
           
 void join()
           
 void removeLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener listener)
           
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedThreadPool

public SharedThreadPool(org.eclipse.jetty.util.thread.ThreadPool delegate)
Method Detail

dispatch

public boolean dispatch(Runnable runnable)
Specified by:
dispatch in interface org.eclipse.jetty.util.thread.ThreadPool

join

public void join()
          throws InterruptedException
Specified by:
join in interface org.eclipse.jetty.util.thread.ThreadPool
Throws:
InterruptedException

getThreads

public int getThreads()
Specified by:
getThreads in interface org.eclipse.jetty.util.thread.ThreadPool

getIdleThreads

public int getIdleThreads()
Specified by:
getIdleThreads in interface org.eclipse.jetty.util.thread.ThreadPool

isLowOnThreads

public boolean isLowOnThreads()
Specified by:
isLowOnThreads in interface org.eclipse.jetty.util.thread.ThreadPool

start

public void start()
           throws Exception
Specified by:
start in interface org.eclipse.jetty.util.component.LifeCycle
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface org.eclipse.jetty.util.component.LifeCycle
Throws:
Exception

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.eclipse.jetty.util.component.LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface org.eclipse.jetty.util.component.LifeCycle

isStarting

public boolean isStarting()
Specified by:
isStarting in interface org.eclipse.jetty.util.component.LifeCycle

isStopping

public boolean isStopping()
Specified by:
isStopping in interface org.eclipse.jetty.util.component.LifeCycle

isStopped

public boolean isStopped()
Specified by:
isStopped in interface org.eclipse.jetty.util.component.LifeCycle

isFailed

public boolean isFailed()
Specified by:
isFailed in interface org.eclipse.jetty.util.component.LifeCycle

addLifeCycleListener

public void addLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener listener)
Specified by:
addLifeCycleListener in interface org.eclipse.jetty.util.component.LifeCycle

removeLifeCycleListener

public void removeLifeCycleListener(org.eclipse.jetty.util.component.LifeCycle.Listener listener)
Specified by:
removeLifeCycleListener in interface org.eclipse.jetty.util.component.LifeCycle

toString

public String toString()
Overrides:
toString in class Object

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.