+1 for the proposal

and the OSGi Services and the Service listeners will make it very easy to pick the mediators using OSGi.

So if we can make an OSGi based mediator finder then we can easily declare the MediatorFactory as an OSGi service interface (no code changes required for this), and register the factory implementations as OSGi services. So that this implementation is going to be just a service listener.

Thanks,
Ruwan

On Tue, Dec 2, 2008 at 4:20 PM, Paul Fremantle <pzfreo@gmail.com> wrote:
There are two problems with sun.misc.Service.

1) It isn't standard across JDKs
2) We are likely to run into problems in an OSGi environment.

I personally think that OSGi might provide the long term solution for
this - it can do the same thing, but I'm not clear if we are ready to
take a dependency on OSGi in the core at this point. That would mean
shipping with an OSGi library and therefore choosing which one etc.

So my proposal is that we do the following:

We simply create an interface that matches the current Sun interface
except in our stack:

package org.apache.synapse.configuration;

public interface ClassFinder {
   Iterator findImplementationsOf(Class clazz);
}

I renamed the interface and method names because I think the one's
that Sun uses are frankly confusing.

Then we can have a line in synapse.properties:

synapse.config.classfinder=org.apache.synapse.config.ClassFinderImplementation

Initially this implementation could be one of the different plugin
replacements for sun.misc.Service that works on any JDK. We could also
write an OSGi version, and we could write a version that say tries
OSGi first then the old style. Alternatively we could do some other
method.

If there are no objections (or suggestions for improvement!) I will
make these changes over the next day.

Paul

--
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org




--
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/