KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lateralnz > messaging > MessageHandler


1 package org.lateralnz.messaging;
2
3 import java.io.IOException JavaDoc;
4
5 public interface MessageHandler {
6
7  /**
8   * add a message listener to this handler.
9   * @param group the group of messages that a listener is interested in receiving
10   * @param listener the message listener object
11   */

12   public void addListener(String JavaDoc group, MessageListener listener);
13  
14  /**
15   * returns whether transmission will be allowed for a group based upon the
16   * allowed/disallowed regular expressions.
17   * @param group the group to test
18   */

19   public boolean willTransmit(String JavaDoc group);
20   
21  /**
22   * send a message
23   * @param msg the message object to send
24   */

25   public void send(Message msg) throws IOException JavaDoc;
26   
27  /**
28   * a regular expression describing the group(s) that are allowed to send messages.
29   * A priority is also included which, if higher than the disallowed ex
30   * @param regex a regular expression
31   * @param priority what priority the allowed expression has over the disallowed group
32   */

33   public void setAllowedGroupRegex(String JavaDoc regex, int priority);
34   
35  /**
36   * a regular expression describing the group(s) that are -not- allowed to send messages
37   * @param regex a regular expression
38   * @param priority what priority the disallowed expression has over the allowed group
39   */

40   public void setDisallowedGroupRegex(String JavaDoc regex, int priority);
41   
42 }
43
Popular Tags