jsr356-experts@websocket-spec.java.net

[jsr356-experts] Re: [jsr356-users] Re: Last refactoring/naming proposal: RemoteEndpoint

From: Scott Ferguson <ferg_at_caucho.com>
Date: Fri, 22 Feb 2013 09:41:58 -0800

On 2/22/13 9:33 AM, Danny Coward wrote:
>
> RemoteEndpoint remote = session.getRemote()
>
> with the refactoring, we'd have to be able to ask for the particular
> type of RemoteEndpoint we wanted
>
> RemoteEndpoint.Basic basicRemote =
> session.getRemote(RemoteEndpoint.Basic);
>
> or
>
> RemoteEndpoint.Async asyncRemote =
> session.getRemote(RemoteEndpoint.Async);
>

I assume: session.getRemote(RemoteEndpoint.Async.class)
>
> Alternatively, we could just have:-
>
> session.getAsyncRemote()
> session.getBasicRemote();

+1 on the alternate.
>
> but I think the first way is a bit 'classier' :)

But harder to remember or to learn from skimming the JavaDoc.

-- Scott

> And maybe future versions will add other flavors of RemoteEndpoint.
>
> - Danny
>
>>
>> Mark
>>
>
>
> --
> <http://www.oracle.com> *Danny Coward *
> Java EE
> Oracle Corporation
>