You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thiago H. de Paula Figueiredo (JIRA)" <ji...@apache.org> on 2014/06/06 17:02:02 UTC

[jira] [Closed] (TAP5-1540) Comet Integration

     [ https://issues.apache.org/jira/browse/TAP5-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiago H. de Paula Figueiredo closed TAP5-1540.
-----------------------------------------------

    Resolution: Won't Fix

Lance's library already covers this.

> Comet Integration
> -----------------
>
>                 Key: TAP5-1540
>                 URL: https://issues.apache.org/jira/browse/TAP5-1540
>             Project: Tapestry 5
>          Issue Type: New Feature
>          Components: tapestry-core, tapestry-ioc
>    Affects Versions: 5.4
>            Reporter: Toby
>
> CometD 2.1 now supports annotations to define CometD services and clients.
> In order to be able to use Comet out-of-the-box in Tapestry, the following annotations need to be "passed-through" to Tapestry:
> // defnes a comet service
> @Service("chat")
> public class ChatService {     ... }
> // defines comet channels
> @Configure ({"/chat/**","/members/**"})
> protected void configureChatStarStar(ConfigurableServerChannel channel)
> {
>     DataFilterMessageListener noMarkup = 
>       new DataFilterMessageListener(_bayeux, new NoMarkupFilter(),
>       new BadWordFilter());
>     channel.addListener(noMarkup);
>     channel.addAuthorizer(GrantAuthorizer.GRANT_ALL);
> }
> // add a listener
> @Listener("/service/members")
> public void handleMembership(ServerSession client, ServerMessage message)
> {
>  ...
> }
> // client side
> @Service
> MyClient
> {
>     @Session
>     private ClientSession session;
>     @PostConstruct
>     private void init()
>     {
>         ...
>     }
>     @PreDestroy
>     private void destroy()
>     {
>         ...
>     }
>     @Listener("/meta/*")
>     public void handleMetaMessage(Message connect)
>     {
>         ...
>     }
>     @Subscription("/foo")
>     public void handeFoo(Message message)
>     {
>         ...
>     }
> }
> http://cometdaily.com/2011/04/07/559/



--
This message was sent by Atlassian JIRA
(v6.2#6252)