I have a DecoraManager implementation : AppDecoraManager, and want to inject a service e.g.: FooService as:
@PetiteInject
FooService fooService;
When resolveDecorator() is called I want to use fooService to determine some parameters, but it has null value.
What could be the reason for this, and how could I resolve it?
DecoraManageris created by the servlet container, inDecoraServletFilter.At the moment, there is no integration with existing Petite IOC, so you have to do the following:
PetiteContainer. Store it during the creation of container, for example.createDecoraManager()in your implementationPetiteContainer.wire(this)in your implementation ofDecoraManager.That is the only way to do so, so far.
The alternative would be this:
DecoraManageras@PetiteBean.PetiteContainercreateDecoraManagerusePetiteContainer.get()to get the instance.In the first example,
DecoraManagergets just wired; in the second example, it gets stored in Petite container, too.