throw JsrWebSocketMessages.MESSAGES.multipleEndpointsWithOverlappingPaths(template, existing);
}
seenPaths.add(template);
EncodingFactory encodingFactory = EncodingFactory.createFactory(classIntrospecter, serverEndpoint.decoders(), serverEndpoint.encoders());
AnnotatedEndpointFactory factory = AnnotatedEndpointFactory.create(xnioWorker, endpoint, classIntrospecter.createInstanceFactory(endpoint), encodingFactory, template.getParameterNames());
Class<? extends ServerEndpointConfig.Configurator> configuratorClass = serverEndpoint.configurator();
ServerEndpointConfig.Configurator configurator;
if (configuratorClass != ServerEndpointConfig.Configurator.class) {
configurator = configuratorClass.newInstance();
} else {
configurator = new ServerInstanceFactoryConfigurator(factory);
}
ServerEndpointConfig config = ServerEndpointConfig.Builder.create(endpoint, serverEndpoint.value())
.decoders(Arrays.asList(serverEndpoint.decoders()))
.encoders(Arrays.asList(serverEndpoint.encoders()))
.subprotocols(Arrays.asList(serverEndpoint.subprotocols()))
.configurator(configurator)
.build();
ConfiguredServerEndpoint confguredServerEndpoint = new ConfiguredServerEndpoint(config, factory, template, encodingFactory);
configuredServerEndpoints.add(confguredServerEndpoint);
handleAddingFilterMapping();
} else if (clientEndpoint != null) {
JsrWebSocketLogger.ROOT_LOGGER.addingAnnotatedClientEndpoint(endpoint);
EncodingFactory encodingFactory = EncodingFactory.createFactory(classIntrospecter, clientEndpoint.decoders(), clientEndpoint.encoders());
AnnotatedEndpointFactory factory = AnnotatedEndpointFactory.create(xnioWorker, endpoint, classIntrospecter.createInstanceFactory(endpoint), encodingFactory, Collections.<String>emptySet());
ClientEndpointConfig config = ClientEndpointConfig.Builder.create()
.decoders(Arrays.asList(clientEndpoint.decoders()))
.encoders(Arrays.asList(clientEndpoint.encoders()))
.preferredSubprotocols(Arrays.asList(clientEndpoint.subprotocols()))