I've noticed there has been some changes to the BeanFactory lately and
there is now a BeanFactoryCompat that looks to be the previous
component that you are depreciating for new autowire integration.
Is there a new function to access the metadata cache that I am not
seeing? Or should I just depend on getMetaData() until everything
settles with 3.0?
I may be getting ahead of myself, but I enabled wirebox in my config,
which turns off compatMode and I've been running into all sorts of
issues with the beanFactory.
Here is one -
The beanFactory.autowire() function defines a default for the
targetID. When compatMode is off the autowire arguments are passed
through to the Injector's autowire function which has a NOT
structKeyExists(arguments,"targetID") condition to determine if the
target identity needs to be resolved from the metadata or if it is
passed in through the autowire call. This throws an error when
calling autowire through the BeanFactory when you only specify the
target argument. i.e. beanFactory.autowire( myComponent );
Another one is there is no wirebox support for
BeanFactory.addModelMapping(). I'm guessing this should call the
binder to add the mapping but the conditional doesn't exist for
checking compatMode.
Should I continue plowing through these issues and report back? Or
should I stay in compatMode and wait for documentation to be
completed? The docs will probably answer a lot of my questions....
Speeking of which question from yesterday was how would I access
BeanFactory.getAutowireCache() with compatMode turned off.
I will check the autowire without the I'd. As far as mappings go, the injector has each a configuration binder that holds all object mappings. You interface with the finder to add more, remove add scan locations, remove etc.
Also, each mapping represents everything about the object including metadada. So the metadata cache is now part of a mapping itself encapsulated. So all cache metadata is basically all the mappins. Does this make sense?
It has to do with calling autowire() through the BeanFactory.
Since the BeanFactory has a default value of "" (empty string) for the
targetID argument and beanFactory.autowire() uses pass through
arguments for wirebox.autowire() the targetID argument in
wirebox.autowire() will be an empty string/ So structKeyExists()
check returns false and thisMap.getName() is never called and wirebox
will throw an error evaluting the empty target string.
Do you see it?
call beanFactory.autowire( myComponent ); and you will see the error.
You have to have wirebox turned on.