messagereceiver.java

来自「Java Crawler with domain knowledge path」· Java 代码 · 共 36 行

JAVA
36
字号
package ie.vnit.threads;

/**
 * Simple interface that allows a thread to tell another class what it is
 * currently doing, i.e. for displaying status information on the screen or
 * anything.
 *
 
 */

public interface MessageReceiver {

	/**
	 * Receive a message from a thread
	 * ThreadIds may refer to threadIds issued by a ThreadController,
	 * but this is not a requirement. The threadId should just allow the
	 * receiving class to determine which thread has sent the message.
	 */
	public void receiveMessage(Object theMessage, int threadId);

	/**
	 * Receive a 'this thread has ended'-message
	 * This message is sent by a ThreadController when a thread has announced
	 * his 'death' to the controller.
	 */
	public void finished(int threadId);

	/**
	 * Receive a 'all threads have ended'-message
	 * This message is sent by a ThreadController when all threads have
	 * announced their 'death' to the controller and no other threads
	 * are to be started.
	 */
	public void finishedAll();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?