On Thu, Apr 23, 2009 at 4:49 AM, Pelle Poluha <[email protected]> wrote:
> Hello!
>
> In the tutorial describing how to assemble an application, an
> ApplicationAssembly instance is retrieved this way:
>
> ApplicationAssembly app = qi4j.newApplicationAssembly();

As I have mentioned, there has been a fair amount of recent changes
that have not yet made it to the Documentation.

The low level;

Instantiate "Energy4Java"
        qi4j = new Energy4Java();

Instantiate an ApplicationAssembler, for instance a subtype of
ApplicationAssemblerAdapter;
        assembler = new MyApplicationAssembler();

Create either the Application;
        application = qi4j.newApplication( assembler );

OR, create the ApplicationModel as an intermediate step
        model = qi4j.newApplicatiomModelSPI( assembler );
        application = model.newInstance( qi4j.spi() );

Then activate the Application.
        application.activate();


IIRC, there is also a mechanism to detect ApplicationAssemblers from a
file in META-INF/services/ directory, but I need to look if that is
already implemented or just a suggestion. There is also a mechanism
for OSGi that is separate, but can't recall the details.


I don't know when I will have enough time to work on the documentation
updates. Hopefully soon.

Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to