Thanks for pointing me in the right direction. Your function still
produces an exception when it tries to cast a DataService as a
MessageAgent.
However, using your example, I simply made a new function that returns
a DataService and it works as expected.
public function getDataService ( serviceId : String ) : DataService
{
if ( this[ serviceId ] == undefined )
throw new Error( "No DataService found for service name " +
serviceId );
return this[ serviceId ];
}
--- In [email protected], "JesterXL" <[EMAIL PROTECTED]> wrote:
>
> Add this function to Cairngorm's ServiceLocator and it'll work:
>
> public function getMessageAgent ( serviceId : String ) :
> mx.messenging.MessageAgent
> {
> if ( this[ serviceId ] == undefined )
> throw new Error( "No MessageAgent found for service name
" +
> serviceId );
>
> return this[ serviceId ];
> }
>
> ----- Original Message -----
> From: "Mike_Robinson_98" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, July 11, 2006 2:16 PM
> Subject: [flexcoders] Cairngorm ServiceLocator and FDS
>
>
> Is it possible to define a <mx:DataService> in the ServiceLocator or
> is ServiceLocator useful only for <mx:RemoteObject> and
> <mx:WebService>? In the examples I have seen you retrieve a service
> from the ServiceLocator with something like this:
>
> ServiceLocator.getInstance().getService("ordersService");
>
> However, the getService() method returns an AbstractService which only
> WebService and RemoteObject extend.
>
> Is there some other mechanism to be able to use a DataService within
> the ServiceLocator? The getInvokerService method also does not look
> like it is useful for this purpose.
>
> Thanks,
> Mike
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/