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
,MBeanRegistration
,Executor
,JmxEnabled
,Lifecycle
An executor that uses a new virtual thread for each task.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase
mserver
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Executes the given command at some time in the future.protected String
Method implemented by sub-classes to identify the domain in which MBeans should be registered.getName()
protected String
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.protected void
Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.void
void
setNamePrefix
(String namePrefix) protected void
Sub-classes must ensure that the state is changed toLifecycleState.STARTING
during the execution of this method.protected void
Sub-classes must ensure that the state is changed toLifecycleState.STOPPING
during the execution of this method.Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.catalina.Lifecycle
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
-
Constructor Details
-
StandardVirtualThreadExecutor
public StandardVirtualThreadExecutor()
-
-
Method Details
-
setName
-
getName
-
getNamePrefix
-
setNamePrefix
-
execute
-
execute
Description copied from interface:Executor
Executes 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 theExecutor
implementation. 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 -
initInternal
Description copied from class:LifecycleMBeanBase
Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.- Overrides:
initInternal
in classLifecycleMBeanBase
- Throws:
LifecycleException
- If the initialisation fails
-
startInternal
Description copied from class:LifecycleBase
Sub-classes must ensure that the state is changed toLifecycleState.STARTING
during the execution of this method. Changing state will trigger theLifecycle.START_EVENT
event. If a component fails to start it may either throw aLifecycleException
which 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:
startInternal
in classLifecycleBase
- Throws:
LifecycleException
- Start error occurred
-
stopInternal
Description copied from class:LifecycleBase
Sub-classes must ensure that the state is changed toLifecycleState.STOPPING
during the execution of this method. Changing state will trigger theLifecycle.STOP_EVENT
event.- Specified by:
stopInternal
in classLifecycleBase
- Throws:
LifecycleException
- Stop error occurred
-
getDomainInternal
Description copied from class:LifecycleMBeanBase
Method implemented by sub-classes to identify the domain in which MBeans should be registered.- Specified by:
getDomainInternal
in classLifecycleMBeanBase
- Returns:
- The name of the domain to use to register MBeans.
-
getObjectNameKeyProperties
Description copied from class:LifecycleMBeanBase
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.- Specified by:
getObjectNameKeyProperties
in classLifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the
desired
ObjectName
-