I'm accessing application._appname for now... way easier:
<cfif structKeyExists(application, "appname")>
<cfloop array="#local.arrEvents#" index="local.evt">
<cfset
application.appname.getBean("modelGlue.cacheAdapter").purge("eventHandler.event.name.#param#")
/>
</cfloop>
</cfif>
Working well AFAICT.
Thanks!
On Monday, May 12, 2014 6:27:09 AM UTC-7, Dan Wilson - [email protected]
wrote:
>
> I'm not exactly sure how this would work. I think if you used a
> getter/setter Property style injection, it could would work. However, you'd
> need to ensure the parent factory wasn't trying to use this before the
> child factory created it.
>
> The Cache Adapter built it, is using the Model Glue scope to hold on to
> items. Thus, if you tried to access this inside of your Parent Bean Factory
> before the Model Glue scope was created (which would be a reasonable thing
> to try to do) it would fail pretty hard. Probably by adding your item to
> some mystery scope which gets blown away silently.
>
> You'd need to test this well.
>
> DW
>
> Brian G <javascript:>
> Friday, May 09, 2014 10:49 PM
>
> On Thursday, April 10, 2014 8:01:23 AM UTC-7, Dan Wilson -
> [email protected] <javascript:> wrote:
>
> Dan,
>
> Is it possible to inject this into a parent beanfactory? E.g., I have in
> my index.cfm
>
> <cfset ModelGlue_PARENT_BEAN_FACTORY = application.cs />
>
> I don't think there's a way for my model in application.cs to get access
> to modelGlue, correct? I'm temporarily working around this by accessing
> application.public.getBean("modelGlue.cacheAdapter").purge() which works
> but I know you don't recommend accessing the framework this way.
>
> I'm using this from an eventgateway to synchronize multiple nodes, FWIW.
>
>
> Brian
> --
> --
> 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]<javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "model-glue" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
> Dan Wilson <javascript:>
> Thursday, April 10, 2014 11:01 AM
> OK. so if you aren't overriding the configuration in the base (internal)
> ModelGlue ColdSpring.xml, this is the one that is used:
>
> <bean id="modelGlue.cacheAdapter"
> class="ModelGlue.gesture.externaladapters.contentcaching.SimpleTimedCache">
> <constructor-arg
> name="sweepInterval"><value>10</value></constructor-arg>
> </bean>
>
>
>
> So just use beans.modelGlue.cacheAdapter in your controllers, or inject it
> into your model as you please.
>
>
> DW
>
> Brian G <javascript:>
> Wednesday, April 09, 2014 11:38 PM
> No, I just added the following to my eventhandlers.xml file:
>
> <event-handler name="foo" cache="true" cacheTimeout="300"
> cacheKeyValues="slug">
>
>
>
>
> On Monday, April 7, 2014 5:58:44 PM UTC-7, Dan Wilson -
> [email protected]<javascript:>wrote:
> --
> --
> 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]<javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "model-glue" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
> Dan Wilson <javascript:>
> Monday, April 07, 2014 8:58 PM
> How did you create the SimpleTimedCache? Through ColdSpring?
>
> If so, it would be available in the beans scope (in controllers) and
> wherever you inject it via ColdSpring into your model.
>
> DW
>
> Brian G <javascript:>
> Monday, April 07, 2014 8:57 PM
>
> Fair enough. How do I get a reference from MG to the SimpleTimedCache so
> I can test purging? I understand it's designed to be simple but it might
> suit my purposes for now.
>
>
> Brian
>
>
> On Wednesday, April 2, 2014 6:16:46 PM UTC-7, Dan Wilson -
> [email protected] <javascript:> wrote:
> --
> --
> 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]<javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "model-glue" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
--
--
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
---
You received this message because you are subscribed to the Google Groups
"model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.