Skip to content

Package: ServerApplicationConfig

ServerApplicationConfig

Coverage

1: /*
2: * Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package jakarta.websocket.server;
19:
20: import java.util.Set;
21: import jakarta.websocket.Endpoint;
22:
23: /**
24: * Developers include implementations of ServerApplicationConfig in an archive containing websocket endpoints (WAR file,
25: * or JAR file within the WAR file) in order to specify the websocket endpoints within the archive the implementation
26: * must deploy. There is a separate method for programmatic endpoints and for annotated endpoints.
27: *
28: * @author dannycoward
29: */
30: public interface ServerApplicationConfig {
31:
32: /**
33: * Return a set of ServerEndpointConfig instances that the server container will use to deploy the programmatic
34: * endpoints. The set of Endpoint classes passed in to this method is the set obtained by scanning the archive
35: * containing the implementation of this ServerApplicationConfig. This set passed in may be used the build the set
36: * of ServerEndpointConfig instances to return to the container for deployment.
37: *
38: * @param endpointClasses the set of all the Endpoint classes in the archive containing the implementation of this
39: * interface.
40: * @return the non-null set of ServerEndpointConfig s to deploy on the server, using the empty set to indicate none.
41: */
42: public Set<ServerEndpointConfig> getEndpointConfigs(Set<Class<? extends Endpoint>> endpointClasses);
43:
44: /**
45: * Return a set of annotated endpoint classes that the server container must deploy. The set of classes passed in to
46: * this method is the set obtained by scanning the archive containing the implementation of this interface.
47: * Therefore, this set passed in contains all the annotated endpoint classes in the JAR or WAR file containing the
48: * implementation of this interface. This set passed in may be used the build the set to return to the container for
49: * deployment.
50: *
51: * @param scanned the set of all the annotated endpoint classes in the archive containing the implementation of this
52: * interface.
53: * @return the non-null set of annotated endpoint classes to deploy on the server, using the empty set to indicate
54: * none.
55: */
56: Set<Class<?>> getAnnotatedEndpointClasses(Set<Class<?>> scanned);
57: }