com.isomorphic.messaging

## Class ISCMessageDispatcher

- java.lang.Object
- - com.isomorphic.messaging.ISCMessageDispatcher

-     public abstract class ISCMessageDispatcher
      extends java.lang.Object

  This is the base local dispatcher - it is an abstract class that provides same-jvm registration management and channel subscriptions. Use it to obtain a concrete message dispatcher class.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ISCMessageDispatcher` | `instance()`
    `static ISCMessageDispatcher` | `instance(RequestContext context)`
    `boolean` | `isSubscribed(ISubscriber subscriber, java.lang.String channel)` Check to see if a given subscriber is subscribed to a given channel.
    `void` | `register(ISubscriber subscriber)` register this subscriber
    `void` | `send(ISCMessage msg)` send a message
    `void` | `subscribe(ISubscriber subscriber, java.lang.String channel)` subscribe a given subscriber to a given channel
    `abstract void` | `subscribe(ISubscriber subscriber, java.lang.String channel, java.lang.String selector)` subscribe a given subscriber to a given channel
    `void` | `unregister(ISubscriber subscriber)` unregister this subscriber
    `abstract void` | `unsubscribe(ISubscriber subscriber, java.lang.String channel)` unsubscribe a given subscriber from a given channel

- - ### Method Detail

    - #### instance

          public static ISCMessageDispatcher instance()
                                               throws java.lang.Exception

      Returns:
        concrete ISCMessageDispatcher class for sending/receiving Realtime Messages.
      Throws:
        `java.lang.Exception`

    - #### instance

          public static ISCMessageDispatcher instance(RequestContext context)
                                               throws java.lang.Exception

      Parameters:
        `context` -
      Returns:
        concrete ISCMessageDispatcher class capable of delivering responses to web browsers
      Throws:
        `java.lang.Exception`

    - #### register

          public void register(ISubscriber subscriber)
                        throws java.lang.Exception

      register this subscriber
      Parameters:
        `subscriber` -
      Throws:
        `java.lang.Exception`

    - #### unregister

          public void unregister(ISubscriber subscriber)
                          throws java.lang.Exception

      unregister this subscriber
      Parameters:
        `subscriber` -
      Throws:
        `java.lang.Exception`

    - #### subscribe

          public void subscribe(ISubscriber subscriber,
                                java.lang.String channel)
                         throws java.lang.Exception

      subscribe a given subscriber to a given channel
      Parameters:
        `subscriber` -
        `channel` -
      Throws:
        `java.lang.Exception`

    - #### subscribe

          public abstract void subscribe(ISubscriber subscriber,
                                         java.lang.String channel,
                                         java.lang.String selector)
                                  throws java.lang.Exception

      subscribe a given subscriber to a given channel
      Parameters:
        `subscriber` -
        `channel` -
        `selector` -
      Throws:
        `java.lang.Exception`

    - #### unsubscribe

          public abstract void unsubscribe(ISubscriber subscriber,
                                           java.lang.String channel)
                                    throws java.lang.Exception

      unsubscribe a given subscriber from a given channel
      Parameters:
        `subscriber` -
        `channel` -
      Throws:
        `java.lang.Exception`

    - #### send

          public void send(ISCMessage msg)
                    throws java.lang.Exception

      send a message
      Parameters:
        `msg` -
      Throws:
        `java.lang.Exception`

    - #### isSubscribed

          public boolean isSubscribed(ISubscriber subscriber,
                                      java.lang.String channel)
                               throws java.lang.Exception

      Check to see if a given subscriber is subscribed to a given channel. Note: not applicable to JMS (meaningless in a distributed context)
      Parameters:
        `subscriber` -
        `channel` -
      Returns:
        true if subscribed, false if not
      Throws:
        `java.lang.Exception`