Class ServerWrapper
java.lang.Object
de.iip_ecosphere.platform.services.ServerWrapper
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.Server
Wraps a
Server into a thread if considered necessary. A wrapped threaded server may fail more easily than
a direct instance controlled by a service manager, while a threaded server also allocates more resources if the
server itself creates a thread.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerWrapper(de.iip_ecosphere.platform.support.Server server) Creates a server wrapper. -
Method Summary
-
Field Details
-
server
private de.iip_ecosphere.platform.support.Server server -
thread
-
running
private boolean running
-
-
Constructor Details
-
ServerWrapper
public ServerWrapper(de.iip_ecosphere.platform.support.Server server) Creates a server wrapper.- Parameters:
server- the server instance
-
-
Method Details
-
requiresThread
protected boolean requiresThread()Returns whether a wrapping thread is needed or the server shall be called as delegate.- Returns:
trueif a thread is required,falseelse
-
start
public de.iip_ecosphere.platform.support.Server start()- Specified by:
startin interfacede.iip_ecosphere.platform.support.Server
-
stop
public void stop(boolean dispose) - Specified by:
stopin interfacede.iip_ecosphere.platform.support.Server
-