jsr356-experts@websocket-spec.java.net

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

From: Danny Coward <danny.coward_at_oracle.com>
Date: Fri, 22 Feb 2013 09:33:53 -0800

On 2/22/13 1:48 AM, Mark Thomas wrote:
> On 21/02/2013 01:03, Danny Coward wrote:
>> Instead of:-
>>
>> OLD: Session: RemoteEndpoint getRemoteEndpoint(), we would have
>>
>> NEW: Session: T getRemoteEndpoint(T extends RemoteEndpoint);
>> So, T could be RemoteEndpoint.Basic or RemoteEndpoint.Async.
>
> I'm not at all clear what you are proposing here.
Sorry, probably not very clear.

Today we say

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);


Alternatively, we could just have:-

session.getAsyncRemote()
session.getBasicRemote();

but I think the first way is a bit 'classier' :) And maybe future
versions will add other flavors of RemoteEndpoint.

- Danny

>
> Mark
>


-- 
<http://www.oracle.com> 	*Danny Coward *
Java EE
Oracle Corporation