Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 86705 invoked from network); 1 Jul 2002 19:10:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by 209.66.108.5 with SMTP; 1 Jul 2002 19:10:40 -0000 Received: (qmail 20278 invoked by uid 97); 1 Jul 2002 19:10:52 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 20252 invoked by uid 97); 1 Jul 2002 19:10:51 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 20240 invoked by uid 98); 1 Jul 2002 19:10:51 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <3D20A9B1.3090102@osm.net> Date: Mon, 01 Jul 2002 21:12:49 +0200 From: Stephen McConnell User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en, en-us MIME-Version: 1.0 To: Avalon Developers List Subject: Re: [Attn: Stephen] ***I Get It Now*** References: <000401c220da$2d60e780$0801a8c0@Lagrange> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N Leo Sutic wrote: >Stephen, > >I looked over Merlin, and I think I'll ditch MicroContainer for it. > >In particular, it would appear as if I can keep just the MicroContainer >class (maybe move it over to Merlin). > >Let me explain: > > + Merlin uses the ServiceLoader class to start up a component. > > + Basically, you say "ServiceLoader, the components are in these JAR >files, > I want to use this component, load it." So I could use ServiceLoader >to > get a DataSourceComponent and it would automatically check all listed > JAR files for the depndencies of the DataSourceComponent. > >But then, once Merlin has loaded the component, how do I get a reference >to it? That is, after calling initialize() on the serviceLoader, what do >I do then? > ServiceLoader is a compoent that implements the interface PipelineService. The PipelineService interface contains the operation "pipeline" which is the directive to Merlin to load and process the lifecycle of a target component given a classname. The pipeline operation returns the component to the invoking client. Take a look at the http://home.osm.net/doc/merlin/org/apache/excalibur/merlin/package-summary.html and the javadoc for ServiceLoader for addition details. > >In particular, suppose I have this: > >public void MyApp { > > public static void main(String[] args) throws Exception { > // Do stuff > > ... > > // I want to use a DataSourceComponent right here. > // The component I want to use is fully meta-enabled, and so is > // all its dependencies. How? > > ... > > // Some other stuff > } > >} > >Question: > > + Does Merlin *require* the use of external XML files for >configuration? Or can > a configuration be built programmatically and given to Merlin? > > Its desiged to be built programatically. No configuration is "required". The functional parameters are passed under a ServiceLoaderContext.Details of ServiceLoader in terms of the contextualize and configure requirements are detiled in the ServiceLoader javadoc. The optional configuration lets the client override the default configuration of a component - but this an area I want to review as part of Merlin II (refer the excalibur assembly package and the readme file for more details). What Merlin does require is that component structure is declared in an xinfo file - at the moment its a bick strict - and I think this could be generalized so that a minimal component xinfo could be logically derived if not explicitly declared - but that's more a Merlin II subject. Main changes between current Merlin and Merlin II are (a) II builds extensively on containerkit, (b) II introduces more structured approach to merlin assembly defintions (an example is included in the Excalibur asssembly package), and (c) the overall design focussed on the ability to create a hierachy of merlin containers in service can be explicitly exported. Cheers, Steve. >/LS > > >-- >To unsubscribe, e-mail: >For additional commands, e-mail: > > > -- Stephen J. McConnell OSM SARL digital products for a global economy mailto:mcconnell@osm.net http://www.osm.net -- To unsubscribe, e-mail: For additional commands, e-mail: