I'm using Spring 3.2.5 without full new JSR-356 WebSockets support.

I would like to have singleton-bean reference in my `@ServerEndpoint` WebSocket server, which is instantiated by servlet container itself, not in Spring context.

**What is the clean way to do it?**

My current solution: I made `@Service` singleton bean with instance in static field:

```
@Service
public class WebSocketSupportBean {
    private volatile static WebSocketSupportBean instance = null;

    public static WebSocketSupportBean getInstance() {
        return instance;
    }

    public WebSocketSupportBean() {
        instance = this;
    }

```

and just getting it in `@ServerEndpoint` by static method, disconnecting user if null returned (if bean not jet created during server startup but user connects):