View Javadoc

1   /*
2    *  Copyright 2004-2006 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package org.asteriskjava.manager.internal;
18  
19  import org.asteriskjava.manager.event.ManagerEvent;
20  import org.asteriskjava.manager.response.ManagerResponse;
21  
22  
23  /***
24   * The Dispatcher defines the interface used for communication between
25   * ManagerConnection and ManagerReader.<p>
26   * Do not use this interface in your code, it is intended to be used only by the
27   * DefaultManagerConnection and its ManagerReader.
28   * 
29   * @author srt
30   * @version $Id: Dispatcher.java 421 2006-05-28 15:02:14Z srt $
31   */
32  interface Dispatcher
33  {
34      /***
35       * This method is called by the reader whenever a {@link ManagerResponse} is
36       * received. The response is dispatched to the associated
37       * {@link org.asteriskjava.manager.SendActionCallback}.
38       * 
39       * @param response the resonse received by the reader
40       * @see ManagerReader
41       */
42      void dispatchResponse(ManagerResponse response);
43  
44      /***
45       * This method is called by the reader whenever a ManagerEvent is received.
46       * The event is dispatched to all registered ManagerEventHandlers.
47       * 
48       * @param event the event received by the reader
49       * @see ManagerReader
50       */
51      void dispatchEvent(ManagerEvent event);
52  }