Salut,
On 10-11-04 11:20 AM, Bryant Luk wrote:
Hello,
Cool, Atmosphere is a very interesting project. I think what you
suggest is doable.
(1) For the processing of Atmosphere's annotations, you may want to
take a look at the
org.apache.wink.server.internal.registry.ServerInjectableFactory. You
can change the behavior for JAX-RS injections there. For the example
you've given, the PathParamBinding static inner class should be your
starting point. The BoundInjectable class that *Binding extends from
contains the meta-information for the injectable field/property.
Perfect.
(2) You can create your own customized handler(s) to process the
response however you like. org.apache.wink.server.internal.handlers
are the default server side handlers. Users can create their own
handlers themselves to alter the behavior but I think you'd have to
make some deeper changes depending on the processing, so you probably
want to extend org.apache.wink.server.internal.DeploymentConfiguration
and change the handler ordering.
OK totally missed that API.
http://incubator.apache.org/wink/1.1.1/Apache_Wink_User_Guide.pdf
Chapter 5.7 Handler chain might be of the most use from an
architectural perspective.
If you have more questions, please feel free to ask. Thanks!
Thanks a lot. I should do the work over the upcoming weeks or so. For
sure I want support for Atmosphere 0.8 (currently at 0.6.4)
-- Jeanfrancois
On Thu, Nov 4, 2010 at 9:32 AM, jfarcand<[email protected]> wrote:
Salut,
first, I apology if there is some documentation I could have read on the
topic. Just point me to the proper location if that exist.
I'm the lead/creator of Atmosphere, a Comet/Websocket Framework:
https://github.com/Atmosphere/atmosphere
Atmosphere has several entries point, and one of them is a REST based
module. What the module offer is new set of annotation to add support for
Comet based transaction (ya, it's totally opposite of REST...but still fun).
http://is.gd/gIciG
Currently Atmosphere support Jersey, but I would also like to support Wink.
Mainly, I would like to be able to do:
/**
* Inject a {...@link Broadcaster} based on @Path
*/
private @PathParam("topic") Broadcaster topic;
/**
* Suspend the response, and register a {...@link
AtmosphereResourceEventListener}
* that get notified when events occurs like client disconnection,
broadcast
* or when the response get resumed.
*
* @return A {...@link Broadcastable} used to broadcast events.
*/
@GET
@Suspend(listeners = {EventsLogger.class})
public Broadcastable subscribe() {
return new Broadcastable(topic);
}
In short, I need to learn how I can extend Wink in order to:
(1) process the Atmosphere's annotation
(2) Intercept the Resource's response in order to take the appropriate
Atmosphere action.
As an example, here is how I do it in Jersey:
http://is.gd/gIfNI
Please let me know if that's doable or not. I already able to support Wink
by injecting the HttpServletRequest and retrieving Atmosphere's object from
there, but it is not as simple as the snippet above.
Thanks!
-- Jeanfrancois