File tree Expand file tree Collapse file tree 8 files changed +79
-7
lines changed
src/org/puremvc/as3/multicore Expand file tree Collapse file tree 8 files changed +79
-7
lines changed Original file line number Diff line number Diff line change @@ -161,13 +161,23 @@ package org.puremvc.as3.multicore.core
161
161
commandMap[ notificationName ] = null ;
162
162
}
163
163
164
+ /**
165
+ * Remove an IController instance
166
+ *
167
+ * @param multitonKey of IController instance to remove
168
+ */
169
+ public function removeController ( key :String ):void
170
+ {
171
+ delete instanceMap[ key ];
172
+ }
173
+
164
174
// Local reference to View
165
175
protected var view : IView;
166
176
167
177
// Mapping of Notification names to Command Class references
168
178
protected var commandMap : Array ;
169
179
170
- // The Multiton Key for this app
180
+ // The Multiton Key for this Core
171
181
protected var multitonKey : String ;
172
182
173
183
// Singleton instance
Original file line number Diff line number Diff line change @@ -130,17 +130,27 @@ package org.puremvc.as3.multicore.core
130
130
return proxy;
131
131
}
132
132
133
+ /**
134
+ * Remove an IModel instance
135
+ *
136
+ * @param multitonKey of IModel instance to remove
137
+ */
138
+ public function removeModel ( key :String ):void
139
+ {
140
+ delete instanceMap[ key ];
141
+ }
142
+
133
143
// Mapping of proxyNames to IProxy instances
134
144
protected var proxyMap : Array ;
135
145
136
146
// Singleton instance
137
147
protected static var instanceMap: Array = new Array ();
138
148
139
- // The Multiton Key for this app
149
+ // The Multiton Key for this Core
140
150
protected var multitonKey : String ;
141
151
142
152
// Message Constants
143
- protected const MULTITON_MSG : String = "Model instance for this Multiton key already constructed!" ;
153
+ protected const MULTITON_MSG : String = "Model instance for this Multiton key already constructed!" ;
144
154
145
155
}
146
156
Original file line number Diff line number Diff line change @@ -233,6 +233,16 @@ package org.puremvc.as3.multicore.core
233
233
return mediatorMap[ mediatorName ] != null ;
234
234
}
235
235
236
+ /**
237
+ * Remove an IView instance
238
+ *
239
+ * @param multitonKey of IView instance to remove
240
+ */
241
+ public function removeView ( key :String ):void
242
+ {
243
+ delete instanceMap[ key ];
244
+ }
245
+
236
246
// Mapping of Mediator names to Mediator instances
237
247
protected var mediatorMap : Array ;
238
248
@@ -242,10 +252,10 @@ package org.puremvc.as3.multicore.core
242
252
// Singleton instance
243
253
protected static var instanceMap : Array = new Array ();
244
254
245
- // The Multiton Key for this app
255
+ // The Multiton Key for this Core
246
256
protected var multitonKey : String ;
247
257
248
258
// Message Constants
249
- protected const MULTITON_MSG : String = "View instance for this Multiton key already constructed!" ;
259
+ protected const MULTITON_MSG : String = "View instance for this Multiton key already constructed!" ;
250
260
}
251
261
}
Original file line number Diff line number Diff line change @@ -60,5 +60,14 @@ package org.puremvc.as3.multicore.interfaces
60
60
* @return whether a Command is currently registered for the given <code >notificationName</code >.
61
61
*/
62
62
function hasCommand ( notificationName :String ) : Boolean ;
63
+
64
+ /**
65
+ * Remove an IController instance
66
+ *
67
+ * @param multitonKey of IController instance to remove
68
+ */
69
+ function removeController ( key :String ):void
70
+
71
+
63
72
}
64
73
}
Original file line number Diff line number Diff line change @@ -112,5 +112,11 @@ package org.puremvc.as3.multicore.interfaces
112
112
*/
113
113
function hasMediator ( mediatorName :String ) : Boolean ;
114
114
115
+ /**
116
+ * Remove a Core
117
+ *
118
+ * @param multitonKey of the Core to remove
119
+ */
120
+ function removeCore ( key :String ) : void ;
115
121
}
116
122
}
Original file line number Diff line number Diff line change @@ -53,5 +53,11 @@ package org.puremvc.as3.multicore.interfaces
53
53
*/
54
54
function hasProxy ( proxyName :String ) : Boolean ;
55
55
56
+ /**
57
+ * Remove an IModel instance
58
+ *
59
+ * @param multitonKey of IModel instance to remove
60
+ */
61
+ function removeModel ( key :String ):void ;
56
62
}
57
63
}
Original file line number Diff line number Diff line change @@ -91,7 +91,13 @@ package org.puremvc.as3.multicore.interfaces
91
91
* @return whether a Mediator is registered with the given <code >mediatorName</code >.
92
92
*/
93
93
function hasMediator ( mediatorName :String ) : Boolean ;
94
-
94
+
95
+ /**
96
+ * Remove an IView instance
97
+ *
98
+ * @param multitonKey of IView instance to remove
99
+ */
100
+ function removeView ( key :String ):void
95
101
}
96
102
97
103
}
Original file line number Diff line number Diff line change @@ -307,6 +307,21 @@ package org.puremvc.as3.multicore.patterns.facade
307
307
multitonKey = key;
308
308
}
309
309
310
+ /**
311
+ * Remove a Core
312
+ *
313
+ * @param multitonKey of the Core to remove
314
+ */
315
+ public function removeCore ( key :String ) : void
316
+ {
317
+ // remove the model, view, controller
318
+ // and facade instances for this key
319
+ model. removeModel( key );
320
+ view . removeView( key );
321
+ controller. removeController( key );
322
+ delete instanceMap[ key ];
323
+ }
324
+
310
325
// References to Model, View and Controller
311
326
protected var controller : IController;
312
327
protected var model : IModel;
@@ -319,7 +334,7 @@ package org.puremvc.as3.multicore.patterns.facade
319
334
protected static var instanceMap : Array = new Array ();
320
335
321
336
// Message Constants
322
- protected const MULTITON_MSG : String = "Facade instance for this Multiton key already constructed!" ;
337
+ protected const MULTITON_MSG : String = "Facade instance for this Multiton key already constructed!" ;
323
338
324
339
}
325
340
}
You can’t perform that action at this time.
0 commit comments