tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-1540) Comet Integration
Date Fri, 22 Jun 2012 09:37:42 GMT

    [ 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

        

Mime
View raw message