Class DefaultServer
java.lang.Object
com.soklet.core.impl.DefaultServer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder used to construct instances ofDefaultServer
.Nested classes/interfaces inherited from interface com.soklet.core.Server
Server.RequestHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(SokletConfiguration sokletConfiguration, Server.RequestHandler requestHandler) Is this server started (that is, able to handle requests from clients)?void
start()
Starts the server, which makes it able to accept requests from clients.void
stop()
Stops the server, which makes it unable to accept requests from clients.static DefaultServer.Builder
-
Method Details
-
withPort
-
start
-
stop
-
isStarted
-
initialize
public void initialize(@Nonnull SokletConfiguration sokletConfiguration, @Nonnull Server.RequestHandler requestHandler) Description copied from interface:Server
TheSoklet
instance which manages thisServer
will invoke this method exactly once at initialization time - this allowsSoklet
to "talk" to yourServer
.This method is designed for internal use by
Soklet
only and should not be invoked elsewhere.- Specified by:
initialize
in interfaceServer
- Parameters:
sokletConfiguration
- configuration for the Soklet instance that controls this serverrequestHandler
- aSoklet
-internal request handler which takes aServer
-provided request as input and supplies aMarshaledResponse
as output for theServer
to write back to the client
-