All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webswing.toolkit.api.messaging.WebswingTopic Maven / Gradle / Ivy

There is a newer version: 20.2.4
Show newest version
package org.webswing.toolkit.api.messaging;

import java.io.IOException;

/**
 * Reference to a topic filtered by message type
 * @param  message type
 */
public interface WebswingTopic {

	/**
	 * Publish a message to all subscribed webswing sessions.
	 * @param message the message
	 * @throws IOException if failed to send the message
	 */
	void publish(T message) throws IOException;

	/**
	 * Subscribe for receiving messages of defined type
	 * @param listener the listener
	 */
	void subscribe(WebswingMessageListener listener);


	/**
	 * Unsubscribe from receiving messages of defined type
	 * @param listener the listener
	 */
	void unsubscribe(WebswingMessageListener listener);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy