Class Server
java.lang.Object
org.languagetool.server.Server
- Direct Known Subclasses:
HTTPServer, HTTPSServer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected LanguageToolHttpHandlerprivate booleanprotected intprotected com.sun.net.httpserver.HttpServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidprotected @Nullable ErrorRequestLimiterprotected ThreadPoolExecutorgetExecutorService(LinkedBlockingQueue<Runnable> workQueue, HTTPServerConfig config) protected abstract Stringprotected @Nullable RequestLimiterbooleanprotected static voidprotected static voidvoidrun()Start the server.voidstop()Stop the server.protected static booleanusageRequested(String[] args)
-
Field Details
-
DEFAULT_ALLOWED_IPS
-
port
protected int port -
host
-
server
protected com.sun.net.httpserver.HttpServer server -
httpHandler
-
isRunning
private boolean isRunning
-
-
Constructor Details
-
Server
Server()
-
-
Method Details
-
getProtocol
-
run
public void run()Start the server. -
stop
public void stop()Stop the server. Once stopped, a server cannot be used again. -
isRunning
public boolean isRunning()- Returns:
- whether the server is running
- Since:
- 2.0
-
getRequestLimiterOrNull
-
getErrorRequestLimiterOrNull
@Nullable protected @Nullable ErrorRequestLimiter getErrorRequestLimiterOrNull(HTTPServerConfig config) -
usageRequested
-
printCommonConfigFileOptions
protected static void printCommonConfigFileOptions() -
printCommonOptions
protected static void printCommonOptions() -
checkForNonRootUser
protected static void checkForNonRootUser() -
getExecutorService
protected ThreadPoolExecutor getExecutorService(LinkedBlockingQueue<Runnable> workQueue, HTTPServerConfig config)
-