You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Lance (JIRA)" <ji...@apache.org> on 2012/06/22 11:37:42 UTC

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

    [ https://issues.apache.org/jira/browse/TAP5-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399239#comment-13399239 ] 

Lance commented on TAP5-1540:
-----------------------------

I have implemented tapestry / cometd integration here:
https://github.com/uklance/tapestry-cometd
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira