Page 1 of 1

Plugin Manager for smartfox

Posted: 19 Jul 2010, 09:57
by yaswanth
Hi,

I am planning to develop a plugin manager for my smartfox extension.
In brief, I would want to implement a functionality that is independent of the extensions but would get executed before and after handleEvent() and handleInternalEvent.
like

Code: Select all

public function preHandleEvent(command c, ...other args);
public function postHandleEvent(command c, ...other args);

public function preHandleInternalEvent(command c, ...other args);
public function postHandleInternalEvent(command c, ...other args);
Is this possible?

I can do something like

Code: Select all


public function handleEvent(....)
{
    pluginManager.preHandleEvent() 
     /*
      * App logic
      */
    pluginManager.postHandleEvent()
}

public function handleInternalEvent(....)
{
    pluginManager.preHandleInternalEvent() 
     /*
      * App logic
      */
    pluginManager.postHandleInternalEvent()
}
But I don't want to do that. I have looked at registerForEvents() but no doc of any sort is available.

Lapo, can you help?

Regards,
Yaswanth

Posted: 21 Jul 2010, 19:21
by Lapo
No I am sorry, this is not possible.

Catching events

Posted: 22 Jul 2010, 07:04
by yaswanth
Thanks Lapo for a quick short reply :-)

Is there a way I catch the events that go to other extensions?

Posted: 22 Jul 2010, 07:34
by Lapo
No. Each extension listens for the events in its own scope.