This file contains 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.adams.scrum.dao | |
{ | |
import com.adams.scrum.controller.ServiceController; | |
import com.adams.scrum.models.processor.IVOProcessor; | |
import com.adams.scrum.models.vo.IValueObject; | |
import com.adams.scrum.models.vo.SignalVO; | |
import com.adams.scrum.service.NativeMessenger; | |
import com.adams.scrum.utils.Action; | |
import com.adams.scrum.utils.Description; | |
This file contains 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
<Swiz:customProcessors> | |
<processors:MediateSignalProcessor id="signalProcessor" | |
signalPackages="com.adams.scrum.signals" | |
strictArgumentTypes="true"/> | |
</Swiz:customProcessors> | |
<Swiz:beanProviders> | |
<swiz:BeanProvider> | |
<!-- Service Begin--> |
This file contains 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
Custom processor <processors:MediateSignalProcessor/> is used, | |
to get use of AS3Signals being listened by Metadata using [MediateSignal(type="SignalClass")] | |
<service:NativeMessenger/> is to use push messages either to produce or consume. | |
<signals:AbstractSignal/> the signal dispatched for any kind of server Request, | |
this same signal is dispatched again and again with use of queued array and | |
a Queue mechanism of <response:SignalSequence/> | |
<signals:ResultSignal/> this signal is dispatched after any server response is received, |
This file contains 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
public class AbstractDAO extends CRUDObject{ | |
[Inject] | |
public var messenger:NativeMessenger; | |
public function AbstractDAO(destn:String,process:IVOProcessor =null) | |
{ | |
destination = destn; | |
processor = process; | |
} |
This file contains 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
override public function processVO(vo:IValueObject):void | |
{ | |
var task:Tasks = vo as Tasks; | |
task.personObject = | |
GetVOUtil.getVOObject(task.personFk,personDAO.collection.items,'personId',Persons); | |
} |
This file contains 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
private function resultHandler( rpcevt:ResultEvent, token:Object = null ):void { | |
var resultObj:Object = rpcevt.result; | |
var outCollection:ICollection = | |
updateCollection(serviceSignal.currentCollection, serviceSignal.currentSignal,resultObj); | |
if(serviceSignal.currentProcessor) processVO(serviceSignal.currentProcessor,outCollection); | |
resultSignal.dispatch(rpcevt.result, serviceSignal.currentSignal); | |
signalSeq.onSignalDone(); | |
} | |
private function processVO(process:IVOProcessor, collection:ICollection):void{ |
This file contains 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
[Inject] | |
public var delegate:AbstractResult; | |
public function invoke(action:String):void{ | |
remoteService.destination = destination; | |
} | |
public function create( vo:IValueObject ):AsyncToken { | |
invoke(Action.CREATE); | |
delegate.token = remoteService.create(vo); | |
return delegate.token; |
This file contains 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
AbstractDAO is extended from CRUDObject, whenever an AbstractSignal is dispatched. | |
This DAO is responsible for performing the Server Request initiation. | |
if(obj.destination == this.destination) makes sure the DAO Object required | |
and invokes the required function. | |
The invoke functions were kept in CRUDObject |
This file contains 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
[Inject] | |
public var delegate:AbstractResult; | |
The CRUDObject is responsible for assigning VOProcessor, Collection, ServerObject | |
and also assigning the AbstractResult as delegate to manage the server responses. |
This file contains 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
private function resultHandler( rpcevt:ResultEvent, token:Object = null ):void { | |
var resultObj:Object = rpcevt.result; | |
//line 1 | |
var outCollection:ICollection = | |
updateCollection(serviceSignal.currentCollection, serviceSignal.currentSignal,resultObj); | |
//line 2 | |
if(serviceSignal.currentProcessor) processVO(serviceSignal.currentProcessor,outCollection); | |
//line 3 | |
resultSignal.dispatch(rpcevt.result, serviceSignal.currentSignal); | |
//line 4 |
OlderNewer