Hmm,
I had though that this would make sense if it uuid was part of the URI,
so something like this:
@Path("/channel")
public class ChanneledResource
{
@POST
public Reponse createChannel(@Context UriBuilder u)
{
String uuid = ....;
return Response.temporaryRedirect(
info.getRequestUriBuilder().path(uuid.toString));
}
@Suspend
@POST
@Path("/{uuid}")
public ... suspend()
{
}
@Resume
@POST
@Path("/{uuid}")
public ... suspend(....)
{
}
}
Each channel then becomes its own resource which means that it now makes
sense for Resume to resume all suspended connections. It would make the
API obvious to get hold of the relevant broadcaster as the name would be
derived by default from the URI of the suspended resource.
Or is the problem more subtle than this? I put this straw man forward
for someone else to demolish.
Gerard
On 21/10/2009 08:03, Paul Sandoz wrote:
>
> On Oct 21, 2009, at 1:05 AM, Jeanfrancois Arcand wrote:
>
>> Salut,
>>
>> I've just found a design flaw with the @Resume support. Currently,
>> when you annoate a method with @Resume, a request to that that method
>> will resume *all* the suspended response. This is not right IMO,
>> resume should have only resumed a single suspended response...but
>> which one?Since we don't have the session concept by default in
>> Jersey, it is almost impossible to retrieve the Response that was
>> suspended (it is impossible)
>>
>> So we need to re-work the annotations and add the notion of {id} (a
>> token the client can use), e.g
>>
>> @Suspend({id})
>>
>> and then later
>>
>> @Resume({id})
>>
>> to resume a single connection. Or use the
>> HttpServletRequest.getSession() under the hood, but I'm currently
>> trying to remove all use of Session as it cause all sort of issue of
>> the session times out and there is still suspended response
>> associated with the session.
>>
>> What peoples thinks?
>>
>
> Removing the dependence on HTTP sessions is i think a good idea, less
> stuff to worry about, but i suppose it does not really simplify the
> infrastructure if pushing is utilized as the connections are "sticky"
> (the point being for RESTful system sessions break the stateless
> constraint and make it harder to scale).
>
> How will the client/server agree on an ID for suspend?
>
> - using a cookie?
>
> - does it make any sense to associate the ID with the path of the URI?
>
> I have a hunch it might be possible to support this using cookies and
> UUIDs without requiring explicit IDs. But i am not sure i understand
> everything here. The idea would be on suspend the server would send a
> cookie and that cookie can be sent by the client for the request
> associated with resume.
>
> Paul.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
[hidden email]
> For additional commands, e-mail:
[hidden email]
>
--
Gerard Davison | Senior Principal Software Engineer | +44 118 924 5095
Oracle JDeveloper Web Service Tooling Development
Oracle Corporation UK Ltd is a company incorporated in England & Wales.
Company Reg. No. 1782505.
Reg. office: Oracle Parkway, Thames Valley Park, Reading RG6 1RA.
Blog
http://kingsfleet.blogspot.com---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]