- java.lang.Object
-
- javax.websocket.server.ServerEndpointConfig.Builder
-
- Enclosing interface:
- ServerEndpointConfig
public static final class ServerEndpointConfig.Builder extends Object
The ServerEndpointConfig.Builder is a class used for creatingServerEndpointConfig.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 = ServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class, "/foo").build();
Building a configuration with no subprotocols and a custom configurator.
ServerEndpointConfig config = ServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class, "/bar") .subprotocols(subprotocols) .configurator(new MyServerConfigurator()) .build();
- Author:
- dannycoward
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description ServerEndpointConfig
build()
Builds the configuration object using the current attributes that have been set on this builder object.ServerEndpointConfig.Builder
configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator)
Sets the custom configurator to use on the configuration object built by this builder.static ServerEndpointConfig.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.ServerEndpointConfig.Builder
decoders(List<Class<? extends Decoder>> decoders)
Sets the decoder implementation classes to use in the configuration.ServerEndpointConfig.Builder
encoders(List<Class<? extends Encoder>> encoders)
Sets the list of encoder implementation classes for this builder.ServerEndpointConfig.Builder
extensions(List<Extension> extensions)
Sets the extensions to use in the configuration.ServerEndpointConfig.Builder
subprotocols(List<String> subprotocols)
Sets the subprotocols to use in the configuration.
-
-
-
Method Detail
-
create
public static ServerEndpointConfig.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.- Parameters:
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 /.- Returns:
- a new instance of ServerEndpointConfig.Builder
-
build
public ServerEndpointConfig build()
Builds the configuration object using the current attributes that have been set on this builder object.- Returns:
- a new ServerEndpointConfig object.
-
encoders
public ServerEndpointConfig.Builder encoders(List<Class<? extends Encoder>> encoders)
Sets the list of encoder implementation classes for this builder.- Parameters:
encoders
- the encoders- Returns:
- this builder instance
-
decoders
public ServerEndpointConfig.Builder decoders(List<Class<? extends Decoder>> decoders)
Sets the decoder implementation classes to use in the configuration.- Parameters:
decoders
- the decoders- Returns:
- this builder instance.
-
subprotocols
public ServerEndpointConfig.Builder subprotocols(List<String> subprotocols)
Sets the subprotocols to use in the configuration.- Parameters:
subprotocols
- the subprotocols.- Returns:
- this builder instance
-
extensions
public ServerEndpointConfig.Builder extensions(List<Extension> extensions)
Sets the extensions to use in the configuration.- Parameters:
extensions
- the extensions to use.- Returns:
- this builder instance.
-
configurator
public ServerEndpointConfig.Builder configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator)
Sets the custom configurator to use on the configuration object built by this builder.- Parameters:
serverEndpointConfigurator
- the configurator- Returns:
- this builder instance
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/websocket/server/ServerEndpointConfig.Builder.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.