Created
November 29, 2010 07:18
-
-
Save destroytoday/719684 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.destroytoday.example | |
{ | |
public class CaptureFollowerSnapshotCommand extends CompositeSignalCommand | |
{ | |
[Inject] | |
public var user:UserVO; | |
public function CaptureFollowerSnapshotCommand() | |
{ | |
} | |
override public function execute():void | |
{ | |
addCommand(GetFollowerIDListCommand); | |
addCommand(StoreFollowerIDListCommand); | |
addCommand(PopulateEmptyFollowersCommand); | |
addCommand(StoreFollowerSnapshotCommand); | |
super.execute(); | |
} | |
// override the sub-command instantiation method if you need to attach payloads | |
override protected function instantiateCommand(commandClass:Class, | |
payloadClassList:Array = null, | |
payloadValueList:Array = null):ISignalCommand | |
{ | |
switch (commandClass) | |
{ | |
// pass on composite's payload | |
case GetFollowerIDListCommand: | |
payloadClassList = [UserVO]; | |
payloadValueList = user; | |
break; | |
// create payload on the spot | |
case StoreFollowerSnapshotCommand: | |
payloadClassList = [Date]; | |
payloadValueList = new Date(); | |
break; | |
} | |
super.instantiateCommand(commandClass, payloadClassList, payloadValueList); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment