KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > mcast > BroadcastDispatcher


1 package org.sapia.ubik.mcast;
2
3 import java.io.IOException JavaDoc;
4
5
6 /**
7  * An instance of this interface dispatches multicast events.
8  *
9  * @author Yanick Duchesne
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
12  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
13  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
14  * </dl>
15  */

16 public interface BroadcastDispatcher {
17   /**
18    * Dispatches a multicast event holding the given parameters.
19    *
20    * @param alldomains if <code>true</code> sends an event to all domains.
21    * @param id the logical identifier of the event.
22    * @param data the data that is encapsulated within the event.
23    * @throws IOException if an IO problem occurs.
24    */

25   public void dispatch(boolean alldomains, String JavaDoc id, Object JavaDoc data)
26     throws IOException JavaDoc;
27
28   /**
29    * Dispatches a multicast event to the given domain.
30    *
31    * @param domain the domain to dispatch the event to.
32    * @param id the logical identifier of the event.
33    * @param data the data that is encapsulated within the event.
34    * @throws IOException if an IO problem occurs.
35    */

36   public void dispatch(String JavaDoc domain, String JavaDoc id, Object JavaDoc data)
37     throws IOException JavaDoc;
38
39   /**
40    * Sets this instance's "buffer size". The size is specified in bytes, and can
41    * be interpreted differently from one implementation to another - for example, for
42    * UDP-based implementation, it can correspond to the datagram packet size.
43    *
44    * @param the size of this instance's internal buffer, in bytes.
45    */

46   public void setBufsize(int size);
47
48   /**
49    * Starts this instance - must be called prior to using this instance.
50    */

51   public void start();
52
53   /**
54    * Closes this instance, which can't be used thereafter.
55    */

56   public void close();
57
58   /**
59    * Returns the node identifier of this instance.
60    *
61    * @return this instance's node identifier.
62    */

63   public String JavaDoc getNode();
64
65   /**
66    * Returns this instance's multicast port.
67    *
68    * @return a multicast port.
69    */

70   public int getMulticastPort();
71
72   /**
73    * Returns this instance's multicast address.
74    *
75    * @return a multicast address string.
76    */

77   public String JavaDoc getMulticastAddress();
78 }
79
Popular Tags