Class DefaultMetaBroadcaster

  • All Implemented Interfaces:
    MetaBroadcaster, AtmosphereConfigAware

    public class DefaultMetaBroadcaster
    extends java.lang.Object
    implements MetaBroadcaster
    Broadcast events to all or a subset of available Broadcasters based on their Broadcaster.getID() value. This class allows broadcasting events to a set of broadcasters that maps to some String like:
            // Broadcast the event to all Broadcaster ID starting with /hello
            broadcast("/hello", event)
            // Broadcast the event to all Broadcaster ID
            broaccast("/*", event);
     
    The rule used is similar to path/URI mapping used by technology like Servlet, Jersey, etc.

    NOTE: Broadcasters' name must start with / in order to get retrieved by this class.

    This class is NOT thread safe.

    If you want to use MetaBroadcaster with Jersey or any framework, make sure all Broadcaster.getID() starts with '/'. For example, with Jersey:

    Author:
    Jeanfrancois Arcand