Skip to content
Browse files

Examples update to mvcExpres V2 RC3

  • Loading branch information...
1 parent b9bdf8f commit 9dd5cdb646814bede7f5f14b71b95edfc6b45792 @MindScriptAct committed Dec 28, 2013
Showing with 2,567 additions and 357 deletions.
  1. +3 −3 libSrc/mvcexpress/MvcExpress.as
  2. +46 −21 libSrc/mvcexpress/core/CommandMap.as
  3. +2 −2 libSrc/mvcexpress/core/ExtensionManager.as
  4. +42 −16 libSrc/mvcexpress/core/MediatorMap.as
  5. +10 −24 libSrc/mvcexpress/core/ModuleManager.as
  6. +370 −108 libSrc/mvcexpress/core/ProxyMap.as
  7. +48 −0 libSrc/mvcexpress/core/ProxyMapForMediator.as
  8. +2 −2 libSrc/mvcexpress/core/inject/InjectRuleVO.as
  9. +4 −1 libSrc/mvcexpress/core/inject/PendingInject.as
  10. +7 −1 libSrc/mvcexpress/core/lazy/LazyProxyVO.as
  11. +0 −1 libSrc/mvcexpress/core/messenger/HandlerVO.as
  12. +57 −22 libSrc/mvcexpress/core/messenger/Messenger.as
  13. +1 −1 libSrc/mvcexpress/core/namespace/pureLegsCore.as
  14. +1 −1 libSrc/mvcexpress/core/traceObjects/proxyMap/TraceProxyMap_injectPending.as
  15. +2 −0 libSrc/mvcexpress/extensions/combo/scopedLive/core/CommandMapScopedLive.as
  16. +2 −0 libSrc/mvcexpress/extensions/combo/scopedLive/core/ProxyMapScopedLive.as
  17. +2 −1 libSrc/mvcexpress/extensions/combo/scopedLive/modules/ModuleScopedLive.as
  18. +2 −0 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/CommandScopedLive.as
  19. +3 −1 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/MediatorScopedLive.as
  20. +2 −0 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/PooledCommandScopedLive.as
  21. +2 −0 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/ProxyScopedLive.as
  22. +2 −0 libSrc/mvcexpress/extensions/live/core/CommandMapLive.as
  23. +4 −4 libSrc/mvcexpress/extensions/live/core/MediatorMapLive.as
  24. +18 −10 libSrc/mvcexpress/extensions/live/core/ProcessMapLive.as
  25. +2 −0 libSrc/mvcexpress/extensions/live/core/ProxyMapLive.as
  26. +2 −1 libSrc/mvcexpress/extensions/live/core/inject/InjectRuleTaskVO.as
  27. +28 −15 libSrc/mvcexpress/extensions/live/engine/Process.as
  28. +2 −0 libSrc/mvcexpress/extensions/live/engine/ProcessTimerVO.as
  29. +26 −12 libSrc/mvcexpress/extensions/live/engine/Task.as
  30. +6 −6 libSrc/mvcexpress/extensions/live/modules/ModuleLive.as
  31. +7 −8 libSrc/mvcexpress/extensions/live/mvc/CommandLive.as
  32. +10 −9 libSrc/mvcexpress/extensions/live/mvc/MediatorLive.as
  33. +2 −0 libSrc/mvcexpress/extensions/live/mvc/PooledCommandLive.as
  34. +5 −6 libSrc/mvcexpress/extensions/live/mvc/ProxyLive.as
  35. +2 −1 libSrc/mvcexpress/extensions/live/taskTests/TaskTestVO.as
  36. +1 −0 libSrc/mvcexpress/extensions/live/taskTests/TestRuleVO.as
  37. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/TraceProcess_sendMessage.as
  38. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_addFirstTask.as
  39. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_addHandler.as
  40. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_addTask.as
  41. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_addTaskAfter.as
  42. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_disableTask.as
  43. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_enableTask.as
  44. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_removeAllTasks.as
  45. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/process/TraceProcess_removeTask.as
  46. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/processMap/TraceProcessMap_provide.as
  47. +1 −0 libSrc/mvcexpress/extensions/live/traceObjects/processMap/TraceProcessMap_unprovide.as
  48. +2 −0 libSrc/mvcexpress/extensions/scoped/core/CommandMapScoped.as
  49. +7 −6 libSrc/mvcexpress/extensions/scoped/core/ProxyMapScoped.as
  50. +18 −5 libSrc/mvcexpress/extensions/scoped/core/ScopeManager.as
  51. +1 −1 libSrc/mvcexpress/extensions/scoped/core/inject/InjectRuleScopedVO.as
  52. +1 −1 ...core/traceObjects/command → extensions/scoped/core/traceObjects}/TraceCommand_sendScopeMessage.as
  53. +1 −1 ...re/traceObjects/mediator → extensions/scoped/core/traceObjects}/TraceMediator_sendScopeMessage.as
  54. +1 −1 ...raceObjects/moduleBase → extensions/scoped/core/traceObjects}/TraceModuleBase_sendScopeMessage.as
  55. +1 −1 ...eObjects/moduleManager → extensions/scoped/core/traceObjects}/TraceModuleManager_registerScope.as
  56. +1 −1 ...bjects/moduleManager → extensions/scoped/core/traceObjects}/TraceModuleManager_unregisterScope.as
  57. +1 −1 ...ress/{core/traceObjects/proxyMap → extensions/scoped/core/traceObjects}/TraceProxyMap_scopeMap.as
  58. +1 −1 ...ss/{core/traceObjects/proxyMap → extensions/scoped/core/traceObjects}/TraceProxyMap_scopeUnmap.as
  59. +2 −2 ...traceObjects/proxyMap → extensions/scoped/core/traceObjects}/TraceProxyMap_scopedInjectPending.as
  60. +1 −1 ...ss/{core/traceObjects/proxy → extensions/scoped/core/traceObjects}/TraceProxy_sendScopeMessage.as
  61. +3 −1 libSrc/mvcexpress/extensions/scoped/modules/ModuleScoped.as
  62. +3 −1 libSrc/mvcexpress/extensions/scoped/mvc/CommandScoped.as
  63. +3 −1 libSrc/mvcexpress/extensions/scoped/mvc/MediatorScoped.as
  64. +3 −1 libSrc/mvcexpress/extensions/scoped/mvc/PooledCommandScoped.as
  65. +3 −1 libSrc/mvcexpress/extensions/scoped/mvc/ProxyScoped.as
  66. +2 −1 libSrc/mvcexpress/extensions/unpuremvc/core/UnpureCommandMap.as
  67. +1 −0 libSrc/mvcexpress/extensions/unpuremvc/core/messenger/UnpureMessenger.as
  68. +3 −0 libSrc/mvcexpress/extensions/unpuremvc/patterns/facade/UnpureFacade.as
  69. +2 −0 libSrc/mvcexpress/extensions/unpuremvc/patterns/mediator/UnpureMediator.as
  70. +126 −0 libSrc/mvcexpress/extensions/workers/core/CommandMapWorker.as
  71. +673 −0 libSrc/mvcexpress/extensions/workers/core/WorkerManager.as
  72. +107 −0 libSrc/mvcexpress/extensions/workers/core/messenger/WorkerMessenger.as
  73. +32 −0 libSrc/mvcexpress/extensions/workers/core/traceObjects/command/TraceCommand_sendWorkerMessage.as
  74. +32 −0 libSrc/mvcexpress/extensions/workers/core/traceObjects/mediator/TraceMediator_sendWorkerMessage.as
  75. +32 −0 ...c/mvcexpress/extensions/workers/core/traceObjects/moduleBase/TraceModuleBase_sendWorkerMessage.as
  76. +32 −0 libSrc/mvcexpress/extensions/workers/core/traceObjects/proxy/TraceProxy_sendWorkerMessage.as
  77. +83 −0 libSrc/mvcexpress/extensions/workers/data/ClassAliasRegistry.as
  78. +66 −0 libSrc/mvcexpress/extensions/workers/display/WorkerSprite.as
  79. +157 −0 libSrc/mvcexpress/extensions/workers/modules/ModuleWorker.as
  80. +130 −0 libSrc/mvcexpress/extensions/workers/mvc/CommandWorker.as
  81. +91 −0 libSrc/mvcexpress/extensions/workers/mvc/MediatorWorker.as
  82. +59 −0 libSrc/mvcexpress/extensions/workers/mvc/PooledCommandWorker.as
  83. +61 −0 libSrc/mvcexpress/extensions/workers/mvc/ProxyWorker.as
  84. +23 −10 libSrc/mvcexpress/modules/ModuleCore.as
  85. +4 −1 libSrc/mvcexpress/mvc/Command.as
  86. +38 −23 libSrc/mvcexpress/mvc/Mediator.as
  87. +4 −2 libSrc/mvcexpress/mvc/Proxy.as
  88. +2 −2 libSrc/mvcexpress/utils/checkClassStringConstants.as
  89. BIN libs/mvcExpress_v2_0_rc1-logger_v1_2.swc
  90. BIN libs/mvcExpress_v2_0_rc3-logger_v1_3.swc
  91. +8 −4 mvcExpress-examples.as3proj
  92. +4 −4 mvcExpress-helloWorld/src/helloWorld/Main.as
  93. +2 −1 mvcExpress-helloWorld/src/helloWorld/controller/setup/SetupModelCommand.as
  94. +3 −4 mvcExpress-modular/src/modularProject/modularSample/ModularSample.as
  95. +1 −1 mvcExpress-ticTacToe/src/ticTacToe/controller/setup/SetupModelCommand.as
