Top Description Inners Fields Constructors Methods
org.apache.tomcat.websocket

public Class BackgroundProcessManager

extends Object
Class Inheritance
Imports
java.util.HashSet, .Set, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.res.StringManager

Provides a background processing mechanism that triggers roughly once a second. The class maintains a thread that only runs when there is at least one instance of BackgroundProcess registered.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final BackgroundProcessManager
private final Log
private final Set<BackgroundProcess>
private final Object
private static final StringManager
private BackgroundProcessManager.WsBackgroundThread

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BackgroundProcessManager
pack-priv int
private void
public void
pack-priv void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static final BackgroundProcessManager instance
logback to summary
private final Log log
processesback to summary
private final Set<BackgroundProcess> processes
processesLockback to summary
private final Object processesLock
smback to summary
private static final StringManager sm
wsBackgroundThreadback to summary
private BackgroundProcessManager.WsBackgroundThread wsBackgroundThread

Constructor Detail

BackgroundProcessManagerback to summary
private BackgroundProcessManager()

Method Detail

getInstanceback to summary
public static BackgroundProcessManager getInstance()
getProcessCountback to summary
pack-priv int getProcessCount()
processback to summary
private void process()
registerback to summary
public void register(BackgroundProcess process)
shutdownback to summary
pack-priv void shutdown()
unregisterback to summary
public void unregister(BackgroundProcess process)
org.apache.tomcat.websocket back to summary

private Class BackgroundProcessManager.WsBackgroundThread

extends Thread
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BackgroundProcessManager
private volatile boolean
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
halt()

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

managerback to summary
private final BackgroundProcessManager manager
runningback to summary
private volatile boolean running

Constructor Detail

WsBackgroundThreadback to summary
pack-priv WsBackgroundThread(BackgroundProcessManager manager)

Method Detail

haltback to summary
public void halt()
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override