Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1540

Comet Integration

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.4
    • Fix Version/s: None
    • Component/s: tapestry-core, tapestry-ioc
    • Labels:
      None

      Description

      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/

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              toby78 Toby
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: