Package net.engio.mbassy.listener
Class Filters.SubtypesOnly
java.lang.Object
net.engio.mbassy.listener.Filters.SubtypesOnly
- All Implemented Interfaces:
IMessageFilter
- Enclosing class:
Filters
This filter will only accept messages that are real subtypes
of the specified message types handled by the message handler.
Example: If the handler handles Object.class the filter accepts
all objects except any direct instance of Object.class
new Object()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(Object message, SubscriptionContext context) Check whether the message matches some criteria
-
Constructor Details
-
SubtypesOnly
public SubtypesOnly()
-
-
Method Details
-
accepts
Description copied from interface:IMessageFilter
Check whether the message matches some criteria- Specified by:
accepts
in interfaceIMessageFilter
- Parameters:
message
- The message to be handled by the handlercontext
- The context object containing a description of the message handler and the bus environment- Returns:
- true: if the message matches the criteria and should be delivered to the handler false: otherwise
-