[Jiemamy-notify:1112] commit [2435] イベント通知を行うイベントブローカ

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 1月 18日 (日) 21:58:23 JST


Revision: 2435
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2435
Author:   shin1
Date:     2009-01-18 21:58:23 +0900 (Sun, 18 Jan 2009)

Log Message:
-----------
イベント通知を行うイベントブローカ

Added Paths:
-----------
    sandbox/command-sample2/src/main/java/org/jiemamy/test/Broker.java


-------------- next part --------------
Added: sandbox/command-sample2/src/main/java/org/jiemamy/test/Broker.java
===================================================================
--- sandbox/command-sample2/src/main/java/org/jiemamy/test/Broker.java	                        (rev 0)
+++ sandbox/command-sample2/src/main/java/org/jiemamy/test/Broker.java	2009-01-18 12:58:23 UTC (rev 2435)
@@ -0,0 +1,48 @@
+package org.jiemamy.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jiemamy.test.command.Command;
+import org.jiemamy.test.event.CommandListener;
+import org.jiemamy.test.model.Model;
+
+/**
+ * ワイヤーとかいうヤツ。必要なリスナにイベントを通知する。
+ * <p>CommandProcessorはCommandを実行した時に、どこからかコイツを取得して{@link #fireCommandProcess(Command)}を実行する事。</p>
+ * @author shin1ogawa
+ */
+public class Broker {
+	
+	private List<CommandListener> listeners = new ArrayList<CommandListener>();
+	
+
+	/**
+	 * TODO for shin1ogawa
+	 * 
+	 * @param observeTarget
+	 * @param listener
+	 */
+	public void addListener(Model observeTarget, CommandListener listener) {
+		listeners.add(listener);
+	}
+	
+	/**
+	 * TODO for shin1ogawa
+	 * 
+	 * @param command
+	 */
+	public void fireCommandProcess(Command command) {
+		// FIXME 通知が必要なリスナを探してそいつらに通知する。
+		// targetの親も探し出して、バブリングもする。
+	}
+	
+	/**
+	 * TODO for shin1ogawa
+	 * 
+	 * @param listener
+	 */
+	public void removeListener(CommandListener listener) {
+		listeners.remove(listener);
+	}
+}


Property changes on: sandbox/command-sample2/src/main/java/org/jiemamy/test/Broker.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain


Jiemamy-notify メーリングリストの案内
Back to archive index