* it will not be handled. If the handler does not define an EventName, the message can be handled.
*/
public class EventNameFilter implements IMessageFilter<AcrossEvent>
{
public boolean accepts( AcrossEvent message, MessageHandler metadata ) {
EventName methodAnnotation = findEventNameAnnotation( metadata );
if ( methodAnnotation == null ) {
return true;
}
if ( message instanceof NamedAcrossEvent ) {
String eventName = ( (NamedAcrossEvent) message ).getEventName();
String[] acceptable = methodAnnotation.value();
return ArrayUtils.contains( acceptable, eventName );
}
// Event name is declared but event is not named, refuse it