Does Qi4j currently provide (or will it provide in future) any
non-direct way to pass data from outside the app, to the app?
Something like "ApplicationActivationListener", which would have
methods "applicationActivated" and "applicationPassivated". Those
methods would be then invoked at appropriate time, and would allow
dynamically allocated data passed onto to eg. services. I don't want
the user of my framework to play around with config files, but to pass
data purely programatically.
I played around with @Uses and .use(...) methods somewhere around qi4j
infrastructure, but never got quite to understand their exact purpose.
Nor I am sure they would work in this case. Somehow I remembered
module assembly having .use(...) method but apparently it is gone, or
my memory is just wrong.
If someone wants to know my concrete problem, it is this:
I have a service, which contains a mapping. The data for mapping (both
keys and values) comes from outside the application, at assembling
stage. The data is dependant on which assembler is assembling the
module. Ie, one assembler has certain data, and other assembler has
other data. And if application user uses both assemblers to assemble
the module, the data from both assemblers needs to be passed on to
that service.
I don't want that service to use static fields/methods, as then it
wouldn't be isolated between many application instances in one java
program. The most convenient way would be to add some custom code
which would be executed after application is activated, and then it
could simply pass that data to the service in that application.
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev