Package org.apache.catalina.core
Class StandardVirtualThreadExecutor
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.core.StandardVirtualThreadExecutor
- All Implemented Interfaces:
- Executor,- ExecutorService,- MBeanRegistration,- Executor,- JmxEnabled,- Lifecycle
public class StandardVirtualThreadExecutor
extends LifecycleMBeanBase
implements Executor, ExecutorService
An executor that uses a new virtual thread for each task.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
- 
Field SummaryFields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserverFields inherited from interface org.apache.catalina.LifecycleAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) voidvoidExecutes the given command at some time in the future.protected StringMethod implemented by sub-classes to identify the domain in which MBeans should be registered.getName()protected StringAllow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.protected voidSub-classes implement this method to perform any instance initialisation required.invokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) booleanbooleanvoidvoidsetNamePrefix(String namePrefix) voidshutdown()protected voidSub-classes must ensure that the state is changed toLifecycleState.STARTINGduring the execution of this method.protected voidSub-classes must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method.Future<?><T> Future<T><T> Future<T>Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasedestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.catalina.LifecycleaddLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
- 
Constructor Details- 
StandardVirtualThreadExecutorpublic StandardVirtualThreadExecutor()
 
- 
- 
Method Details- 
setName
- 
getName
- 
getNamePrefix
- 
setNamePrefix
- 
execute
- 
executeDescription copied from interface:ExecutorExecutes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of theExecutorimplementation. If no threads are available, it will be added to the work queue. If the work queue is full, the system will wait for the specified time until it throws a RejectedExecutionException
- 
initInternalDescription copied from class:LifecycleBaseSub-classes implement this method to perform any instance initialisation required.- Overrides:
- initInternalin class- LifecycleMBeanBase
- Throws:
- LifecycleException- If the initialisation fails
 
- 
startInternalDescription copied from class:LifecycleBaseSub-classes must ensure that the state is changed toLifecycleState.STARTINGduring the execution of this method. Changing state will trigger theLifecycle.START_EVENTevent. If a component fails to start it may either throw aLifecycleExceptionwhich will cause it's parent to fail to start or it can place itself in the error state in which caseLifecycleBase.stop()will be called on the failed component but the parent component will continue to start normally.- Specified by:
- startInternalin class- LifecycleBase
- Throws:
- LifecycleException- Start error occurred
 
- 
stopInternalDescription copied from class:LifecycleBaseSub-classes must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method. Changing state will trigger theLifecycle.STOP_EVENTevent.- Specified by:
- stopInternalin class- LifecycleBase
- Throws:
- LifecycleException- Stop error occurred
 
- 
getDomainInternalDescription copied from class:LifecycleMBeanBaseMethod implemented by sub-classes to identify the domain in which MBeans should be registered.- Specified by:
- getDomainInternalin class- LifecycleMBeanBase
- Returns:
- The name of the domain to use to register MBeans.
 
- 
getObjectNameKeyPropertiesDescription copied from class:LifecycleMBeanBaseAllow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.- Specified by:
- getObjectNameKeyPropertiesin class- LifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the desired ObjectName
 
- 
shutdownpublic void shutdown()- Specified by:
- shutdownin interface- ExecutorService
 
- 
shutdownNow- Specified by:
- shutdownNowin interface- ExecutorService
 
- 
isShutdownpublic boolean isShutdown()- Specified by:
- isShutdownin interface- ExecutorService
 
- 
isTerminatedpublic boolean isTerminated()- Specified by:
- isTerminatedin interface- ExecutorService
 
- 
awaitTermination- Specified by:
- awaitTerminationin interface- ExecutorService
- Throws:
- InterruptedException
 
- 
submit- Specified by:
- submitin interface- ExecutorService
 
- 
submit- Specified by:
- submitin interface- ExecutorService
 
- 
submit- Specified by:
- submitin interface- ExecutorService
 
- 
invokeAllpublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
- invokeAllin interface- ExecutorService
- Throws:
- InterruptedException
 
- 
invokeAllpublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
- invokeAllin interface- ExecutorService
- Throws:
- InterruptedException
 
- 
invokeAnypublic <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
- invokeAnyin interface- ExecutorService
- Throws:
- InterruptedException
- ExecutionException
 
- 
invokeAnypublic <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
- invokeAnyin interface- ExecutorService
- Throws:
- InterruptedException
- ExecutionException
- TimeoutException
 
 
-