2011/3/10 Rickard Öberg <[email protected]>:
> I've been thinking about the bootstrap procedure, and the now common
> problem of assemblers having to take arguments for "visibility" (most
> commonly), and how maybe it would be possible to separate those things
> out.
<snip>
I made a quick test of this, and it worked really well. Here's some
example code which sets "instantiateOnStartup()" for all Activatable
services:
// Declare a particular service
module.services( ActivatableComposite.class );
// All Activatable services should instantiate on startup
module.services( new Specification<ServiceAssembly>()
{
@Override
public boolean satisfiedBy( ServiceAssembly item )
{
return Activatable.class.isAssignableFrom( item.type());
}
}).instantiateOnStartup();
Very small changes in the bootstrap code to do this. So it's mostly a
question of whether we like this, and any particular details needs to
be considered.
One issue is that changing "addServices" to "services" will force
developers to update all their assemblers. We could solve this by
having "addServices" be there as @Deprecated, and just let it delegate
to "services", and then remove it in the next version.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev