> 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 spec explicitly states that WebSocket annotations do not
> follow Java inheritance so moving the annotation to the interface is not
> an option.
>
> I think you are going to have to build your ServerEndpointConfig
> programmatically so you can specify the correct endpoint class.
>
> Mark

Thank you very much Mark for explaining.  After examining the Tapestry-IoC
a little closer, I discovered that what is being returned from the
Registry is in fact a 'service proxy object'.  It implements the same
service interface as my implementation class, but it is NOT an instance of
my implementation class.

I was thinking to shift my WebSocket annotations from the service
implementation to the service interface, but you write that this won't
work either.

So I searched the net and found a number of examples of using build() to
define an endpoint configuration.  Do you happen to have an example where
the objective was the same - or very similar to - my own?  I guess the
goal is in having Tomcat accept a service proxy object that merely
implements a given service interface, yes?

Quoting from the Tapestry-IoC documentation:

"Services consist of two main parts: a service interface and a service
implementation. The service interface is how the service will be
represented throughout the rest of the registry. Since what gets passed
around is normally a proxy, you can't expect to cast a service object down
to the implementation class (you'll see a ClassCastException instead). In
other words, you should be careful to ensure that your service interface
is complete, since Tapestry IoC effectively walls you off from back doors
such as casts."

Regards,

Chris.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to