Re: Using custom Configurator with WebSockets

2019-04-28 Thread Christopher Dodunski
Your idea of wrapping the interface returned by the registry was a stroke of brilliance! And I'm pleased to say it was successful. I'm now working to resolve another small hiccup. The IoC registry can be configured to provide the service as either a singleton or a new instance for each new

Re: Using custom Configurator with WebSockets

2019-04-26 Thread Mark Thomas
Hmm. Looking at this some more I'm not sure this is going to work. HarbourServerEndpoint needs to extend javax.websocket.Endpoint which it can't do as an interface. I think you are going to have to wrap the instance returned by the registry. In which case you can probably go back to using POJO.

Re: Using custom Configurator with WebSockets

2019-04-26 Thread Christopher Dodunski
So I've converted the server endpoint from annotation-based to programmatic, to get around the constraint of the @ServerEndpoint annotation having to decorate a concrete class. The elements of this annotation now occupy an implementation of ServerApplicationConfig: public class

Re: Using custom Configurator with WebSockets

2019-04-24 Thread Christopher Dodunski
Thanks Mark, you've made it clear that annotating the interface is not an option. Converting my server endpoint from annotation based to programmatic is not a problem, nor is implementing ServerApplicationConfig to configure what were previously @ServerEndpoint elements: value, encoders,

Re: Using custom Configurator with WebSockets

2019-04-24 Thread Mark Thomas
On 24/04/2019 07:16, Christopher Dodunski wrote: > Hi Mark, > > Looking at the Tapestry-IoC Registry code I notice that although it > constructs a (plastic) service proxy object, it does cast it to its > associated interface before making it available from the registry's > getService() method.

Re: Using custom Configurator with WebSockets

2019-04-24 Thread Christopher Dodunski
Hi Mark, Looking at the Tapestry-IoC Registry code I notice that although it constructs a (plastic) service proxy object, it does cast it to its associated interface before making it available from the registry's getService() method. So if I move the WebSocket annotations to my interface as

Re: Using custom Configurator with WebSockets

2019-04-23 Thread Christopher Dodunski
Based on what you wrote regarding WebSocket annotations not following Java inheritance, I imagine the below wouldn't work either. public class MyServerEndpointConfig extends ServerEndpointConfig { @Override public Class getEndpointClass() { return MyServiceInterface.class; }

Re: Using custom Configurator with WebSockets

2019-04-23 Thread Christopher Dodunski
> The custom Configurator looks fine. The problem is with trying to do > this with a POJO endpoint. There is an underlying assumption that - for > a POJO endpoint - the endpoints will will instances of the POJO class. > This doesn't seem to hold in your case so hence it breaks. > > The WebSocket

Re: Using custom Configurator with WebSockets

2019-04-22 Thread Mark Thomas
On 17/04/2019 22:58, Christopher Dodunski wrote: > Hello, > > Just a quick question with regard to extending > ServerEndpointConfig.Configurator to override Tomcat's default action of > instantiating the POJO class annotated with @ServerEndpoint on receiving a > WebSocket request. My reason for

Using custom Configurator with WebSockets

2019-04-17 Thread Christopher Dodunski
Hello, Just a quick question with regard to extending ServerEndpointConfig.Configurator to override Tomcat's default action of instantiating the POJO class annotated with @ServerEndpoint on receiving a WebSocket request. My reason for doing this is that my endpoint class depends on IoC