Class JMSFilter

  • All Implemented Interfaces:
    org.atmosphere.cpr.BroadcastFilter, org.atmosphere.cpr.BroadcastFilterLifecycle, org.atmosphere.cpr.ClusterBroadcastFilter

    public class JMSFilter
    extends java.lang.Object
    implements org.atmosphere.cpr.ClusterBroadcastFilter
    Clustering support based on JMS
    Author:
    Jean-francois Arcand
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.atmosphere.cpr.BroadcastFilter

        org.atmosphere.cpr.BroadcastFilter.BroadcastAction
    • Field Summary

      • Fields inherited from interface org.atmosphere.cpr.BroadcastFilter

        VOID_ATMOSPHERE_RESOURCE_UUID
    • Constructor Summary

      Constructors 
      Constructor Description
      JMSFilter()  
      JMSFilter​(org.atmosphere.cpr.Broadcaster bc)
      Create a JMSFilter based filter.
      JMSFilter​(org.atmosphere.cpr.Broadcaster bc, java.lang.String topicId)
      Create a JMSFilter based filter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()  
      org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId, java.lang.Object originalMessage, java.lang.Object o)
      Every time a message gets broadcasted, make sure we update the cluster.
      org.atmosphere.cpr.Broadcaster getBroadcaster()
      Return the current Broadcaster
      void init​(org.atmosphere.cpr.AtmosphereConfig config)
      Preapre the cluter.
      void setBroadcaster​(org.atmosphere.cpr.Broadcaster bc)
      Set the current Broadcaster to use when a cluster event happens.
      void setUri​(java.lang.String clusterName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JMSFilter

        public JMSFilter()
      • JMSFilter

        public JMSFilter​(org.atmosphere.cpr.Broadcaster bc)
        Create a JMSFilter based filter.
        Parameters:
        bc - the Broadcaster to use when receiving update from the cluster.
      • JMSFilter

        public JMSFilter​(org.atmosphere.cpr.Broadcaster bc,
                         java.lang.String topicId)
        Create a JMSFilter based filter.
        Parameters:
        bc - the Broadcaster to use when receiving update from the cluster.
        topicId - the topic id
    • Method Detail

      • setUri

        public void setUri​(java.lang.String clusterName)
        Specified by:
        setUri in interface org.atmosphere.cpr.ClusterBroadcastFilter
      • init

        public void init​(org.atmosphere.cpr.AtmosphereConfig config)
        Preapre the cluter.
        Specified by:
        init in interface org.atmosphere.cpr.BroadcastFilterLifecycle
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.atmosphere.cpr.BroadcastFilterLifecycle
      • filter

        public org.atmosphere.cpr.BroadcastFilter.BroadcastAction filter​(java.lang.String broadcasterId,
                                                                         java.lang.Object originalMessage,
                                                                         java.lang.Object o)
        Every time a message gets broadcasted, make sure we update the cluster.
        Specified by:
        filter in interface org.atmosphere.cpr.BroadcastFilter
        Parameters:
        o - the message to broadcast.
        Returns:
        The same message.
      • getBroadcaster

        public org.atmosphere.cpr.Broadcaster getBroadcaster()
        Return the current Broadcaster
        Specified by:
        getBroadcaster in interface org.atmosphere.cpr.ClusterBroadcastFilter
      • setBroadcaster

        public void setBroadcaster​(org.atmosphere.cpr.Broadcaster bc)
        Set the current Broadcaster to use when a cluster event happens.
        Specified by:
        setBroadcaster in interface org.atmosphere.cpr.ClusterBroadcastFilter
        Parameters:
        bc -