Package org.glassfish.tyrus.server
Class Server
java.lang.Object
org.glassfish.tyrus.server.Server
Implementation of the WebSocket Server.
- Author:
- Stepan Kopriva, Pavel Bucek
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath to static content to be served by created Server instance. -
Constructor Summary
ConstructorsConstructorDescriptionCreate new server instance.Server(String hostName, int port, String contextPath, Map<String, Object> properties, Class<?>... configuration) Construct new server.Server(String hostName, int port, String contextPath, Map<String, Object> properties, Set<Class<?>> configuration) Construct new server.Create new server instance. -
Method Summary
-
Field Details
-
STATIC_CONTENT_ROOT
Path to static content to be served by created Server instance.Value have to be non-empty
Stringand should represent content root of static content (file system path).- See Also:
-
-
Constructor Details
-
Server
Create new server instance.- Parameters:
configuration- to be registered with the server. Classes annotated withServerEndpoint, implementingServerApplicationConfigor extendingServerEndpointConfigare supported.
-
Server
Create new server instance.- Parameters:
properties- properties used as a parameter to(java.util.Map)call.configuration- to be registered with the server. Classes annotated withServerEndpoint, implementingServerApplicationConfigor extendingServerEndpointConfigare supported.
-
Server
public Server(String hostName, int port, String contextPath, Map<String, Object> properties, Class<?>... configuration) Construct new server.- Parameters:
hostName- hostName of the server.port- port of the server. When provided value is0, default port (8025) will be used, when-1, ephemeral port number will be used.contextPath- root path to the server App.properties- properties used as a parameter to(java.util.Map)call.configuration- to be registered with the server. Classes annotated withServerEndpoint, implementingServerApplicationConfigor extendingServerEndpointConfigare supported.- See Also:
-
Server
public Server(String hostName, int port, String contextPath, Map<String, Object> properties, Set<Class<?>> configuration) Construct new server.- Parameters:
hostName- hostName of the server.port- port of the server. When provided value is0, default port (8025) will be used, when-1, ephemeral port number will be used.contextPath- root path to the server App.properties- properties used as a parameter to(java.util.Map)call.configuration- to be registered with the server. Classes annotated withServerEndpoint, implementingServerApplicationConfigor extendingServerEndpointConfigare supported.- See Also:
-
-
Method Details
-
main
-
start
Start the server.- Throws:
DeploymentException
-
getPort
public int getPort()Get the port which was used to start the container.- Returns:
- the port which was used to start the container.
-
stop
public void stop()Stop the server.
-