synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Fremantle" <pzf...@gmail.com>
Subject Re: J2SE JAR file code and Factories
Date Thu, 02 Aug 2007 15:36:08 GMT
Its actually the MediatorFactory etc
but I see your point.

Paul

On 8/2/07, Glen Daniels <glen@thoughtcraft.com> wrote:
> Btw, this is easier if Mediator and other plugin interfaces simply
> extend the Provider marker interface....
>
> --Glen
>
> Paul Fremantle wrote:
> > +1 from me. I think it would be a bit easier to keep track of, and
> > we'd end up with one set of code, not three. Let me take a look at
> > implementing this.
> >
> > Paul
> >
> > On 8/2/07, Glen Daniels <glen@thoughtcraft.com> wrote:
> >> Hi Paul:
> >>
> >> Paul Fremantle wrote:
> >>> Since I added the Startup model we now have 4 different uses of the
> >>> J2SE ServiceProvider code.
> >>>  [...]
> >>> However, I'm also wondering if there is a way we can simplify all
> >>> these examples into one. Obviously if we had Java1.5 we could use
> >>> Generics for this, but we dont!
> >>>
> >>> Any ideas?
> >> One idea would be to use a single "Provider" marker interface for any
> >> class that's a Synapse plugin of any kind.  Then your
> >> Service.providers() call looks up that interface, and all we do when we
> >> find one is ensure that the class is loaded (this may already happen
> >> inside sun.misc.Service in fact, I'm not sure).  Then you leave it up to
> >> each plugin to handle registration by doing something like:
> >>
> >> class MyMediator implements Mediator, Provider {
> >>    static {
> >>      MediatorFactory.register(MyMediator.class);
> >>    }
> >> }
> >>
> >> Pro: unifies interface, simplifies our code, static initializers don't
> >> strictly require service provider pattern.
> >>
> >> Con: requires plugin authors to call the correct registration API.
> >>
> >> I don't know if this kind of approach is worth it, but it did pop to mind.
> >>
> >> Thanks,
> >> --Glen
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
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: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message