I'm needing to setup 2 Transfer ORM Factories - 2 Datasources are
being put in place so I'm guessing I'm needing two instances of the
loader put in my Configuration?
I've seen a few ppl talking about this on the group but not
specifically CB3.0 config. To be honest after a few hours of trying to
do this I'm struggling a bit. Mainly with syntax and working examples
of how the configuration would be setup for doing this. Does anyone
have any pointers / examples of how the interceptor would be setup to
do this? Any help appreciated.
That's only a single instance of Transfer but does that look about
right?
Is there a way that I can call ColdBoxORM through the ColdBox bean
instead of having to declare it separately?
And finally am I right in assuming that I would use ColdBoxORM to call
my different instances of Transfer once I get them up and running? How
would I do that?
Some of what you're doing here I'm not familiar with, but if each
service needs one or the other Transfer instance, maybe the cleanest
approach would be two next-base classes that extend your existing
base, with each one having the appropriate Transfer instance injected
into it. Essentially you have to "classes" of server, one with each
Transfer config.
If it's more dynamic than that, then your getTransfer method needs to
be more active than just retrieving a single injected item.
It kind of makes sense but the two base extensions would be exactly
the same apart from calling the CB config for the different Transfer
details
They'd basically contain a getColdBox() and getTransfer() method....
with the getTransfer() pulling in the custom details through
getColdBox(). Gut instinct is telling me that's not very reusable.
The Lightwire approach I'm trying to do is by telling it which
Transfer instance needs to be injected into which service when they're
called. The likelihood is we're not going to have a service needing
both Transfer instances so this should work ( He says ).
I have this at the moment, but how would I define another Transfer
Interceptor next to this one and how would I then call each one if /
when I need it?
Yes, each interceptor can take in a “name” attribute, so you will have to name them differently. Also, the most important part is that you setup the cache keys for each interceptor property. Read the docs, it tells you the keys for the 3 saved entries in cache, transfer, transferFactory and transferTransaction. Each interceptor must name each key differently so they don’t collide.