On Tue, May 19, 2009 at 12:11 AM, ant elder <[email protected]> wrote:
> On Tue, May 19, 2009 at 12:59 AM, Raymond Feng <[email protected]> wrote:
>> Hi,
>>
>> In Tuscany, we can declare service implementations using the
>> META-INF/services/<SPI name> pattern. One of the use cases is to allow some
>> of the implementations to be replaced to fit the hosting environment. If
>> there are more than one services with the same name are available, we
>> randomly pick the "first" one. This makes the "replacement" not
>> straightforward.
>>
>> To fix this problem, I added the support for the "ranking" attribute (FYI,
>> OSGi has the idea for services). The discovered system services will be
>> sorted based on the ranking (if not present, default to 0). For example, we
>> can use it to control which embedded HTTP server (Tomcat or Jetty) is used.
>> The attribute can be potentially used to define the ordering of multiple
>> extensions for the same extension point.
>>
>> Thanks,
>> Raymond
>
> I guess it would fix the random choice but a ranking approach doesn't
> really make this any more flexible does it? The problem is that users
> can't easily change the ranking - if we set the Jetty servlet host to
> have a higher ranking than the tomcat one then how do users who want
> to use Tomcat do that?
>
> How about instead changing to use a config file where you can say
> explicitly which extensions to use? That would fix this and some other
> issues that we have with the current approach.
>
>   ...ant
>

I guess we need both, the ranking mechanism would allow us to start
the tomcat/jetty extension before a binding or another extension needs
the servletHost.

Now, on what ant is suggesting, I also think we ned a way to define if
we want to use tomcat/jetty, as the classpath technique does not work
perfectly all the time... but I'm not sure if I wanted to introduce
another configuration file just for this, maybe something on the
composite or definitions.xml, but I need to think a little more about
a perfect solution here.

-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to