Sure, would you like it to be Mura related or more general about using an
instance that is defined outside of your Mach-II app?


~Dave Shuck
/*****************************************
@dshuck - http://daveshuck.com
DFW CFML User Group - @dfwcfml
*****************************************/



On Tue, May 3, 2011 at 10:39 AM, Peter Farrell <[email protected]> wrote:

> Dave, could write a quick sectin with your example on the cs entry on the
> wiki?
> On May 3, 2011 10:37 AM, "Dave Shuck" <[email protected]> wrote:
> > Just as a follow-up for anyone else that happens to stumble across this,
> > here is the approach I took. As I mentioned, Mura puts ColdSpring in the
> > variable application.serviceFactory you can then define whatever custom
> > additional classes you want in /config/custom.coldspring.xml.cfm, which
> is
> > where I defined all my system-wide classes. Then in the Mach-II
> > applications inside Mura, I pointed the ColdSpring property to an empty
> > ColdSpring config file, just as you do with Mach-II modules when you want
> to
> > inherit from the parent application. This works perfectly and met my
> > needs. This may be pretty obvious to a lot of you, but I am attaching a
> > snip of my Mach-II ColdSpring property config just in case it helps
> anyone
> > down the line that stumbles across this down the road.
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > <property name="coldspringProperty"
> > type="MachII.properties.ColdspringProperty">
> > <parameters>
> > <parameter name="beanFactoryPropertyName" value="serviceFactory"/>
> > <parameter name="configFile" value="/config/empty_coldspring.xml"/>
> > <parameter name="configFilePathIsRelative" value="true"/>
> > <parameter name="resolveMachIIDependencies" value="true"/>
> > <parameter name="parentBeanFactoryScope" value="application"/>
> > <parameter name="parentBeanFactoryKey" value="serviceFactory"/>
> > </parameters>
> > </property>
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > ~d
> >
> >
> > On Mon, May 2, 2011 at 5:54 PM, Dave Shuck <[email protected]> wrote:
> >
> >> Peter, that is exactly what I want to do. For some reason I was thinking
> >> the way that parentBeanFactoryScope worked is that it would add whatever
> CS
> >> was defined in the Mach-II property to an existing parent bean factory
> >> rather than just using the parent directly. I am not sure why i was
> making
> >> that so difficult in my head. This is perfect!
> >>
> >> Thanks for setting me back on track.
> >>
> >>
> >>
> >> ~Dave Shuck
> >> /*****************************************
> >> @dshuck - http://daveshuck.com
> >> DFW CFML User Group - @dfwcfml
> >> *****************************************/
> >>
> >>
> >>
> >> On Mon, May 2, 2011 at 5:48 PM, Peter J. Farrell <[email protected]
> >wrote:
> >>
> >>> Dave Shuck said the following on 05/02/2011 05:40 PM:
> >>> > I am experimenting with putting multiple Mach-II applications inside
> a
> >>> > Mura app. Within Mura, you can put a ColdSpring configuration in
> >>> > /config/coldspring.custom.xml.cfm and those bean definitions get
> >>> > pulled into the global service factory instance. I am hopting to use
> >>> > this global beanFactory (created as application.serviceFactory) and
> >>> > make it available to my Mach-II applications. I am considering
> >>> > modifying the ColdSpring property with a parameter like
> >>> > "useExistingServiceFactoryInstance" and
> >>> > "existingServiceFactoryInstanceVariableName" so that I can simply
> have
> >>> > it use a reference of that instance. Has anyone done anything like
> >>> > this or have any thoughts on why this would be a bad idea? :)
> >>> I'd just define your Mach-II application to use the Mura CS instance as
> >>> parent factory. In this case, the base module of Mach-II would be a
> >>> child factory of CS:
> >>>
> >>> <!-- Indicates a scope to pull in a parent bean factory into a
> >>> child bean factory
> >>> Default: application
> >>> <parameter name="parentBeanFactoryScope" value="application"/>
> >>> -->
> >>>
> >>> <!-- Indicates a key to pull in a parent bean factory from the
> >>> application scope
> >>> Default: FALSE
> >>> <parameter name="parentBeanFactoryKey" value="serviceFactory"/>
> >>> -->
> >>>
> >>> It would look like this:
> >>>
> >>> Mura CS Instance (parent) -> Mach-II Base Module CS Instance (child) ->
> >>> Mach-II Modules CS Instance(s) (grandchildren)
> >>>
> >>> .pjf
> >>>
> >>> --
> >>> Peter J. Farrell
> >>> [email protected]
> >>> [email protected]
> >>> http://blog.maestropublishing.com
> >>> Identi.ca / Twitter: @maestrofjp
> >>>
> >>> --
> >>> To post to this group, send email to
> >>> [email protected]
> >>> For more options and to unsubscribe, visit this group at
> >>> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
> >>>
> >>> SVN: http://svn.mach-ii.com/machii/
> >>> Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
> >>>
> >>
> >>
> >
> > --
> > To post to this group, send email to
> [email protected]
> > For more options and to unsubscribe, visit this group at
> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
> >
> > SVN: http://svn.mach-ii.com/machii/
> > Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
>
> --
> To post to this group, send email to
> [email protected]
> For more options and to unsubscribe, visit this group at
> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
>
> SVN: http://svn.mach-ii.com/machii/
> Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
>

-- 
To post to this group, send email to [email protected]
For more options and to unsubscribe, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en

SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/

Reply via email to