Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sisu-users] binding priority

Hello

You can ensure that C1 will be picked first by annotating it @Priority with a value greater than 0.

There is a @Priority annotation in the JavaEE specification but Sisu also includes its own @Priority for those that don't have the JavaEE classes in the classpath.


Inviato da IBM Notes Traveler


Igor Fedorenko --- [sisu-users] binding priority ---

Da:"Igor Fedorenko" <igor@xxxxxxxxxxxxxx>
A:"" <sisu-users@xxxxxxxxxxx>
Data:Sab, 22/Ago/2015 15:33
Oggetto:[sisu-users] binding priority


I have two components that implement the same component interface @Named @Singleton public class C1 implements Foo {} @Named // not a @Singleton, not sure if this is important public class C2 implements Foo {} My application has single classloader, the two components are coming from different jars, and C1 is before C2 on classpath. Can I assume that "@Inject Foo" will reliably pick C1 based on classpath order, or is there more to it? Thank you in advance. -- Regards, Igor _______________________________________________ sisu-users mailing list sisu-users@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/sisu-users

Back to the top