|
Right Java tools for J2EE, Web Service, Grid and more
|
com.acelet.s.messaging
Interface DynamicMessageFilter
public interface DynamicMessageFilter
DynamicMessageFilter is the class for providing dynamic message for JMS.
To use DynamicMessageFilter, you need to create your class implementing
this interface. The implemented class must have a constructor with empty parameter.
The constructor may be called more than once.
Example:
import javax.jms.*;
public class DynamicMessageFilterAsTextMessage implements DynamicMessageFilter {
public DynamicMessageFilterAsTextMessage() {
}
public boolean isGood(Message message) {
try {
TextMessage textMessage = (TextMessage) message;
String text = textMessage.getText();
if (text.indexOf("good") > 0)
return true;
return false;
} catch (Exception e) {
return false;
}
}
|
Method Summary |
boolean |
isGood(javax.jms.Message message)
isGood is a user defined method. |
isGood
boolean isGood(javax.jms.Message message)
isGood is a user defined method. It checks the message and
desides if the message should be filter out.
- Parameters:
message - the message to be checked.
- Returns:
- false if the message should be filter out, true otherwise.