File tree Expand file tree Collapse file tree 6 files changed +33
-8
lines changed
src/org/puremvc/as3/multicore Expand file tree Collapse file tree 6 files changed +33
-8
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ package org.puremvc.as3.multicore.core
113113if ( commandClassRef == null ) return ;
114114
115115var commandInstance : ICommand = new commandClassRef();
116- commandInstance. setMultitonKey ( multitonKey );
116+ commandInstance. initializeNotifier ( multitonKey );
117117commandInstance. execute ( note );
118118}
119119
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ package org.puremvc.as3.multicore.core
8989 */
9090public function registerProxy ( proxy :IProxy ) : void
9191{
92- proxy. setMultitonKey ( multitonKey );
92+ proxy. initializeNotifier ( multitonKey );
9393proxyMap[ proxy. getProxyName() ] = proxy;
9494}
9595
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ package org.puremvc.as3.multicore.core
136136public function registerMediator ( mediator :IMediator ) : void
137137{
138138
139- mediator. setMultitonKey ( multitonKey );
139+ mediator. initializeNotifier ( multitonKey );
140140
141141// Register the Mediator for retrieval by name
142142mediatorMap[ mediator. getMediatorName() ] = mediator;
Original file line number Diff line number Diff line change @@ -43,8 +43,15 @@ package org.puremvc.as3.multicore.interfaces
4343function sendNotification ( notificationName :String , body :Object = null , type :String = null ):void ;
4444
4545/**
46- * Set the multitonKey for this INotifier instance
46+ * Initialize this INotifier instance.
47+ * <P >
48+ * This is how a Notifier gets its multitonKey.
49+ * Calls to sendNotification or to access the
50+ * facade will fail until after this method
51+ * has been called.</P >
52+ *
53+ * @param key the multitonKey for this INotifier to use
4754 */
48- function setMultitonKey ( key :String ): void ;
55+ function initializeNotifier ( key :String ): void ;
4956}
5057}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ package org.puremvc.as3.multicore.patterns.facade
3232 */
3333public function Facade ( key :String ) {
3434if (instanceMap[ key ] != null ) throw Error (MULTITON_MSG );
35- setMultitonKey ( key );
35+ initializeNotifier ( key );
3636instanceMap[ multitonKey ] = this ;
3737initializeFacade();
3838}
@@ -302,7 +302,7 @@ package org.puremvc.as3.multicore.patterns.facade
302302 * It is necessary to be public in order to
303303 * implement INotifier.</P >
304304 */
305- public function setMultitonKey ( key :String ):void
305+ public function initializeNotifier ( key :String ):void
306306{
307307multitonKey = key;
308308}
Original file line number Diff line number Diff line change @@ -60,7 +60,25 @@ package org.puremvc.as3.multicore.patterns.observer
6060facade. sendNotification( notificationName, body , type );
6161}
6262
63- public function setMultitonKey ( key :String ):void
63+ /**
64+ * Initialize this INotifier instance.
65+ * <P >
66+ * This is how a Notifier gets its multitonKey.
67+ * Calls to sendNotification or to access the
68+ * facade will fail until after this method
69+ * has been called.</P >
70+ *
71+ * <P >
72+ * Mediators, Commands or Proxies may override
73+ * this method in order to send notifications
74+ * or access the Multiton Facade instance as
75+ * soon as possible. They CANNOT access the facade
76+ * in their constructors, since this method will not
77+ * yet have been called.</P >
78+ *
79+ * @param key the multitonKey for this INotifier to use
80+ */
81+ public function initializeNotifier ( key :String ):void
6482{
6583multitonKey = key;
6684}
You can’t perform that action at this time.
0 commit comments