Top Description Fields Constructors Methods
org.apache.catalina.core

public Class StandardVirtualThreadExecutor

extends LifecycleMBeanBase
implements Executor
Class Inheritance
All Implemented Interfaces
org.apache.catalina.Executor, org.apache.catalina.Lifecycle, java.util.concurrent.Executor
Imports
org.apache.catalina.Executor, .LifecycleException, .LifecycleState, org.apache.catalina.util.LifecycleMBeanBase, org.apache.tomcat.util.compat.JreCompat, org.apache.tomcat.util.res.StringManager, org.apache.tomcat.util.threads.VirtualThreadExecutor

An executor that uses a new virtual thread for each task.

Field Summary

Modifier and TypeField and Description
private Executor
private String
private String
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
execute(Runnable
the runnable task
command
)

Implements java.util.concurrent.Executor.execute.

Executes the given command at some time in the future.

protected String
getDomainInternal()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

public String
public String
protected String
getObjectNameKeyProperties()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

protected void
initInternal()

Overrides org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

public void
public void
setNamePrefix(String namePrefix)

protected void
startInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Sub-classes must ensure that the state is changed to LifecycleState#STARTING during the execution of this method.

protected void
stopInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Sub-classes must ensure that the state is changed to LifecycleState#STOPPING during the execution of this method.

Inherited from org.apache.catalina.util.LifecycleMBeanBase:
destroyInternalgetDomaingetObjectNamepostDeregisterpostRegisterpreDeregisterpreRegisterregistersetDomainunregisterunregister

Field Detail

executorback to summary
private Executor executor
nameback to summary
private String name
namePrefixback to summary
private String namePrefix
smback to summary
private static final StringManager sm

Hides org.apache.catalina.util.LifecycleMBeanBase.sm.

Constructor Detail

StandardVirtualThreadExecutorback to summary
public StandardVirtualThreadExecutor()

Method Detail

executeback to summary
public void execute(Runnable command)

Implements java.util.concurrent.Executor.execute.

Doc from java.util.concurrent.Executor.execute.

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 the Executor implementation.

Parameters
command:Runnable

the runnable task

Annotations
@Override
getDomainInternalback to summary
protected String getDomainInternal()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Doc from org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

Returns:String

The name of the domain to use to register MBeans.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.apache.catalina.Executor.getName.

Annotations
@Override
getNamePrefixback to summary
public String getNamePrefix()
getObjectNameKeyPropertiesback to summary
protected String getObjectNameKeyProperties()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Doc from org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

Returns:String

The string representation of the key properties component of the desired ObjectName

Annotations
@Override
initInternalback to summary
protected void initInternal() throws LifecycleException

Overrides org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Doc from org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

Annotations
@Override
Exceptions
LifecycleException:

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

If the initialisation fails

setNameback to summary
public void setName(String name)
setNamePrefixback to summary
public void setNamePrefix(String namePrefix)
startInternalback to summary
protected void startInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Doc from org.apache.catalina.util.LifecycleBase.startInternal.

Sub-classes must ensure that the state is changed to LifecycleState#STARTING during the execution of this method. Changing state will trigger the Lifecycle#START_EVENT event. If a component fails to start it may either throw a LifecycleException which will cause it's parent to fail to start or it can place itself in the error state in which case stop() will be called on the failed component but the parent component will continue to start normally.

Annotations
@Override
Exceptions
LifecycleException:
Start error occurred
stopInternalback to summary
protected void stopInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Doc from org.apache.catalina.util.LifecycleBase.stopInternal.

Sub-classes must ensure that the state is changed to LifecycleState#STOPPING during the execution of this method. Changing state will trigger the Lifecycle#STOP_EVENT event.

Annotations
@Override
Exceptions
LifecycleException:
Stop error occurred