Return-Path: Delivered-To: apmail-ws-synapse-dev-archive@www.apache.org Received: (qmail 87593 invoked from network); 2 Aug 2007 15:22:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 15:22:25 -0000 Received: (qmail 79265 invoked by uid 500); 2 Aug 2007 15:22:25 -0000 Delivered-To: apmail-ws-synapse-dev-archive@ws.apache.org Received: (qmail 79220 invoked by uid 500); 2 Aug 2007 15:22:25 -0000 Mailing-List: contact synapse-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: synapse-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list synapse-dev@ws.apache.org Received: (qmail 79208 invoked by uid 99); 2 Aug 2007 15:22:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 08:22:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pzfreo@gmail.com designates 64.233.162.235 as permitted sender) Received: from [64.233.162.235] (HELO nz-out-0506.google.com) (64.233.162.235) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 15:22:17 +0000 Received: by nz-out-0506.google.com with SMTP id l1so213390nzf for ; Thu, 02 Aug 2007 08:21:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LeeZwg7vMAlZNRClK1LftQ9GKX9fpGNFZ8ilzUituwhBVWZiF/V8OanPnTzZS+7RaiuwpWG+6gTIUGEcJDkILv/bcA9t1Bn8uh0dq6xcccXgPNxey9vbEfLpU6OejXA7g6FDCEkprEcuAzYmn7JENKLz1Iow8dnZfU1/2btavEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=B/cq9sv7GR4WAH7ktwj98gT1lEOw7irhb0Ve+ALzbyiQ9QcbcqZqq4V71jxlJtoD5wMRLkzsXmCvKJhnbIaR2sHU+1/y1CkjLy85Rx8A8woyz3Kw4H7qthrP8o0sqrnX1gGv4i8pba5lWlQxaCCZTlUUp9aepkk6pVS5W6CgwG8= Received: by 10.143.12.19 with SMTP id p19mr89493wfi.1186068116269; Thu, 02 Aug 2007 08:21:56 -0700 (PDT) Received: by 10.143.39.15 with HTTP; Thu, 2 Aug 2007 08:21:56 -0700 (PDT) Message-ID: <88f5d710708020821qd0329e1l50bc311a93d511de@mail.gmail.com> Date: Thu, 2 Aug 2007 16:21:56 +0100 From: "Paul Fremantle" To: synapse-dev@ws.apache.org Subject: Re: J2SE JAR file code and Factories In-Reply-To: <46B1D2DF.7000601@thoughtcraft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <88f5d710707310947o14c09ba7of90cce7e0ed7606f@mail.gmail.com> <46B1D2DF.7000601@thoughtcraft.com> X-Virus-Checked: Checked by ClamAV on apache.org +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 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 > > -- 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