First, we need a custom endpoint builder.
public class WSConfigurator extends ServerEndpointConfig.Configurator {
@Inject
private static Injector injector;
@Override
public <T> T getEndpointInstance(Class<T> endpointClass)
throws InstantiationException
{
...