I have another question about Flash Remoting support. :) It's not a
big deal, since Flash doesn't actually use the framework, and my
proxies were created with no problems, but where exactly does the
remote proxy "live"? Maybe I'm not understanding the
create/destroyRemoteProxy() methods, but I thought createRemoteProxy()
would have CS manage the singleton, meaning that once called,
isConstructed() would return true (unless CS was reloaded.) However,
after I create it, the isConstructed() method only returns true for
the life of the request, afterwards it returns false. I tried looking
through the code but couldn't figure it out.

I have a method in my controllers called ToggleRemoteService() that
looks like this:

<cffunction name="ToggleRemoteService" access="public"
returnType="void" output="false" hint="I start or stop the Remote
Service">
        <cfargument name="event" type="ModelGlue.Core.Event" required="true" />
        <cfset var remoteServiceFactory =
getModelGlue().getConfigBean("&remoteAssetService") />
        <cfset var message = "Remote Asset Service " />
        <cfif arguments.event.argumentExists("restart")>
                <cfif arguments.event.getArgument("restart") is true>
                        <cfif remoteServiceFactory.isConstructed()>
                                <cfset 
remoteServiceFactory.destroyRemoteProxy() />
                        </cfif>
                        <cfset remoteServiceFactory.createRemoteProxy() />
                        <cfset message = message & "restarted." />
                </cfif>
        <cfelse>
                <cfif remoteServiceFactory.isConstructed()>
                        <cfset remoteServiceFactory.destroyRemoteProxy() />
                        <cfset message = message & "destroyed." />
                <cfelse>
                        <cfset remoteServiceFactory.createRemoteProxy() />
                        <cfset message = message & "created." />
                </cfif>
        </cfif>
        <cfset arguments.event.setValue("message",message) />
</cffunction>

And a status method:
<cffunction name="GetRemoteServiceStatus" access="public"
returnType="void" output="false" hint="I return the status of the
remote service">
        <cfargument name="event" type="ModelGlue.Core.Event" required="true" />
        <cfset var remoteServiceFactory =
getModelGlue().getConfigBean("&remoteAssetService") />
        <cfset 
arguments.event.setValue("assetServiceStatus",remoteServiceFactory.isConstructed())
/>
</cffunction>

This is called manually (for testing and for a status page, so you can
"restart" it for whatever reason) and, like I said, everything seems
to be working but I was just wondering about why isConstructed() would
return false once createRemoteProxy() was called? Am I just completely
missing something obvious here? :)

Reply via email to