View Javadoc

    1   /***
    2    *
    3    * Copyright 2004 Protique Ltd
    4    *
    5    * Licensed under the Apache License, Version 2.0 (the "License");
    6    * you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    *
    9    * http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   *
    17   **/
    18
    19  package org.codehaus.activemq.service;
    20
    21  import org.codehaus.activemq.broker.BrokerClient;
    22
    23  /***
    24   * A dispatcher of messages to some JMS connection.
    25   * <p/>
    26   * Typically this uses either IO or NIO to shovel the messages down
    27   * a socket as fast as possible - in either a push or pull way.
    28   *
    29   * @version $Revision: 1.10 $
    30   */
    31  public interface Dispatcher extends Service {
    32
    33      /***
    34       * Register the MessageContainerManager for the Dispatcher
    35       *
    36       * @param mcm
    37       */
    38      public void register(MessageContainerManager mcm);
    39
    40      /***
    41       * Called to indicate that there is work to do on a Subscription this will wake up a Dispatch Worker if it is
    42       * waiting for messages to dispatch
    43       *
    44       * @param sub the Subscription that now has messages to dispatch
    45       */
    46      public void wakeup(Subscription sub);
    47
    48      /***
    49       * Called to indicate that there is work to do this will wake up a Dispatch Worker if it is
    50       * waiting for messages to dispatch
    51       */
    52      public void wakeup();
    53
    54      /***
    55       * Add an active subscription
    56       *
    57       * @param client
    58       * @param sub
    59       */
    60      public void addActiveSubscription(BrokerClient client, Subscription sub);
    61
    62      /***
    63       * remove an active subscription
    64       *
    65       * @param client
    66       * @param sub
    67       */
    68      public void removeActiveSubscription(BrokerClient client, Subscription sub);
    69
    70  }