tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toby (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TAP5-1540) Comet Integration
Date Mon, 06 Jun 2011 12:27:58 GMT
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


In order to be able to use Comet out-of-the-box in Tapestry, the following annotations would
need to be implemented/integrated:

// 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message