users@websocket-spec.java.net

[jsr356-users] Programmatic registration of endpoint

From: Arun Gupta <arun.p.gupta_at_oracle.com>
Date: Thu, 28 Feb 2013 11:31:35 -0500

With the updated APIs, programmatic registration of an Endpoint requires
the following code:

ServerEndpointConfiguration config =
ServerEndpointConfigurationBuilder.create(ProgrammaticEndpoint.class,
"/foo").build();

What is the expectation or guidance in terms of where this code would
typically sit ?

Earlier I could have two classes:

- MyEndpoint extends Endpoint
- MyServerConfiguration extends DefaultServerConfiguration

Now, do I need an eagerly initialized Singleton bean to register this
endpoint programmatically ? ServletContextListener ? Somewhere else ?

Arun

-- 
http://twitter.com/arungupta
http://blogs.oracle.com/arungupta