Class StandardVirtualThreadExecutor

  • All Implemented Interfaces:
    java.util.concurrent.Executor,, Executor, JmxEnabled, Lifecycle

    public class StandardVirtualThreadExecutor
    extends LifecycleMBeanBase
    implements Executor
    An executor that uses a new virtual thread for each task.
    • Constructor Detail

      • StandardVirtualThreadExecutor

        public StandardVirtualThreadExecutor()
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Executor
      • getNamePrefix

        public java.lang.String getNamePrefix()
      • setNamePrefix

        public void setNamePrefix​(java.lang.String namePrefix)
      • execute

        public void execute​(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor
      • execute

        public void execute​(java.lang.Runnable command,
                            long timeout,
                            java.util.concurrent.TimeUnit unit)
        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 the Executor 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
        Specified by:
        execute in interface Executor
        command - the runnable task
        timeout - the length of time to wait for the task to complete
        unit - the units in which timeout is expressed
      • getDomainInternal

        protected java.lang.String 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 class LifecycleMBeanBase
        The name of the domain to use to register MBeans.
      • getObjectNameKeyProperties

        protected java.lang.String getObjectNameKeyProperties()
        Description copied from class: LifecycleMBeanBase
        Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.
        Specified by:
        getObjectNameKeyProperties in class LifecycleMBeanBase
        The string representation of the key properties component of the desired ObjectName