Verified Owner
Top Description Fields Constructors Methods
org.jabref.http.manager

public Class HttpServerThread

extends Thread
Class Inheritance
Annotations
@NullMarked
Imports
java.net.URI, org.jabref.http.SrvStateManager, org.jabref.http.server.Server, org.jabref.logic.UiMessageHandler, org.jabref.logic.preferences.CliPreferences, jakarta.ws.rs.ProcessingException, org.glassfish.grizzly.http.server.HttpServer, org.jspecify.annotations.NullMarked, .Nullable, org.slf4j.Logger, .LoggerFactory

This thread wrapper is required to be able to interrupt the http server, e.g. when JabRef is closing down the http server should shutdown as well. Used by the GUI only

Field Summary

Modifier and TypeField and Description
private @Nullable HttpServer
private static final Logger
private final Server
private final SrvStateManager
private final UiMessageHandler
private final URI
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public
HttpServerThread(CliPreferences cliPreferences, SrvStateManager srvStateManager, UiMessageHandler uiMessageHandler, URI uri)

Method Summary

Modifier and TypeMethod and Description
public void
interrupt()

Overrides java.lang.Thread.interrupt.

Interrupts this thread.

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

public boolean
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadthreadIdtoStringyield

Field Detail

httpServerback to summary
private @Nullable HttpServer httpServer
LOGGERback to summary
private static final Logger LOGGER
serverback to summary
private final Server server
srvStateManagerback to summary
private final SrvStateManager srvStateManager
uiMessageHandlerback to summary
private final UiMessageHandler uiMessageHandler
uriback to summary
private final URI uri

Constructor Detail

HttpServerThreadback to summary
public HttpServerThread(CliPreferences cliPreferences, SrvStateManager srvStateManager, UiMessageHandler uiMessageHandler, URI uri)

Method Detail

interruptback to summary
public void interrupt()

Overrides java.lang.Thread.interrupt.

Doc from java.lang.Thread.interrupt.

Interrupts this thread.

If this thread is blocked in an invocation of the wait(), wait(long), or wait(long, int) methods of the Object class, or of the join(), join(long), join(long, int), sleep(long), or sleep(long, int) methods of this class, then its interrupted status will be cleared and it will receive an InterruptedException.

If this thread is blocked in an I/O operation upon an InterruptibleChannel then the channel will be closed, the thread's interrupted status will be set, and the thread will receive a java.nio.channels.ClosedByInterruptException.

If this thread is blocked in a java.nio.channels.Selector then the thread's interrupted status will be set and it will return immediately from the selection operation, possibly with a non-zero value, just as if the selector's wakeup method were invoked.

If none of the previous conditions hold then this thread's interrupted status will be set.

Interrupting a thread that is not alive need not have any effect.

Annotations
@Override
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
startedback to summary
public boolean started()