String path = servletRequest.getRequestURI(); // shouldn't matter
ServerEndpointRegistration endpointRegistration = new ServerEndpointRegistration(path, endpoint);
endpointRegistration.setSubprotocols(Arrays.asList(selectedProtocol));
endpointRegistration.setExtensions(selectedExtensions);
return new ConfiguredServerEndpoint(endpointRegistration, new EndpointInstanceFactory(endpoint), null,
new EncodingFactory(
Collections.<Class<?>, List<InstanceFactory<? extends Encoder>>>emptyMap(),
Collections.<Class<?>, List<InstanceFactory<? extends Decoder>>>emptyMap(),
Collections.<Class<?>, List<InstanceFactory<? extends Encoder>>>emptyMap(),
Collections.<Class<?>, List<InstanceFactory<? extends Decoder>>>emptyMap()));