topleft topright

Welcome, Guest. Please login or register.
May 24, 2013, 12:05:26 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.

Pages: [1]
Print
Author Topic: Bug(?) in a Multicore version  (Read 1574 times)
sysaux
Newbie
*
Posts: 4


View Profile
« on: February 17, 2009, 03:50:50 AM »

Hi all!

I'm new to programming in multicore PureMVC, and i had this run-time error

Code:
Error: multitonKey for this Notifier not yet initialized!
at org.puremvc.as3.multicore.patterns.observer::Notifier/get facade()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:89]
at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:59]
at kz.kazinfosystems.tdb.controller::AppStartupCommand/initializeMacroCommand()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\kz\kazinfosystems\tdb\controller\AppStartupCommand.as:11]
at org.puremvc.as3.multicore.patterns.command::MacroCommand()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\command\MacroCommand.as:58]
at kz.kazinfosystems.tdb.controller::AppStartupCommand()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\kz\kazinfosystems\tdb\controller\AppStartupCommand.as:9]
at org.puremvc.as3.multicore.core::Controller/executeCommand()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\core\Controller.as:115]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
at org.puremvc.as3.multicore.core::View/notifyObservers()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\core\View.as:127]
at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
at kz.kazinfosystems.tdb::ApplicationFacade/startup()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\kz\kazinfosystems\tdb\ApplicationFacade.as:31]
at app/handleCreationComplete()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\app.mxml:19]
at app/___app_Application1_creationComplete()[E:\Data\Work\Projects\workspaces\flex\tdb-modular\src\app.mxml:3]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]

when i wrote in AppStartupCommand

Code:
... AppStartupCommand extends Macrocommand{
override protected function initializeMacroCommand():void{
    addSubCommand(RegisterMediatorCommand);
    sendNotification(ApplicationFacade.STARTED);
    }
}

I get error when I tried to send Notification after executing of some simpleCommands.

Where is a problem?

P.S.:Sorry for my bad English
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2790



View Profile WWW
« Reply #1 on: February 18, 2009, 06:25:36 AM »

In MultiCore you cannot send notifications until after your command (or mediator or proxy) is constructed. The earliest you can call is initializeNotifier, but generally the best practice is to wait until onRegister is called and do any facade manipulation or sending of notifications that need to happen there.

In MultiCore, the INotifiers don't get their reference to ther facade until after they've been constructed. But its best in Standard and MultiCore to defer any notes or facade calls til onRegister. So that the actor doesn't start any 'conversations' it isn't prepared to participate in because it isn't registered yet.

-=Cliff>
Logged
sysaux
Newbie
*
Posts: 4


View Profile
« Reply #2 on: February 18, 2009, 08:55:55 AM »

I understood this by experiment))) and now i write my "sendNotofocation..." code on
actor's "onRegister" method.

But anyway - thanks, Cliff! I had some doubt in my solution...
Logged
Pages: [1]
Print
Jump to:  



Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2007, Simple Machines LLC
Copyright © 2006-2008 Futurescale, Inc.