public static final class TyrusServerEndpointConfig.Builder extends Object
TyrusServerEndpointConfig.Builder
objects for the purposes of
deploying a server endpoint.
Here are some examples:
Building a plain configuration for an endpoint with just a path.
ServerEndpointConfig config = TyrusServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class,
"/foo").build();
Building a configuration with no subprotocols, limited number of sessions (100) and a custom configurator.
ServerEndpointConfig config = TyrusServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class, "/bar")
.subprotocols(subprotocols)
.maxSessions(100)
.configurator(new MyServerConfigurator())
.build();
Modifier and Type | Method and Description |
---|---|
TyrusServerEndpointConfig |
build()
Builds the configuration object using the current attributes
that have been set on this builder object.
|
TyrusServerEndpointConfig.Builder |
configurator(javax.websocket.server.ServerEndpointConfig.Configurator serverEndpointConfigurator)
Sets the custom configurator to use on the configuration
object built by this builder.
|
static TyrusServerEndpointConfig.Builder |
create(Class<?> endpointClass,
String path)
Creates the builder with the mandatory information of the endpoint class
(programmatic or annotated), the relative URI or URI-template to use,
and with no subprotocols, extensions, encoders, decoders or custom
configurator.
|
TyrusServerEndpointConfig.Builder |
decoders(List<Class<? extends javax.websocket.Decoder>> decoders)
Sets the decoder implementation classes to use in the configuration.
|
TyrusServerEndpointConfig.Builder |
encoders(List<Class<? extends javax.websocket.Encoder>> encoders)
Sets the list of encoder implementation classes for this builder.
|
TyrusServerEndpointConfig.Builder |
extensions(List<javax.websocket.Extension> extensions)
Sets the extensions to use in the configuration.
|
TyrusServerEndpointConfig.Builder |
maxSessions(int maxSessions)
Sets maximal number of open sessions.
|
TyrusServerEndpointConfig.Builder |
subprotocols(List<String> subprotocols)
Sets the subprotocols to use in the configuration.
|
public static TyrusServerEndpointConfig.Builder create(Class<?> endpointClass, String path)
endpointClass
- the class of the endpoint to configurepath
- The URI or URI template where the endpoint will be deployed.
A trailing "/" will be ignored and the path must begin with /.public TyrusServerEndpointConfig build()
public TyrusServerEndpointConfig.Builder encoders(List<Class<? extends javax.websocket.Encoder>> encoders)
encoders
- the encoders.public TyrusServerEndpointConfig.Builder decoders(List<Class<? extends javax.websocket.Decoder>> decoders)
decoders
- the decoders.public TyrusServerEndpointConfig.Builder subprotocols(List<String> subprotocols)
subprotocols
- the subprotocols.public TyrusServerEndpointConfig.Builder extensions(List<javax.websocket.Extension> extensions)
extensions
- the extensions to use.public TyrusServerEndpointConfig.Builder configurator(javax.websocket.server.ServerEndpointConfig.Configurator serverEndpointConfigurator)
serverEndpointConfigurator
- the configurator.public TyrusServerEndpointConfig.Builder maxSessions(int maxSessions)
maxSessions
- maximal number of open session.Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.