How to get correct implementations

3 views
Skip to first unread message

jokoul webster

unread,
Mar 15, 2010, 2:34:05 PM3/15/10
to impala...@googlegroups.com
Hi Phil:
    If I hanve defined an interface A in root module,and have implemented two concreate classes in module1 and module2,in this case,if I wanna invoke interface A in module3,which implementation would be used?
    Thanks.
 
JK.Webster

Phil Zoio

unread,
Mar 15, 2010, 4:55:53 PM3/15/10
to impala...@googlegroups.com
Jokoul

If you don't publish either of the service implementations from module1
and module2 in any special way, then the one which is published first
will be used. However, if you do have competing implementations, you can
force which one is prefered through the service.ranking attribute.

For example:

<service:export beanName="userFilter" exportName="userFilter"
attributes="service.ranking=10"/>

will result in the bean 'userFilter' being published with a higher than
default service.ranking, which would result in it being picked up at the
expense of a service published with a lower or default service ranking.

There is a brief reference to this in
http://code.google.com/p/impala/wiki/NamespaceReferenceService

Phil

Reply all
Reply to author
Forward
0 new messages