--------- Original Message ---------
Subject: [coldbox:18614] [coldbox-3.6.0] Injection metadata and/or mapping to inject scopeRegistration instance of WireBox
From: "jinglesthula" <mithlon...@gmail.com>
Date: 6/17/13 3:28 pm
To: col...@googlegroups.com
I have the following in my WireBox.cfc in the (wireBox struct):
scopeRegistration = {enabled = true,scope = "application", // server, cluster, session, application
key= "myHappyLilWireBox"}
What I want is that when I have components with the following injection metadata at the top<cfproperty name="injector" inject />that this will end up injecting the instance of WireBox that has already been registered in the application scope.I know I can do mapPath("coldbox.system.ioc.Injector").asSingleton(); later on in my Wirebox.cfc, buta) I don't know if this will get init() -ed with my WireBox.cfc binder andb) I know 2 is better than n, but I'd like to just have a single instance hanging aroundPerhaps I'm misunderstanding and Wirebox knows that if it's being asked for an instance of itself it will use the application scope one instead of creating a separate one for the singleton internal scope. Not sure.
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--------- Original Message ---------
Subject: [coldbox:18616] Re: [coldbox-3.6.0] Injection metadata and/or mapping to inject scopeRegistration instance of WireBox
From: "jinglesthula" <mithlon...@gmail.com>
Date: 6/17/13 3:36 pm
To: col...@googlegroups.com
eh, I think I am misunderstanding. I have an instance of wirebox injected in one of my models and when I ask it for an instance of something mapped in my binder it knows all about it. So somehow there's got to be a shared reference to the mappings that are set up in my binder, because the mapPath("coldbox.system.ios.Injector").asSingleton() line of code doesn't have any reference to the binder, so somewhere, somehow the injected instance of WireBox is finding out about the mappings given to the instance created when ColdBox is initialized, or is being smart enough to return a reference to itself when it sees <cfproperty name="injector" inject />. I'm kind of guessing it's the latter.
On Monday, June 17, 2013 2:28:07 PM UTC-6, jinglesthula wrote:
I have the following in my WireBox.cfc in the (wireBox struct):
scopeRegistration = {enabled = true,scope = "application", // server, cluster, session, application
key= "myHappyLilWireBox"}
What I want is that when I have components with the following injection metadata at the top<cfproperty name="injector" inject />that this will end up injecting the instance of WireBox that has already been registered in the application scope.I know I can do mapPath("coldbox.system.ioc.Injector").asSingleton(); later on in my Wirebox.cfc, buta) I don't know if this will get init() -ed with my WireBox.cfc binder andb) I know 2 is better than n, but I'd like to just have a single instance hanging aroundPerhaps I'm misunderstanding and Wirebox knows that if it's being asked for an instance of itself it will use the application scope one instead of creating a separate one for the singleton internal scope. Not sure.
--