I'll add that in practice I do the same thing as Doug and Ezra. I put a
check in my Application.cfc onRequestStart() for the
reloadKey/reloadPassword pair and if a match is found I recreate the
application-scope factory. Later in the request when the front controller
index.cfm runs and finds the same reload pair, it will have a fresh instance
of the application-scope factory ready to use as the parent factory for the
new framework instance.

One aspect of my approach that I find ugly is that I have to define the
reloadKey and reloadPassword values in two different places: once in the
framework's ColdSpring.xml and again in my Application.cfc. This is a bit of
a "chicken and egg" problem so I doubt there is an elegant solution for it.

Cheers,

-- Dennis

On Wed, Mar 24, 2010 at 2:20 PM, Ezra Parker <[email protected]> wrote:

> Although I am intrigued by Dennis' comment (this would certainly be a
> very nice ColdSpring enhancement), this approach is not available to
> you at the present time, so the solution for now is to implement a
> parent bean factory as Doug suggested. As he mentioned, the key here
> is to reload the parent BF when the MG reloadKey/reloadPassword pair
> is passed on the URL.
>
> To explain a little further as to why this is necessary, the issue is
> that the CS remote proxies will be keyed to a particular bean factory
> name (in the case of the supplied configuration, "beanFactory"), so
> the bean factory used for the proxies will be stored in the
> application scope using that name (e.g., application.beanFactory), and
> CS will create this bean factory if it does not exist. Therefore,
> reloading MG, and thereby the MG bean factory, will not trigger
> regeneration of the proxies.
>
> HTH,
>
> --
> Ezra
>
>
> On Wed, Mar 24, 2010 at 9:33 AM, Dennis Clark <[email protected]> wrote:
> > What you want to do is not supported at this time. It requires a
> > RemoteFactoryBean implementation that knows how to use
> > ModelGlue.Util.ModelGlueFrameworkLocator to find MG's bean factory.
> > I've looked into this last year (along with some other enhancements to
> > RemoteFactoryBean) but since I didn't have a pressing need for it myself
> I
> > didn't get to writing an implementation.
> > If anyone here is interested in helping me out with such an
> implementation,
> > I could use some volunteers to provide test code (remote beans and
> > corresponding MG test harnesses).
> > Cheers,
> > -- Dennis
> > On Wed, Mar 24, 2010 at 9:19 AM, Sir Rawlins
> > <[email protected]> wrote:
> >>
> >> Hello Guys,
> >>
> >> I'm trying to configure a remote proxy in ColdSpring within an MG
> >> application. The bean definition looks like so:
> >>
> >>    <bean id="remoteOrderService"
> >> class="coldspring.aop.framework.RemoteFactoryBean" lazy-
> >> init="false">
> >>        <property name="target">
> >>            <ref bean="orderService" />
> >>        </property>
> >>        <property name="serviceName">
> >>            <value>OrderService</value>
> >>        </property>
> >>        <property name="relativePath">
> >>            <value>/api</value>
> >>        </property>
> >>        <property name="remoteMethodNames">
> >>            <value>createOrder</value>
> >>        </property>
> >>        <property name="beanFactoryName">
> >>            <value>beanFactory</value>
> >>        </property>
> >>    </bean>
> >>
> >> Now,  it appears that the issue with this is that the target service
> >> object is cached in the application scope outside of the model glue
> >> bean factory, so when I make a change to the code on the CFC and
> >> reinit the MG application the changes are not propagated to my remote
> >> proxies and I have to restart the server every time *rolls eyes*
> >>
> >> Can anyone explain how I can configure this remote proxy to work with
> >> the same bean factory as model glue?
> >>
> >> Thanks,
> >>
> >> Rob
> >>
> >> --
> >> Model-Glue Sites:
> >> Home Page: http://www.model-glue.com
> >> Documentation: http://docs.model-glue.com
> >> Bug Tracker: http://bugs.model-glue.com
> >> Blog: http://www.model-glue.com/blog
> >>
> >> You received this message because you are subscribed to the Google
> >> Groups "model-glue" group.
> >> To post to this group, send email to [email protected]
> >> To unsubscribe from this group, send email to
> >> [email protected]<model-glue%[email protected]>
> >> For more options, visit this group at
> >> http://groups.google.com/group/model-glue?hl=en
> >>
> >> To unsubscribe from this group, send email to
> >> model-glue+unsubscribegooglegroups.com or reply to this email with the
> words
> >> "REMOVE ME" as the subject.
> >
> > --
> > Model-Glue Sites:
> > Home Page: http://www.model-glue.com
> > Documentation: http://docs.model-glue.com
> > Bug Tracker: http://bugs.model-glue.com
> > Blog: http://www.model-glue.com/blog
> >
> > You received this message because you are subscribed to the Google
> > Groups "model-glue" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<model-glue%[email protected]>
> > For more options, visit this group at
> > http://groups.google.com/group/model-glue?hl=en
> >
> > To unsubscribe from this group, send email to
> > model-glue+unsubscribegooglegroups.com or reply to this email with the
> words
> > "REMOVE ME" as the subject.
> >
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>
> To unsubscribe from this group, send email to model-glue+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

To unsubscribe from this group, send email to 
model-glue+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to