Java Code Examples for org.osgi.service.event.Event#matches()

The following examples show how to use org.osgi.service.event.Event#matches() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Subscription.java    From concierge with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * checks if an event matches the subscribed topics and the filter, if
 * present.
 * 
 * @param event
 *            the <code>Event</code>
 * @return <code>true</code> for the case that the event matches,
 *         <code>false</code> otherwise.
 */
boolean matches(final Event event) {
	if (topics != null && !stringMatch(topics, event.getTopic())) {
		return false;
	}
	if (filter != null && event.matches(filter)) {
		return false;
	}
	return true;
}
 
Example 2
Source File: TrackedEventHandler.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public boolean handleEventSubjectToFilter(Event event)
{
  if (destroyed || isBlacklisted()) {
    return false;
  }
  if (filter == null || event.matches(filter)) {
    tracked.handleEvent(event);
    setBlacklist(false);
    return true;
  }
  return false;
}