View Javadoc

1   /*
2    * Copyright (c) 1998-2002 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  
19  package jgroup.relacs.gm;
20  
21  import jgroup.core.JgroupException;
22  import jgroup.core.Layer;
23  
24  /**
25   *  Service interface for the dispatcher layer. It provides methods
26   *  to add the start and stop the dispatcher, and to force the
27   *  dispatching of a single event.
28   * 
29   *  @author Alberto Montresor
30   *  @author Hein Meling
31   *  @since 0.8
32   */
33  public interface DispatcherService
34    extends Layer
35  {
36  
37    /**
38     *  Start dispatching events for the given group.
39     */
40    public void start(int gid);
41  
42  
43    /**
44     *  Stop dispatching events
45     */
46    public void halt();
47  
48  
49    /**
50     *  Dispatch a single event (can be called by an upcall method)
51     */
52    public void dispatch(Object obj);
53  
54  
55    /**
56     *  Returns the remote dispatcher reference.
57     *
58     *  @throws JgroupException
59     *    Raised if the dispatcher service could be not export
60     *    for remote access by the Jgroup daemon.
61     */
62    public RemoteDispatcher getRemoteDispatcher()
63      throws JgroupException;
64  
65  } // END DispatcherService