Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.joepritzel.feather;

A topic based subscriber, where topics are paths.

Subscribers will receive all messages to children of the paths specified.

Joe Pritzel
public abstract class TopicSubscriber<T> extends
The path that the subscriber is subscribed to.
	private final String path;

Creates a new topical subscriber.

path - The path to listen on.
	public TopicSubscriber(String path) {
		this. = path;

Invoked when a message is received by a path that this is subscribed to.

path - The path that the message was sent to.
message - The message that was received.
	public abstract void received(String path, T message);
	public String getPath() {
		return ;
	public final boolean applies(TopicalMessage<T> message) {
		if (message.getPath().startsWith()) {
			return true;
		return false;
	public final void receive(TopicalMessage<T> message) {
		received(message.getPath(), message.getMessage());
New to GrepCode? Check out our FAQ X