Я пытаюсь написать простой многоядерный helloword PureMVC. Я получаю сообщение об ошибке: multitonKey для этого уведомителя еще не инициализирован!
at org.puremvc.as3.multicore.patterns.observer::Notifier/get фасад () [C: \ Documents and Settings \ Owner.CapricornOne \ Мои документы \ Мои рабочие пространства \ PureMVC \ PureMVC_AS3_MultiCore \ src \ org \ puremvc \ as3 \ многоядерный \ шаблоны \ наблюдателя \ Notifier.as: 89]
в com.jacksutest.view :: ApplicationMediator () [C: \ myworkspace \ MyPureMVC \ src \ com \ jacksutest \ view \ ApplicationMediator.as: 15]
Вот основной mxml:
public static const APP_NAME : String = "MyPureMVC";
private var facade : ApplicationFacade = ApplicationFacade.getInstance(APP_NAME);
public function init() : void
{
facade.startup(this);
}
...
Это ApplicationFacade.
Открытый класс ApplicationFacade расширяет Фасад, реализует IFacade
{
public static const STARTUP: String = "Запуск";
public static const VERIFY_WORD: String = "VerifyWord";
public function ApplicationFacade(key:String)
{
super(key);
}
public static function removeInstance(key:String):void
{
if( null != instanceMap )
{
if( null != instanceMap[key] )
{
delete instanceMap[key];
}
}
}
/**
* Singleton ApplicationFacade Factory Method
*/
public static function getInstance(key:String):ApplicationFacade
{
if ( null == instanceMap[key] )
{
instanceMap[key] = new ApplicationFacade(key);
}
return instanceMap[key] as ApplicationFacade;
}
/**
* Register Commands with the Controller
*/
override protected function initializeController():void
{
super.initializeController();
registerCommand(STARTUP, StartupCommand);
registerCommand(VERIFY_WORD, VerifyWordCommand);
}
public function startup(app : MyPureMVC):void
{
trace("In facade startup");
sendNotification(STARTUP, app);
}
public function verifyWord(wordDTO : WordDTO) : void
{
sendNotification(VERIFY_WORD, wordDTO);
}
}
}
Это команда запуска
public class StartupCommand extends MacroCommand
{
public function StartupCommand()
{
trace("Startup command created");
addSubCommand(ModelPrepCommand);
addSubCommand(ViewPrepCommand);
}
}
Это ViewPrepCommand
public class ViewPrepCommand extends SimpleCommand
{
override public function execute( note : INotification ) : void
{
var app : MyPureMVC = note.getBody() as MyPureMVC;
facade.registerMediator(new ApplicationMediator(app));
}
}
А это ApplicationMediator:
public class ApplicationMediator extends Mediator implements IMediator
{
public static const NAME : String = "MyPureMVCApplicationMediator";
public function ApplicationMediator(mainApp : MyPureMVC)
{
facade.registerMediator(new WordFormMediator(mainApp.theWordForm));
}
Ошибка происходит при фасаде.registerMediator.