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?
DecoraManager
is 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:
DecoraManager
as@PetiteBean
.PetiteContainer
createDecoraManager
usePetiteContainer.get()
to get the instance.In the first example,
DecoraManager
gets just wired; in the second example, it gets stored in Petite container, too.