View
6 libSrc/mvcexpress/MvcExpress.as
@@ -15,14 +15,14 @@ public class MvcExpress {
public static const WEBSITE_URL:String = "http://mvcExpress.org";
/** Framework name */
- public static const NAME:String = "mvcExpress 2 RC1";
+ public static const NAME:String = "mvcExpress 2 RC3";
/** Current framework major version */
public static const MAJOR_VERSION:uint = 2;
/** Current framework minor version */
public static const MINOR_VERSION:uint = 0;
/** Current framework revision version */
- public static const REVISION:uint = 0;
+ public static const REVISION:uint = 3;
/** Current framework version */
public static const VERSION:String = "v" + MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION;
@@ -46,7 +46,7 @@ public class MvcExpress {
* If dependency is mapped during this waiting time - framework will find missing dependencies and resolve them.
* If in this time dependencies will not be resolved - error will be thrown.
*/
- public static var pendingInjectsTimeOut:int = 0;
+ public static var pendingInjectsTimeOut:uint = 0;
/**
* Sets a debug function that will get framework activity constants as String's.
View
67 libSrc/mvcexpress/core/CommandMap.as
@@ -36,7 +36,7 @@ public class CommandMap {
// used internally to handles application mediators.
protected var mediatorMap:MediatorMap;
- // collection of class arrays, stored by message type. Then message with this type is sent, all mapped classes are executed.
+ // commands class stored by message type. Then message with this type is sent, mapped class is executed.
protected var classRegistry:Dictionary = new Dictionary(); //* of Class by String */
// holds pooled command objects, stared by command class.
@@ -89,7 +89,7 @@ public class CommandMap {
}
}
- if (classRegistry[type]) {
+ if (type in classRegistry) {
if (!canMapOver) {
throw Error("Only one command class can be mapped to one message type. You are trying to map " + commandClass + " to " + type + ", but it is already mapped to " + classRegistry[type]);
}
@@ -212,16 +212,20 @@ public class CommandMap {
* @return true if command pool is created.
*/
public function isCommandPooled(commandClass:Class):Boolean {
- return (commandPools[commandClass] != null);
+ return (commandClass in commandPools && commandPools[commandClass].length);
}
/**
- * Clears pool created for specified command.
+ * Clears all command pools, or specific one.
* (if commands are not pooled - function fails silently.)
- * @param commandClass Command class to clear
+ * @param commandClass Optional Command class to clear specific command pool
*/
- public function clearCommandPool(commandClass:Class):void {
- delete commandPools[commandClass];
+ public function clearCommandPool(commandClass:Class = null):void {
+ if (commandClass) {
+ delete commandPools[commandClass];
+ } else {
+ commandPools = new Dictionary();
+ }
}
@@ -237,7 +241,7 @@ public class CommandMap {
*/
public function isMapped(type:String, commandClass:Class = null):Boolean {
var retVal:Boolean; // = false;
- if (classRegistry[type]) {
+ if (type in classRegistry) {
if (commandClass) {
retVal = (classRegistry[type] == commandClass);
} else {
@@ -249,15 +253,27 @@ public class CommandMap {
/**
* Returns text of all command classes that are mapped to constants. (for debugging)
+ * @param verbose if set to true, will return readable string, false will return pairs of message type and command class definition separated by '>', all pairs are separated by ';'.
* @return Text with all mapped commands.
*/
- public function listMappings():String {
+ public function listMappings(verbose:Boolean = true):String {
var retVal:String = "";
- retVal = "===================== CommandMap Mappings: =====================\n";
+ if (verbose) {
+ retVal = "===================== CommandMap Mappings: =====================\n";
+ }
for (var key:String in classRegistry) {
- retVal += "SENDING MESSAGE:'" + key + "'\t> EXECUTES > " + classRegistry[key] + "\n";
+ if (verbose) {
+ retVal += "SENDING MESSAGE:'" + key + "'\t> EXECUTES > " + classRegistry[key] + "\n";
+ } else {
+ if (retVal) {
+ retVal += ";"
+ }
+ retVal += key + ">" + getQualifiedClassName(classRegistry[key]);
+ }
+ }
+ if (verbose) {
+ retVal += "================================================================\n";
}
- retVal += "================================================================\n";
return retVal;
}
@@ -317,7 +333,10 @@ public class CommandMap {
commandPools = null;
}
- /** function to be called by messenger on needed message type sent */
+ /**
+ * function to be called by messenger on needed message type sent
+ * @private
+ */
pureLegsCore function handleCommandExecute(messageType:String, params:Object):void {
use namespace pureLegsCore;
@@ -327,11 +346,6 @@ public class CommandMap {
commandClass = classRegistry[messageType];
if (commandClass) {
- // debug this action
- CONFIG::debug {
- MvcExpress.debug(new TraceCommandMap_handleCommandExecute(moduleName, command, commandClass, messageType, params));
- }
-
//////////////////////////////////////////////
////// INLINE FUNCTION runCommand() START
@@ -359,6 +373,11 @@ public class CommandMap {
command.messageType = messageType;
+ // debug this action
+ CONFIG::debug {
+ MvcExpress.debug(new TraceCommandMap_handleCommandExecute(moduleName, command, commandClass, messageType, params));
+ }
+
if (command is PooledCommand) {
// init pool if needed.
if (!pooledCommands) {
@@ -395,13 +414,13 @@ public class CommandMap {
pureLegsCore function validateCommandClass(commandClass:Class):void {
// skip already validated classes.
- if (validatedCommands[commandClass] != true) {
+ if (!(commandClass in validatedCommands)) {
if (!checkClassSuperclass(commandClass, "mvcexpress.mvc::Command")) {
throw Error("commandClass:" + commandClass + " you are trying to map MUST extend: 'mvcexpress.mvc::Command' class.");
}
- if (!commandClassParamTypes[commandClass]) {
+ if (!(commandClass in commandClassParamTypes)) {
var classDescription:XML = describeType(commandClass);
var hasExecute:Boolean; // = false;
@@ -435,6 +454,7 @@ public class CommandMap {
}
}
+ /** @private */
CONFIG::debug
protected function validateCommandParams(commandClass:Class, params:Object):void {
use namespace pureLegsCore;
@@ -449,7 +469,10 @@ public class CommandMap {
}
}
- // used for debugging
+ /**
+ * used for debugging
+ * @private
+ */
pureLegsCore function getMessageCommand(messageType:String):Class {
return classRegistry[messageType];
}
@@ -459,9 +482,11 @@ public class CommandMap {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
pureLegsCore var SUPPORTED_EXTENSIONS:Dictionary;
+ /** @private */
CONFIG::debug
pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
SUPPORTED_EXTENSIONS = supportedExtensions;
View
4 libSrc/mvcexpress/core/ExtensionManager.as
@@ -35,7 +35,7 @@ public class ExtensionManager {
*/
CONFIG::debug
public static function getExtensionIdByName(extensionName:String):int {
- if (ExtensionManager.EXTENSION_NAMES[extensionName] == null) {
+ if (!(extensionName in ExtensionManager.EXTENSION_NAMES)) {
ExtensionManager.EXTENSION_NAMES[extensionName] = ++ExtensionManager.extensionCount;
}
return ExtensionManager.EXTENSION_NAMES[extensionName];
@@ -68,7 +68,7 @@ public class ExtensionManager {
use namespace pureLegsCore;
var retVal:int = 0;
- if (!extensionIdRegistry[frameworkClass]) {
+ if (!(frameworkClass in extensionIdRegistry)) {
var currentClass:Class = frameworkClass;
while (retVal == 0 && currentClass != Object) {
retVal = currentClass["extension_id"];
View
58 libSrc/mvcexpress/core/MediatorMap.as
@@ -31,6 +31,9 @@ public class MediatorMap implements IMediatorMap {
// used internally to work with proxies.
protected var proxyMap:ProxyMap;
+ // used internally to work with proxies.
+ protected var viewProxyMap:ProxyMapForMediator;
+
// used internally for communications
protected var messenger:Messenger;
@@ -48,6 +51,7 @@ public class MediatorMap implements IMediatorMap {
moduleName = $moduleName;
messenger = $messenger;
proxyMap = $proxyMap;
+ viewProxyMap = new ProxyMapForMediator(proxyMap);
}
//----------------------------------
@@ -70,7 +74,7 @@ public class MediatorMap implements IMediatorMap {
MvcExpress.debug(new TraceMediatorMap_map(moduleName, viewClass, mediatorClass, injectClass));
// check if mediatorClass is subclass of Mediator class
- if (!checkClassSuperclass(mediatorClass, "mvcexpress.mvc::Mediator")) {
+ if (!checkClassSuperclass(mediatorClass, "mvcexpress.mvc::Mediator", true)) {
throw Error("mediatorClass:" + mediatorClass + " you are trying to map is not extended from 'mvcexpress.mvc::Mediator' class.");
}
@@ -82,17 +86,17 @@ public class MediatorMap implements IMediatorMap {
}
// check if mapping is not created already
- if (mediatorMappingRegistry[viewClass] != null) {
- if (mediatorMappingRegistry[viewClass][mediatorClass] != null) {
+ if ((viewClass in mediatorMappingRegistry)) {
+ if (mediatorClass in mediatorMappingRegistry[viewClass]) {
throw Error("Mediator class:" + mediatorClass + " is already mapped with this view class:" + viewClass + "");
}
}
// map mediatorClass to viewClass
- if (mediatorMappingRegistry[viewClass] == null) {
+ if (!(viewClass in mediatorMappingRegistry)) {
mediatorMappingRegistry[viewClass] = new Dictionary();
}
- if (mediatorMapOrderRegistry[viewClass] == null) {
+ if (!(viewClass in mediatorMapOrderRegistry)) {
mediatorMapOrderRegistry[viewClass] = new Vector.<Class>();
}
@@ -133,7 +137,7 @@ public class MediatorMap implements IMediatorMap {
MvcExpress.debug(new TraceMediatorMap_unmap(moduleName, viewClass, mediatorClass));
}
// clear mapping
- if (mediatorMappingRegistry[viewClass] != null) {
+ if (viewClass in mediatorMappingRegistry) {
if (mediatorClass) {
var mediators:Vector.<Class> = mediatorMapOrderRegistry[viewClass];
@@ -171,7 +175,7 @@ public class MediatorMap implements IMediatorMap {
public function mediate(viewObject:Object):void {
use namespace pureLegsCore;
- if (mediatorRegistry[viewObject]) {
+ if (viewObject in mediatorRegistry) {
throw Error("This view object is already mediated by " + mediatorRegistry[viewObject]);
}
@@ -232,12 +236,12 @@ public class MediatorMap implements IMediatorMap {
mediator.moduleName = moduleName;
mediator.messenger = messenger;
- mediator.proxyMap = proxyMap;
+ mediator.proxyMap = viewProxyMap;
mediator.mediatorMap = this;
retVal = proxyMap.injectStuff(mediator, mediatorClass, viewObject, injectClass);
- if (mediatorRegistry[viewObject] == null) {
+ if (!(viewObject in mediatorRegistry)) {
mediatorRegistry[viewObject] = new Vector.<Mediator>;
}
mediatorRegistry[viewObject].push(mediator);
@@ -257,7 +261,7 @@ public class MediatorMap implements IMediatorMap {
public function mediateWith(viewObject:Object, mediatorClass:Class, injectClass:Class = null):void {
use namespace pureLegsCore;
- if (mediatorRegistry[viewObject]) {
+ if (viewObject in mediatorRegistry) {
var mediators:Vector.<Mediator> = mediatorRegistry[viewObject];
for (var i:int = 0; i < mediators.length; i++) {
if ((mediators[i] as Object).constructor == mediatorClass) {
@@ -268,7 +272,7 @@ public class MediatorMap implements IMediatorMap {
CONFIG::debug {
// check if mediatorClass is subclass of Mediator class
- if (!checkClassSuperclass(mediatorClass, "mvcexpress.mvc::Mediator")) {
+ if (!checkClassSuperclass(mediatorClass, "mvcexpress.mvc::Mediator", true)) {
throw Error("mediatorClass:" + mediatorClass + " you are trying to use is not extended from 'mvcexpress.mvc::Mediator' class.");
}
@@ -361,7 +365,7 @@ public class MediatorMap implements IMediatorMap {
*/
public function isMapped(viewClass:Class, mediatorClass:Class = null):Boolean {
var retVal:Boolean; // = false;
- if (mediatorMappingRegistry[viewClass] != null) {
+ if (viewClass in mediatorMappingRegistry) {
if (mediatorClass) {
if (mediatorMappingRegistry[viewClass][mediatorClass] != null) {
retVal = true;
@@ -407,15 +411,35 @@ public class MediatorMap implements IMediatorMap {
/**
* Returns String of all view classes that are mapped to mediator classes. (for debugging)
+ * @param verbose if set to true, will return readable string, false will return pairs of view class definition and mediator class list(separated by ',') definition separated by '>', all pairs are separated by ';'.
* @return Text with all mapped mediators.
*/
- public function listMappings():String {
+ public function listMappings(verbose:Boolean = true):String {
var retVal:String = "";
- retVal = "==================== MediatorMap Mappings: =====================\n";
+ if (verbose) {
+ retVal = "==================== MediatorMap Mappings: =====================\n";
+ }
for (var viewClass:Object in mediatorMappingRegistry) {
- retVal += "VIEW:'" + viewClass + "'\t> MEDIATED BY > " + mediatorMapOrderRegistry[viewClass] + "\n";
+ if (verbose) {
+ retVal += "VIEW:'" + viewClass + "'\t> MEDIATED BY > " + mediatorMapOrderRegistry[viewClass] + "\n";
+ } else {
+ if (retVal) {
+ retVal += ";";
+ }
+ retVal += getQualifiedClassName(viewClass) + ">";
+ var mediators:Vector.<Class> = mediatorMapOrderRegistry[viewClass];
+ var mediatorCount:int = mediators.length;
+ for (var i:int = 0; i < mediatorCount; i++) {
+ if (i > 0) {
+ retVal += ",";
+ }
+ retVal += getQualifiedClassName(mediators[i]);
+ }
+ }
+ }
+ if (verbose) {
+ retVal += "================================================================\n";
}
- retVal += "================================================================\n";
return retVal;
}
@@ -446,9 +470,11 @@ public class MediatorMap implements IMediatorMap {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
pureLegsCore var SUPPORTED_EXTENSIONS:Dictionary;
+ /** @private */
CONFIG::debug
pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
SUPPORTED_EXTENSIONS = supportedExtensions;
View
34 libSrc/mvcexpress/core/ModuleManager.as
@@ -40,6 +40,8 @@ public class ModuleManager {
* @param moduleName name for module
* @param moduleCore module object for given name
* @return returns name (same as provided or generated new one) of the module.
+ *
+ * @private
*/
static pureLegsCore function registerModule(moduleName:String, moduleCore:ModuleCore):String {
@@ -66,7 +68,7 @@ public class ModuleManager {
MvcExpress.debug(new TraceModuleManager_createModule(moduleName));
}
- if (moduleRegistry[moduleName] == null) {
+ if (!(moduleName in moduleRegistry)) {
_moduleId++;
//
if (!moduleName) {
@@ -142,7 +144,7 @@ public class ModuleManager {
CONFIG::debug {
MvcExpress.debug(new TraceModuleManager_disposeModule(moduleName));
}
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
delete moduleRegistry[moduleName];
} else {
throw Error("Module with moduleName:" + moduleName + " doesn't exist.");
@@ -184,7 +186,7 @@ public class ModuleManager {
* @return
*/
static public function listMappedMessages(moduleName:String):String {
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
return (moduleRegistry[moduleName] as ModuleCore).listMappedMessages();
} else {
return "Module with name :" + moduleName + " is not found.";
@@ -197,7 +199,7 @@ public class ModuleManager {
* @return
*/
static public function listMappedMediators(moduleName:String):String {
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
return (moduleRegistry[moduleName] as ModuleCore).listMappedMediators();
} else {
return "Module with name :" + moduleName + " is not found.";
@@ -210,7 +212,7 @@ public class ModuleManager {
* @return
*/
static public function listMappedProxies(moduleName:String):String {
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
return (moduleRegistry[moduleName] as ModuleCore).listMappedProxies();
} else {
return "Module with name :" + moduleName + " is not found.";
@@ -223,42 +225,26 @@ public class ModuleManager {
* @return
*/
static public function listMappedCommands(moduleName:String):String {
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
return (moduleRegistry[moduleName] as ModuleCore).listMappedCommands();
} else {
return "Module with name :" + moduleName + " is not found.";
}
}
/**
- * lists message commands.
- * @param moduleName module name to debug
- * @param messageType message type
- * @return
- */
- static public function listModuleMessageCommands(moduleName:String, messageType:String):String {
- use namespace pureLegsCore;
-
- if (moduleRegistry[moduleName]) {
- return ((moduleRegistry[moduleName] as ModuleCore).listMessageCommands(messageType) as String);
- } else {
- return "Module with name :" + moduleName + " is not found.";
- }
- }
-
- /**
* EXPERIMENTAL
* Invokes custom module function.
* Experimental function for mvcLogger and extension development.
- * @private
*
* @param moduleName Name of module.
* @param functionName name of the function
* @param params optional function params
* @return returns object.
+ * @private
*/
static pureLegsCore function invokeModuleFunction(moduleName:String, functionName:String, params:Array = null):Object {
- if (moduleRegistry[moduleName]) {
+ if (moduleName in moduleRegistry) {
try {
var callFunct:Function = moduleRegistry[moduleName][functionName]
if (params) {
View
478 libSrc/mvcexpress/core/ProxyMap.as
@@ -60,6 +60,12 @@ public class ProxyMap implements IProxyMap {
/** Dictionary with constants of inject names, used with constName, and constScope. */
protected var classConstRegistry:Dictionary = new Dictionary();
+
+ // TODO : move, document.
+ protected var mediatorInjectObjectRegistry:Dictionary = new Dictionary(); //* of Proxy by String */
+ protected var mediatorInjectIdRegistry:Dictionary = new Dictionary(); //* of String by String */
+
+
/** CONSTRUCTOR */
public function ProxyMap($moduleName:String, $messenger:Messenger) {
moduleName = $moduleName;
@@ -74,11 +80,12 @@ public class ProxyMap implements IProxyMap {
/**
* Maps proxy object to injectClass and name.
* @param proxyObject Proxy instance to use for injection.
- * @param injectClass Optional class to use for injection, if null proxyObject class is used. It is helpful if you want to map proxy interface or subclass.
* @param name Optional name if you need more then one proxy instance of same class.
+ * @param injectClass Optional class to use for injection, if null proxyObject class is used. It is helpful if you want to map proxy interface or subclass.
+ * @param mediatorInjectClass Optional class to use for injection in mediators, if null - injectClass class is used. If injectClass is null - proxyObject class is used.
* @return returns inject id. (for debugging reasons only.)
*/
- public function map(proxyObject:Proxy, injectClass:Class = null, name:String = ""):String {
+ public function map(proxyObject:Proxy, name:String = null, injectClass:Class = null, mediatorInjectClass:Class = null):String {
use namespace pureLegsCore;
// get proxy class
@@ -89,6 +96,10 @@ public class ProxyMap implements IProxyMap {
injectClass = proxyClass;
}
+ if (name == null) {
+ name = "";
+ }
+
// get inject id
var className:String = qualifiedClassNameRegistry[injectClass];
if (!className) {
@@ -120,17 +131,37 @@ public class ProxyMap implements IProxyMap {
var isAllInjected:Boolean = initProxy(proxyObject, proxyClass, injectId);
}
- // check if there is no pending injection with this key.
- if (pendingInjectionsRegistry[injectId]) {
- injectPendingStuff(injectId, proxyObject);
- }
-
- if (!injectObjectRegistry[injectId]) {
+ if (!(injectId in injectObjectRegistry)) {
// store proxy injection for other classes.
injectObjectRegistry[injectId] = proxyObject;
} else {
throw Error("Proxy object class is already mapped.[injectClass:" + className + " name:" + name + "]");
}
+ if (mediatorInjectClass != null) {
+ className = qualifiedClassNameRegistry[mediatorInjectClass];
+ if (!className) {
+ className = getQualifiedClassName(mediatorInjectClass);
+ qualifiedClassNameRegistry[mediatorInjectClass] = className;
+ }
+
+ var mediatorInjectId:String = className + name;
+ if (!(mediatorInjectId in mediatorInjectObjectRegistry)) {
+ mediatorInjectObjectRegistry[mediatorInjectId] = proxyObject;
+ mediatorInjectIdRegistry[injectId] = mediatorInjectId;
+
+ // handle case of pending injection.
+ if (mediatorInjectId in pendingInjectionsRegistry) {
+ injectPendingStuff(mediatorInjectId, proxyObject);
+ }
+ } else {
+ throw Error("Proxy object class is already mapped for inject to mediators.[injectClass:" + className + " name:" + name + "]");
+ }
+ }
+
+ // check if there is no pending injection with this key.
+ if (injectId in pendingInjectionsRegistry) {
+ injectPendingStuff(injectId, proxyObject);
+ }
// register proxy is all injections are done.
if (isAllInjected) {
@@ -147,13 +178,17 @@ public class ProxyMap implements IProxyMap {
* @param name name added to class, that was previously mapped for injection
* @return returns inject id. (for debugging reasons only.)
*/
- public function unmap(injectClass:Class, name:String = ""):String {
+ public function unmap(injectClass:Class, name:String = null):String {
use namespace pureLegsCore;
// debug this action
CONFIG::debug {
MvcExpress.debug(new TraceProxyMap_unmap(moduleName, injectClass, name));
}
+
+ if (name == null) {
+ name = "";
+ }
// get inject id
var className:String = qualifiedClassNameRegistry[injectClass];
if (!className) {
@@ -163,7 +198,7 @@ public class ProxyMap implements IProxyMap {
var injectId:String = className + name;
// remove proxy if it exists.
- if (injectObjectRegistry[injectId]) {
+ if (injectId in injectObjectRegistry) {
var proxy:Proxy = injectObjectRegistry[injectId] as Proxy;
// handle dependencies..
@@ -176,6 +211,18 @@ public class ProxyMap implements IProxyMap {
delete injectObjectRegistry[injectId];
}
+ // clear any injection mapping into mediators.
+ if (injectId in mediatorInjectIdRegistry) {
+ delete mediatorInjectObjectRegistry[mediatorInjectIdRegistry[injectId]];
+ delete mediatorInjectIdRegistry[injectId];
+ }
+
+ // clear lazy mappings
+ if (injectId in lazyProxyRegistry) {
+ lazyProxyRegistry[injectId].dispose();
+ delete lazyProxyRegistry[injectId];
+ }
+
return injectId;
}
@@ -187,17 +234,21 @@ public class ProxyMap implements IProxyMap {
/**
* Stores lazy proxy data to be instantiated on first use. Proxy will be instantiated and mapped then requested for the first time.
* @param proxyClass Class to construct proxy.
- * @param injectClass Optional class to use for injection, if null proxyObject class is used. It is helpful if you want to map proxy interface or subclass.
* @param name Optional name if you need more then one proxy instance of same class.
- * @param proxyParams parameters to pass to proxy constructor. (up to 10 parameters)
+ * @param injectClass Optional class to use for injection, if null proxyObject class is used. It is helpful if you want to map proxy interface or subclass.
+ * @param proxyConstructorParams parameters to pass to proxy constructor. (up to 10 parameters)
* @return returns inject id. (for debugging reasons only.)
*/
- public function lazyMap(proxyClass:Class, injectClass:Class = null, name:String = "", proxyParams:Array = null):String {
+ public function lazyMap(proxyClass:Class, name:String = null, injectClass:Class = null, mediatorInjectClass:Class = null, proxyConstructorParams:Array = null):String {
if (!injectClass) {
injectClass = proxyClass;
}
+ if (name == null) {
+ name = "";
+ }
+
// get inject id
var className:String = qualifiedClassNameRegistry[injectClass];
if (!className) {
@@ -220,8 +271,8 @@ public class ProxyMap implements IProxyMap {
if (!checkClassSuperclass(proxyClass, "mvcexpress.mvc::Proxy")) {
throw Error("proxyClass:" + proxyClass + " you are trying to lazy map is not extended from 'mvcexpress.mvc::Proxy' class.");
}
- if (proxyParams && proxyParams.length > 10) {
- throw Error("Only up to 10 Proxy parameters are supported. Please refactor some into parameter container objects. [injectClass:" + className + " name:" + name + " proxyParams:" + proxyParams + "]");
+ if (proxyConstructorParams && proxyConstructorParams.length > 10) {
+ throw Error("Only up to 10 Proxy parameters are supported. Please refactor some into parameter container objects. [injectClass:" + className + " name:" + name + " proxyParams:" + proxyConstructorParams + "]");
}
// var check if extension is supported by this module.
@@ -230,17 +281,38 @@ public class ProxyMap implements IProxyMap {
throw Error("This extension is not supported by current module. You need " + ExtensionManager.getExtensionName(proxyClass) + " extension enabled to use " + proxyClass + " proxy.");
}
- MvcExpress.debug(new TraceProxyMap_lazyMap(moduleName, proxyClass, injectClass, name, proxyParams));
+ MvcExpress.debug(new TraceProxyMap_lazyMap(moduleName, proxyClass, injectClass, name, proxyConstructorParams));
}
var lazyInject:LazyProxyVO = new LazyProxyVO();
lazyInject.proxyClass = proxyClass;
lazyInject.injectClass = injectClass;
+ lazyInject.injectId = injectId;
lazyInject.name = name;
- lazyInject.proxyParams = proxyParams;
+ lazyInject.proxyParams = proxyConstructorParams;
lazyProxyRegistry[injectId] = lazyInject;
+ if (mediatorInjectClass) {
+ // get inject id
+ var mediatorInjectClassName:String = qualifiedClassNameRegistry[mediatorInjectClass];
+ if (!className) {
+ mediatorInjectClassName = getQualifiedClassName(mediatorInjectClass);
+ qualifiedClassNameRegistry[mediatorInjectClass] = mediatorInjectClassName;
+ }
+ var mediatorInjectId:String = mediatorInjectClassName + name;
+
+ lazyInject.mediatorInjectClass = mediatorInjectClass;
+ lazyInject.mediatorInjectId = mediatorInjectId;
+
+ lazyProxyRegistry[mediatorInjectId] = lazyInject;
+ }
+
+ // check if this class is not pending.
+ if (injectId in pendingInjectionsRegistry) {
+ initLazyProxy(injectId);
+ }
+
return injectId;
}
@@ -258,18 +330,28 @@ public class ProxyMap implements IProxyMap {
* @param proxyClass class of proxy, proxy object is mapped to.
* @param name Optional name if you need more then one proxy instance of same class.
*/
- public function getProxy(proxyClass:Class, name:String = ""):Proxy {
+ public function getProxy(proxyClass:Class, name:String = null):Proxy {
+ if (name == null) {
+ name = "";
+ }
var className:String = qualifiedClassNameRegistry[proxyClass];
if (!className) {
className = getQualifiedClassName(proxyClass);
qualifiedClassNameRegistry[proxyClass] = className;
}
- var classAndName:String = className + name;
- if (classAndName in injectObjectRegistry) {
- return injectObjectRegistry[classAndName];
- } else {
- throw Error("Proxy object is not mapped. [injectClass:" + className + " name:" + name + "]");
+ var injectId:String = className + name;
+
+ // try to get proxy from standard registry.
+ var proxyObject:Proxy = injectObjectRegistry[injectId] as Proxy;
+ if (!proxyObject) {
+ // check lazy proxies.
+ if (injectId in lazyProxyRegistry) {
+ proxyObject = initLazyProxy(injectId);
+ } else {
+ throw Error("Proxy object is not mapped. [injectClass:" + className + " name:" + name + "]");
+ }
}
+ return proxyObject;
}
@@ -286,34 +368,62 @@ public class ProxyMap implements IProxyMap {
* @param proxyObject Proxy instance, to check if it's mapped.
* @return true if proxy is mapped
*/
- public function isMapped(injectClass:Class, name:String = "", proxyObject:Proxy = null):Boolean {
+ public function isMapped(injectClass:Class, name:String = null, proxyObject:Proxy = null):Boolean {
var retVal:Boolean; // = false;
+ if (name == null) {
+ name = "";
+ }
var className:String = qualifiedClassNameRegistry[injectClass];
if (!className) {
className = getQualifiedClassName(injectClass);
qualifiedClassNameRegistry[injectClass] = className;
}
- if (injectObjectRegistry[className + name]) {
+
+ var injectId:String = className + name;
+
+ if (injectId in injectObjectRegistry) {
if (proxyObject) {
- retVal = (injectObjectRegistry[className + name] == proxyObject);
+ retVal = (injectObjectRegistry[injectId] == proxyObject);
} else {
retVal = true;
}
+ } else {
+ // if proxy object is not found, try lazy mapping.
+ if (proxyObject == null) {
+ if (injectId in lazyProxyRegistry) {
+ var lazyProxyData:LazyProxyVO = lazyProxyRegistry[injectId];
+ if (lazyProxyData.injectId == injectId) {
+ retVal = true;
+ }
+ }
+ }
}
return retVal;
}
/**
* Returns text of all mapped proxy objects, and keys they are mapped to. (for debugging)
+ * @param verbose if set to true, will return readable string, false will return pairs of object class name and key it is mapped to separated by '>', all pairs are separated by ';'.
* @return Text string with all mapped proxies.
*/
- public function listMappings():String {
+ public function listMappings(verbose:Boolean = true):String {
var retVal:String = "";
- retVal = "====================== ProxyMap Mappings: ======================\n";
+ if (verbose) {
+ retVal = "====================== ProxyMap Mappings: ======================\n";
+ }
for (var key:Object in injectObjectRegistry) {
- retVal += "PROXY OBJECT:'" + injectObjectRegistry[key] + "'\t\t\t(MAPPED TO:" + key + ")\n";
+ if (verbose) {
+ retVal += "PROXY OBJECT:'" + injectObjectRegistry[key] + "'\t\t\t(MAPPED TO:" + key + ")\n";
+ } else {
+ if (retVal) {
+ retVal += ";";
+ }
+ retVal += getQualifiedClassName(injectObjectRegistry[key]).split("::")[1] + ">" + key;
+ }
+ }
+ if (verbose) {
+ retVal += "================================================================\n";
}
- retVal += "================================================================\n";
return retVal;
}
@@ -322,6 +432,7 @@ public class ProxyMap implements IProxyMap {
// internal stuff
//----------------------------------
+ /** @private */
pureLegsCore function setCommandMap(value:CommandMap):void {
commandMap = value;
}
@@ -340,6 +451,131 @@ public class ProxyMap implements IProxyMap {
return injectStuff(proxyObject, proxyClass);
}
+ // init lazy proxy
+ private function initLazyProxy(injectId:String):Proxy {
+
+ var lazyProxyData:LazyProxyVO = lazyProxyRegistry[injectId];
+
+ // check if this lazy proxy mapnig has second lazy mapnig for mediator injcet.
+ if (lazyProxyData.mediatorInjectId == injectId) {
+ // this is lazy proxy mediator inject, clear lazy proxy mapping.
+ delete lazyProxyRegistry[lazyProxyData.injectId];
+ } else if (lazyProxyData.mediatorInjectId != null) { // check if this lazy proxy has mediator ID mapped.
+ // this is lazy proxy inject, with mediator inject also mapped, clear lazy proxy mediator inject mapping.
+ delete lazyProxyRegistry[lazyProxyData.mediatorInjectId];
+ }
+
+ delete lazyProxyRegistry[injectId];
+
+ var lazyProxy:Proxy;
+ if (lazyProxyData.proxyParams) {
+ var paramCount:int = lazyProxyData.proxyParams.length;
+ if (paramCount == 0) {
+ lazyProxy = new lazyProxyData.proxyClass();
+ } else if (paramCount == 1) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0]);
+ } else if (paramCount == 2) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1]);
+ } else if (paramCount == 3) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2]);
+ } else if (paramCount == 4) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3]);
+ } else if (paramCount == 5) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4]);
+ } else if (paramCount == 6) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5]);
+ } else if (paramCount == 7) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6]);
+ } else if (paramCount == 8) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7]);
+ } else if (paramCount == 9) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7], lazyProxyData.proxyParams[8]);
+ } else if (paramCount == 10) {
+ lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7], lazyProxyData.proxyParams[8], lazyProxyData.proxyParams[9]);
+ } else {
+ throw Error("Lazy proxing is not supported with that many parameters. Cut it douwn please. Thanks! [injectClass:" + lazyProxyData.injectClass + " ,name: " + lazyProxyData.name + "]");
+ }
+ } else {
+ lazyProxy = new lazyProxyData.proxyClass();
+ }
+ map(lazyProxy, lazyProxyData.name, lazyProxyData.injectClass, lazyProxyData.mediatorInjectClass);
+
+ return lazyProxy;
+ }
+
+ /**
+ * Function to get proxy from mediator.
+ * @param proxyClass
+ * @param name
+ * @private
+ * @return
+ */
+ pureLegsCore function mediatorGetProxy(proxyClass:Class, name:String = null):Proxy {
+ if (name == null) {
+ name = "";
+ }
+ var className:String = qualifiedClassNameRegistry[proxyClass];
+ if (!className) {
+ className = getQualifiedClassName(proxyClass);
+ qualifiedClassNameRegistry[proxyClass] = className;
+ }
+ var injectId:String = className + name;
+
+ // try to get proxy from mediator registry.
+ var proxyObject:Proxy = mediatorInjectObjectRegistry[injectId] as Proxy;
+ if (!proxyObject) {
+ // check lazy proxies.
+ if (injectId in lazyProxyRegistry) {
+ initLazyProxy(injectId);
+ // try to get mediator inject again.
+ proxyObject = mediatorInjectObjectRegistry[injectId];
+ }
+ }
+ // proxy is not found - throw error.
+ if (!proxyObject) {
+ proxyObject = injectObjectRegistry[injectId];
+ if (proxyObject) {
+ throw Error("You are trying to get proxy class:" + injectId + " from mediator, but mediators are not allowed to inject this proxy. To enable this: set mediatorInjectClass parameter then you map this proxy.");
+ } else {
+ throw Error("Proxy object is not mapped. [injectClass:" + className + " name:" + name + "]");
+ }
+ }
+ return proxyObject;
+ }
+
+ /**
+ * Function to check if proxy can be received from Mediator.
+ * @param proxyClass
+ * @param name
+ * @return
+ */
+ pureLegsCore function mediatorIsProxyMapped(proxyClass:Class, name:String = null):Boolean {
+ if (name == null) {
+ name = "";
+ }
+ var className:String = qualifiedClassNameRegistry[proxyClass];
+ if (!className) {
+ className = getQualifiedClassName(proxyClass);
+ qualifiedClassNameRegistry[proxyClass] = className;
+ }
+ var injectId:String = className + name;
+
+ var retVal:Boolean = (injectId in mediatorInjectObjectRegistry);
+
+ // if injection not found, try lazy mapping.
+ if (!retVal) {
+ if (injectId in lazyProxyRegistry) {
+ var lazyProxyData:LazyProxyVO = lazyProxyRegistry[injectId];
+ // check if this lazy proxy mapping maps mediator class.
+ if (lazyProxyData.mediatorInjectId == injectId) {
+ retVal = true;
+ }
+ }
+ }
+
+ return retVal;
+ }
+
/**
* Dispose of proxyMap. Remove all registered proxies and set all internals to null.
* @private
@@ -355,37 +591,47 @@ public class ProxyMap implements IProxyMap {
}
// set internals to null
injectObjectRegistry = null;
+
+ for (var pendingInjectObject:Object in pendingInjectionsRegistry) {
+ var pendingInjects:Vector.<PendingInject> = pendingInjectionsRegistry[pendingInjectObject];
+ for (var pi:int = 0; pi < pendingInjects.length; pi++) {
+ pendingInjects[pi].dispose();
+ }
+ }
pendingInjectionsRegistry = null;
lazyProxyRegistry = null;
classConstRegistry = null;
+ mediatorInjectObjectRegistry = null;
+ mediatorInjectIdRegistry = null;
+
commandMap = null;
messenger = null;
}
/**
* Finds inject points and injects dependencies.
- * tempValue and tempClass defines injection that will be done for current object only.
+ * mediatorObject and mediatorInjectClass defines injection that will be done for current object only.
* @private
*/
- pureLegsCore function injectStuff(object:Object, signatureClass:Class, tempValue:Object = null, tempClass:Class = null):Boolean {
+ pureLegsCore function injectStuff(object:Object, signatureClass:Class, mediatorObject:Object = null, mediatorInjectClass:Class = null):Boolean {
use namespace pureLegsCore;
var isAllInjected:Boolean = true;
// deal with temporal injection. (it is used only for this injection, for example - view object for mediator is used this way.)
- var tempClassName:String;
- if (tempValue) {
- if (tempClass) {
- tempClassName = qualifiedClassNameRegistry[tempClass];
- if (!tempClassName) {
- tempClassName = getQualifiedClassName(tempClass);
- qualifiedClassNameRegistry[tempClass] = tempClassName;
+ var mediatorInjectClassName:String;
+ if (mediatorObject) {
+ if (mediatorInjectClass) {
+ mediatorInjectClassName = qualifiedClassNameRegistry[mediatorInjectClass];
+ if (!mediatorInjectClassName) {
+ mediatorInjectClassName = getQualifiedClassName(mediatorInjectClass);
+ qualifiedClassNameRegistry[mediatorInjectClass] = mediatorInjectClassName;
}
- if (!injectObjectRegistry[tempClassName]) {
- injectObjectRegistry[tempClassName] = tempValue;
+ if (!(mediatorInjectClassName in mediatorInjectObjectRegistry)) {
+ mediatorInjectObjectRegistry[mediatorInjectClassName] = mediatorObject;
} else {
- throw Error("Temp object should not be mapped already... it was meant to be used by framework for mediator view object only.");
+ throw Error("Mediator object should not be mapped for injection... it was meant to be used by framework only.");
}
}
}
@@ -406,75 +652,70 @@ public class ProxyMap implements IProxyMap {
// injects all dependencies using rules.
var ruleCount:int = rules.length;
for (var i:int; i < ruleCount; i++) {
+
+ var injectObject:Object = null;
var rule:InjectRuleVO = rules[i];
- var injectClassAndName:String = rule.injectClassAndName;
- var injectObject:Object = injectObjectRegistry[injectClassAndName];
- if (injectObject) {
- object[rule.varName] = injectObject;
- // debug this action
- CONFIG::debug {
- MvcExpress.debug(new TraceProxyMap_injectStuff(moduleName, object, injectObject, rule));
+
+ var injectId:String = rule.injectId;
+
+ // check if we inject to mediator.
+ if (mediatorObject) {
+ injectObject = mediatorInjectObjectRegistry[injectId];
+ if (!injectObject) {
+ // if injection fails... test for lazy injections
+ if (injectId in lazyProxyRegistry) {
+ initLazyProxy(injectId);
+ injectObject = mediatorInjectObjectRegistry[injectId];
+ }
}
- } else {
- // if local injection fails... test for lazy injections
- if (injectClassAndName in lazyProxyRegistry) {
- var lazyProxyData:LazyProxyVO = lazyProxyRegistry[injectClassAndName];
- delete lazyProxyRegistry[injectClassAndName];
-
- var lazyProxy:Proxy;
-
- if (lazyProxyData.proxyParams) {
- var paramCount:int = lazyProxyData.proxyParams.length;
- if (paramCount == 0) {
- lazyProxy = new lazyProxyData.proxyClass();
- } else if (paramCount == 1) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0]);
- } else if (paramCount == 2) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1]);
- } else if (paramCount == 3) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2]);
- } else if (paramCount == 4) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3]);
- } else if (paramCount == 5) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4]);
- } else if (paramCount == 6) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5]);
- } else if (paramCount == 7) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6]);
- } else if (paramCount == 8) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7]);
- } else if (paramCount == 9) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7], lazyProxyData.proxyParams[8]);
- } else if (paramCount == 10) {
- lazyProxy = new lazyProxyData.proxyClass(lazyProxyData.proxyParams[0], lazyProxyData.proxyParams[1], lazyProxyData.proxyParams[2], lazyProxyData.proxyParams[3], lazyProxyData.proxyParams[4], lazyProxyData.proxyParams[5], lazyProxyData.proxyParams[6], lazyProxyData.proxyParams[7], lazyProxyData.proxyParams[8], lazyProxyData.proxyParams[9]);
+ // proxy is not found
+ if (!injectObject) {
+ // check if pending injection feature is enabled. (wait for injcetion if it is.)
+ if (MvcExpress.pendingInjectsTimeOut == 0) {
+ // throw error.
+ injectObject = injectObjectRegistry[injectId];
+ if (injectObject) {
+ throw Error("You are trying to inject class:" + injectId + " into " + object + ", but mediators are not allowed to inject this proxy. To enable this: set mediatorInjectClass parameter then you map this proxy.");
} else {
- throw Error("Lazy proxing is not supported with that many parameters. Cut it douwn please. Thanks! [injectClass:" + lazyProxyData.injectClass + " ,name: " + lazyProxyData.name + "]");
+ throw Error("Inject object is not found for class with id:" + injectId + "(needed in " + object + ")");
}
- } else {
- lazyProxy = new lazyProxyData.proxyClass();
}
- map(lazyProxy, lazyProxyData.injectClass, lazyProxyData.name);
-
- i--;
+ }
+ } else {
+ injectObject = injectObjectRegistry[injectId];
+ }
+ if (!injectObject) {
+ // if local injection fails... test for lazy injections
+ if (injectId in lazyProxyRegistry) {
+ injectObject = initLazyProxy(injectId);
} else {
// remember that not all injections exists
isAllInjected = false;
+ // if pending injection feature is enabled - wait for injection.
if (MvcExpress.pendingInjectsTimeOut && !(object is Command)) {
- //add injection to pending injections.
// debug this action
CONFIG::debug {
MvcExpress.debug(new TraceProxyMap_injectPending(moduleName, object, injectObject, rule));
}
//
- addPendingInjection(injectClassAndName, new PendingInject(injectClassAndName, object, signatureClass, MvcExpress.pendingInjectsTimeOut));
+ addPendingInjection(injectId, new PendingInject(injectId, object, signatureClass, MvcExpress.pendingInjectsTimeOut));
object.pendingInjections++;
} else {
- throw Error("Inject object is not found for class with id:" + injectClassAndName + "(needed in " + object + ")");
+ throw Error("Inject object is not found for class with id:" + injectId + "(needed in " + object + ")");
}
}
}
+
+ if (injectObject) {
+ object[rule.varName] = injectObject;
+ // debug this action
+ CONFIG::debug {
+ MvcExpress.debug(new TraceProxyMap_injectStuff(moduleName, object, injectObject, rule));
+ }
+ }
+
}
////// handle command pooling (register dependencies)
@@ -491,24 +732,25 @@ public class ProxyMap implements IProxyMap {
}
}
- // dispose temporal injection if it was used.
- if (tempClassName) {
- delete injectObjectRegistry[tempClassName];
+ // dispose mediator injection if it was used.
+ if (mediatorInjectClassName) {
+ delete mediatorInjectObjectRegistry[mediatorInjectClassName];
}
return isAllInjected;
}
+
/**
* Adds pending injection.
- * @param injectClassAndName
+ * @param injectId
* @param pendingInjection
* @private
*/
- pureLegsCore function addPendingInjection(injectClassAndName:String, pendingInjection:PendingInject):void {
- var pendingInjections:Vector.<PendingInject> = pendingInjectionsRegistry[injectClassAndName]
+ pureLegsCore function addPendingInjection(injectId:String, pendingInjection:PendingInject):void {
+ var pendingInjections:Vector.<PendingInject> = pendingInjectionsRegistry[injectId]
if (!pendingInjections) {
pendingInjections = new Vector.<PendingInject>();
- pendingInjectionsRegistry[injectClassAndName] = pendingInjections;
+ pendingInjectionsRegistry[injectId] = pendingInjections;
}
pendingInjections[pendingInjections.length] = pendingInjection;
}
@@ -517,21 +759,21 @@ public class ProxyMap implements IProxyMap {
* Handle all pending injections for specified key.
* @private
*/
- protected function injectPendingStuff(injectClassAndName:String, injectee:Object):void {
+ protected function injectPendingStuff(injectId:String, injectee:Object):void {
use namespace pureLegsCore;
- var pendingInjects:Vector.<PendingInject> = pendingInjectionsRegistry[injectClassAndName];
+ var pendingInjects:Vector.<PendingInject> = pendingInjectionsRegistry[injectId];
while (pendingInjects.length) {
//
var pendingInjection:PendingInject = pendingInjects.pop();
- pendingInjection.stopTimer();
// get rules. (by now rules for this class must be created.)
var rules:Vector.<InjectRuleVO> = classInjectRules[pendingInjection.signatureClass];
var pendingInject:Object = pendingInjection.pendingObject;
+ pendingInjection.dispose();
var ruleCount:int = rules.length;
for (var j:int = 0; j < ruleCount; j++) {
- if (rules[j].injectClassAndName == injectClassAndName) {
+ if (rules[j].injectId == injectId) {
// satisfy missing injection.
pendingInject[rules[j].varName] = injectee;
@@ -545,6 +787,14 @@ public class ProxyMap implements IProxyMap {
}
} else if (pendingInject is Mediator) {
var mediatorObject:Mediator = pendingInject as Mediator;
+ // check if injection is allowed in Mediator.
+
+ if (!(injectId in mediatorInjectObjectRegistry)) {
+ // undo injection..
+ pendingInject[rules[j].varName] = null;
+ // this injection is not allowed in mediator.
+ throw Error("You are trying to inject class:" + injectId + " into " + mediatorObject + ", but mediators are not allowed to inject this proxy. To enable this: set mediatorInjectClass parameter then you map this proxy.");
+ }
mediatorObject.pendingInjections--;
if (mediatorObject.pendingInjections == 0) {
mediatorObject.register();
@@ -555,7 +805,7 @@ public class ProxyMap implements IProxyMap {
}
}
//
- delete pendingInjectionsRegistry[injectClassAndName];
+ delete pendingInjectionsRegistry[injectId];
}
/**
@@ -601,7 +851,7 @@ public class ProxyMap implements IProxyMap {
}
var mapRule:InjectRuleVO = new InjectRuleVO();
mapRule.varName = varName;
- mapRule.injectClassAndName = injectClass + injectName;
+ mapRule.injectId = injectClass + injectName;
return mapRule;
}
@@ -620,6 +870,15 @@ public class ProxyMap implements IProxyMap {
}
try {
var constClass:Class = getDefinitionByName(className) as Class;
+ CONFIG::debug {
+ if (constClass == null) {
+ throw Error("Failed to get class definition by name for [Inject] constName parameter, for class definition:" + className);
+ }
+ var constNameValue:String = constClass[split[spliteIndex]];
+ if (constNameValue == null) {
+ throw Error("Failed to get constant value for [Inject] constName parameter, from class:" + constClass + ", with var name:" + split[spliteIndex]);
+ }
+ }
classConstRegistry[constName] = constClass[split[spliteIndex]];
if (!(constName in classConstRegistry)) {
throw Error("Failed to get constant out of class:" + constClass + " Check constant name: " + split[spliteIndex]);
@@ -632,18 +891,21 @@ public class ProxyMap implements IProxyMap {
}
// gets proxy by id directly.
- pureLegsCore function getProxyById(injectClassAndName:String):Proxy {
- return injectObjectRegistry[injectClassAndName];
+ /** @private */
+ pureLegsCore function getProxyById(injectId:String):Proxy {
+ return injectObjectRegistry[injectId];
}
- //----------------------------------
- // Extension checking: INTERNAL, DEBUG ONLY.
- //----------------------------------
+//----------------------------------
+// Extension checking: INTERNAL, DEBUG ONLY.
+//----------------------------------
+ /** @private */
CONFIG::debug
pureLegsCore var SUPPORTED_EXTENSIONS:Dictionary;
+ /** @private */
CONFIG::debug
pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
SUPPORTED_EXTENSIONS = supportedExtensions;
View
48 libSrc/mvcexpress/core/ProxyMapForMediator.as
@@ -0,0 +1,48 @@
+// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+package mvcexpress.core {
+import mvcexpress.core.namespace.pureLegsCore;
+import mvcexpress.mvc.Proxy;
+
+/**
+ * INTERNAL FRAMEWORK CLASS.
+ * ProxyMap wrapper for mediators.
+ * @author Raimundas Banevicius (http://mvcexpress.org/)
+ * @private
+ *
+ * @version 2.0.rc1
+ */
+public class ProxyMapForMediator {
+
+ private var proxyMap:ProxyMap;
+
+ // CONSTRUCTOR
+ public function ProxyMapForMediator(proxyMap:ProxyMap) {
+ this.proxyMap = proxyMap;
+ }
+
+ /**
+ * Get proxy. Only proxies that are mapped to be accessible for mediator con be received.
+ * @param proxyClass class of proxy, mapped with mediatorInjectClass parameter.
+ * @param name Optional name if you need more then one proxy instance of same class.
+ * @return
+ */
+ public function getProxy(proxyClass:Class, name:String = null):Proxy {
+ use namespace pureLegsCore;
+
+ return proxyMap.mediatorGetProxy(proxyClass, name);
+ }
+
+ /**
+ * Checks if mediator can get proxy, with given inject class and name.
+ * @param proxyClass class of proxy, mapped with mediatorInjectClass parameter.
+ * @param name Optional name if you need more then one proxy instance of same class.
+ * @return true if mediator can get proxy object.
+ */
+ public function isMapped(proxyClass:Class, name:String = null):Boolean {
+ use namespace pureLegsCore;
+
+ return proxyMap.mediatorIsProxyMapped(proxyClass, name);
+
+ }
+}
+}
View
4 libSrc/mvcexpress/core/inject/InjectRuleVO.as
@@ -15,11 +15,11 @@ public class InjectRuleVO {
public var varName:String;
/** FOR INTERNAL USE ONLY. Injection identifier, formed by class name and your custom inject name. */
- public var injectClassAndName:String;
+ public var injectId:String;
CONFIG::debug
public function toString():String {
- return "[InjectRuleVO varName=" + varName + " injectClassAndName=" + injectClassAndName + "]";
+ return "[InjectRuleVO varName=" + varName + " injectId=" + injectId + "]";
}
}
}
View
5 libSrc/mvcexpress/core/inject/PendingInject.as
@@ -29,7 +29,10 @@ public class PendingInject {
timerId = setTimeout(throwError, $pendingInjectTime);
}
- public function stopTimer():void {
+ public function dispose():void {
+ injectClassAndName = null;
+ pendingObject = null;
+ signatureClass = null;
clearTimeout(timerId);
}
View
8 libSrc/mvcexpress/core/lazy/LazyProxyVO.as
@@ -8,8 +8,14 @@ package mvcexpress.core.lazy {
public class LazyProxyVO {
public var proxyClass:Class;
- public var injectClass:Class;
public var name:String;
+
+ public var injectClass:Class;
+ public var injectId:String;
+
+ public var mediatorInjectClass:Class;
+ public var mediatorInjectId:String;
+
public var proxyParams:Array;
}
}
View
1 libSrc/mvcexpress/core/messenger/HandlerVO.as
@@ -18,7 +18,6 @@ public class HandlerVO {
public var isExecutable:Boolean;
/** FOR INTERNAL USE ONLY. Variable to store class there handler came from. (for debugging only) */
- CONFIG::debug
public var handlerClassName:String;
}
View
79 libSrc/mvcexpress/core/messenger/Messenger.as
@@ -1,6 +1,7 @@
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
package mvcexpress.core.messenger {
import flash.utils.Dictionary;
+import flash.utils.getQualifiedClassName;
import mvcexpress.MvcExpress;
import mvcexpress.core.CommandMap;
@@ -21,10 +22,12 @@ use namespace pureLegsCore;
*/
public class Messenger {
- // name of the module messenger is working for.
+ /** name of the module messenger is working for.
+ * @private */
pureLegsCore var moduleName:String;
- // defines if messenger can be instantiated.
+ /** defines if messenger can be instantiated.
+ * @private */
static pureLegsCore var allowInstantiation:Boolean; // = false;
// keeps ALL HandlerVO's in vectors by message type that they have to respond to.
@@ -78,9 +81,7 @@ public class Messenger {
}
if (!msgData) {
msgData = new HandlerVO();
- CONFIG::debug {
- msgData.handlerClassName = handlerClassName;
- }
+ msgData.handlerClassName = handlerClassName;
msgData.handler = handler;
messageList[messageList.length] = msgData;
handlerRegistry[type][handler] = msgData;
@@ -89,6 +90,18 @@ public class Messenger {
}
/**
+ * Checks if messanger has handler for this message type.
+ * @param type message type that handler had to react
+ * @param handler function called on sent message.
+ * @return true if messenger has specific handler for message type.
+ */
+ public function hasHandler(type:String, handler:Function):Boolean {
+ //return (handlerRegistry[type] && handlerRegistry[type][handler]);
+ return false;
+ }
+
+
+ /**
* Removes handler function that will be called then message of specified type is sent.
* - if handler is not found it fails silently.
* @param type message type that handler had to react
@@ -101,7 +114,7 @@ public class Messenger {
MvcExpress.debug(new TraceMessenger_removeHandler(moduleName, type, handler));
}
- if (handlerRegistry[type]) {
+ if (type in handlerRegistry) {
if (handlerRegistry[type][handler]) {
(handlerRegistry[type][handler] as HandlerVO).handler = null;
delete handlerRegistry[type][handler];
@@ -184,7 +197,7 @@ public class Messenger {
*/
public function isHandlerAdded(type:String, handler:Function):Boolean {
var retVal:Boolean = false;
- if (handlerRegistry[type]) {
+ if (type in handlerRegistry) {
if (handlerRegistry[type][handler]) {
retVal = true;
}
@@ -196,35 +209,55 @@ public class Messenger {
* List all message mappings.
* Intended to be used by ModuleCore.as
*/
- public function listMappings(commandMap:CommandMap):String {
+ public function listMappings(commandMap:CommandMap, verbose:Boolean = true):String {
use namespace pureLegsCore;
var retVal:String = "";
- retVal = "====================== Message Mappings: ======================\n";
- var warningText:String = "WARNING: If you want to see Classes that handles constants - you must run with CONFIG::debug compile variable set to 'true'.\n";
- CONFIG::debug {
- warningText = "";
- }
- if (warningText) {
- retVal += warningText;
+ if (verbose) {
+ retVal = "====================== Message Mappings: ======================\n";
+ var warningText:String = "WARNING: If you want to see Classes that handles constants - you must run with CONFIG::debug compile variable set to 'true'.\n";
+ CONFIG::debug {
+ warningText = "";
+ }
+ if (warningText) {
+ retVal += warningText;
+ }
}
for (var key:String in messageRegistry) {
var msgList:Vector.<HandlerVO> = messageRegistry[key];
var messageHandlers:String = "";
var msgCount:int = msgList.length;
for (var i:int = 0; i < msgCount; i++) {
var handlerVo:HandlerVO = msgList[i];
- if (handlerVo.isExecutable) {
- messageHandlers += "[EXECUTES:" + commandMap.getMessageCommand(key) + "], ";
- CONFIG::debug {
- messageHandlers += "[" + handlerVo.handlerClassName + "], ";
+ if (messageHandlers) {
+ messageHandlers += ",";
+ }
+ if (verbose) {
+ if (handlerVo.isExecutable) {
+ messageHandlers += commandMap.getMessageCommand(key);
+ } else {
+ messageHandlers += handlerVo.handlerClassName.split("::")[1];
+ }
+ } else {
+ if (handlerVo.isExecutable) {
+ messageHandlers += getQualifiedClassName(commandMap.getMessageCommand(key));
+ } else {
+ messageHandlers += handlerVo.handlerClassName;
}
}
}
-
- retVal += "SENDING MESSAGE:'" + key + "'\t> HANDLED BY: > " + messageHandlers + "\n";
+ if (verbose) {
+ retVal += "SENDING MESSAGE:'" + key + "'\t> HANDLED BY: > " + messageHandlers + "\n";
+ } else {
+ if (retVal) {
+ retVal += ";";
+ }
+ retVal += key + ">" + messageHandlers;
+ }
+ }
+ if (verbose) {
+ retVal += "================================================================";
}
- retVal += "================================================================";
return retVal;
}
@@ -240,9 +273,11 @@ public class Messenger {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
pureLegsCore var SUPPORTED_EXTENSIONS:Dictionary;
+ /** @private */
CONFIG::debug
pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
pureLegsCore::SUPPORTED_EXTENSIONS = supportedExtensions;
View
2 libSrc/mvcexpress/core/namespace/pureLegsCore.as
@@ -3,5 +3,5 @@ package mvcexpress.core.namespace {
// namespace for framework internal variables and functions.
// Not meant to be used from outside. (...unless you want to hack/break the framework.)
// name constructed using two AS3 frameworks that inspired mvcExpress framework - PUREmvc and robotLEGS, and used as codename for framework prototype in it's early stage.
-public namespace pureLegsCore = "http://mvcexpress.org/";
+public namespace pureLegsCore = "pureLegsCore-ns";
}
View
2 libSrc/mvcexpress/core/traceObjects/proxyMap/TraceProxyMap_injectPending.as
@@ -25,7 +25,7 @@ public class TraceProxyMap_injectPending extends TraceObj {
}
override public function toString():String {
- return "!!!!! " + MvcTraceActions.PROXYMAP_INJECTPENDING + " > for id:" + rule.injectClassAndName + "(needed in " + hostObject + ")" + " {" + moduleName + "}";
+ return "!!!!! " + MvcTraceActions.PROXYMAP_INJECTPENDING + " > for injectId:" + rule.injectId + "(needed in " + hostObject + ")" + " {" + moduleName + "}";
}
}
}
View
2 libSrc/mvcexpress/extensions/combo/scopedLive/core/CommandMapScopedLive.as
@@ -51,6 +51,7 @@ public class CommandMapScopedLive extends CommandMapScoped {
super.dispose();
}
+ /** @private */
pureLegsCore function setProcessMap(value:ProcessMapLive):void {
processMap = value;
}
@@ -59,6 +60,7 @@ public class CommandMapScopedLive extends CommandMapScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
override pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
super.setSupportedExtensions(supportedExtensions);
View
2 libSrc/mvcexpress/extensions/combo/scopedLive/core/ProxyMapScopedLive.as
@@ -34,6 +34,7 @@ public class ProxyMapScopedLive extends ProxyMapScoped {
// internal stuff
//----------------------------------
+ /** @private */
pureLegsCore function setProcessMap(value:ProcessMapLive):void {
processMap = value;
}
@@ -69,6 +70,7 @@ public class ProxyMapScopedLive extends ProxyMapScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
override pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
super.setSupportedExtensions(supportedExtensions);
View
3 libSrc/mvcexpress/extensions/combo/scopedLive/modules/ModuleScopedLive.as
@@ -27,7 +27,6 @@ public class ModuleScopedLive extends ModuleScoped {
/**
* CONSTRUCTOR
* @param moduleName module name that is used for referencing a module. (if not provided - unique name will be generated.)
- * @param autoInit if set to false framework is not initialized for this module. If you want to use framework features you will have to manually init() it first.
*/
public function ModuleScopedLive(moduleName:String = null, mediatorMapClass:Class = null, proxyMapClass:Class = null, commandMapClass:Class = null, messengerClass:Class = null) {
use namespace pureLegsCore
@@ -82,9 +81,11 @@ public class ModuleScopedLive extends ModuleScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
static pureLegsCore const EXTENSION_LIVE_ID:int = ExtensionManager.getExtensionIdByName(pureLegsCore::EXTENSION_LIVE_NAME);
+ /** @private */
CONFIG::debug
static pureLegsCore const EXTENSION_LIVE_NAME:String = "live";
View
2 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/CommandScopedLive.as
@@ -31,9 +31,11 @@ dynamic public class CommandScopedLive extends CommandScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_id:int = ModuleLive.EXTENSION_LIVE_ID;
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_name:String = ModuleLive.EXTENSION_LIVE_NAME
View
4 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/MediatorScopedLive.as
@@ -27,7 +27,7 @@ public class MediatorScopedLive extends MediatorScoped {
/** Used to provide stuff for processes. */
pureLegsCore var processMap:ProcessMapLive;
- /** all objects provided by this mediator storeb by name */
+ /** all objects provided by this mediator storeb by name */
private var provideRegistry:Dictionary = new Dictionary(); //* of Object by String*/
@@ -93,9 +93,11 @@ public class MediatorScopedLive extends MediatorScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_id:int = ModuleLive.EXTENSION_LIVE_ID;
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_name:String = ModuleLive.EXTENSION_LIVE_NAME
}
View
2 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/PooledCommandScopedLive.as
@@ -23,9 +23,11 @@ public class PooledCommandScopedLive extends PooledCommandScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_id:int = ModuleLive.pureLegsCore::EXTENSION_LIVE_ID;
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_name:String = ModuleLive.pureLegsCore::EXTENSION_LIVE_NAME
View
2 libSrc/mvcexpress/extensions/combo/scopedLive/mvc/ProxyScopedLive.as
@@ -93,9 +93,11 @@ public class ProxyScopedLive extends ProxyScoped {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_id:int = ModuleLive.pureLegsCore::EXTENSION_LIVE_ID;
+ /** @private */
CONFIG::debug
static pureLegsCore var extension_name:String = ModuleLive.pureLegsCore::EXTENSION_LIVE_NAME
}
View
2 libSrc/mvcexpress/extensions/live/core/CommandMapLive.as
@@ -49,6 +49,7 @@ public class CommandMapLive extends CommandMap {
super.dispose();
}
+ /** @private */
pureLegsCore function setProcessMap(value:ProcessMapLive):void {
processMap = value;
}
@@ -57,6 +58,7 @@ public class CommandMapLive extends CommandMap {
// Extension checking: INTERNAL, DEBUG ONLY.
//----------------------------------
+ /** @private */
CONFIG::debug
override pureLegsCore function setSupportedExtensions(supportedExtensions:Dictionary):void {
super.setSupportedExtensions(supportedExtensions);
View
8 libSrc/mvcexpress/extensions/live/core/MediatorMapLive.as
@@ -10,15 +10,14 @@ import mvcexpress.extensions.live.modules.ModuleLive;
import mvcexpress.extensions.live.mvc.MediatorLive;
import mvcexpress.mvc.Mediator;
+use namespace pureLegsCore;
+
/**
* Handles application mediators.
* @author Raimundas Banevicius (http://mvcexpress.org/)
*
* @version live.1.0.beta2
*/
-
-use namespace pureLegsCore;