On Wed, 22 Aug 2001 19:34, Giacomo Pati wrote:
> > > 1) <factory/> elements
> > > 2) <factories href="location.factories"/>
> > > 3) classloader
> > >
> > > If each one of those resources contained the "foo" factory, the one in
> >
> > the
> >
> > > logkit file wins.
> >
> > I like (1) and (3) ;)
>
> This means you don't like to extend the system to have the ability to
> specify an additional config file that contains factory definitions? So
> this would mean that "take the one provided by the system (as classloader
> reasource) or write your own definition right here into the config file
> (and not in an additional separate file), right?

Well as I see it, you need to have factory classes in ClassPath for it to 
work. In which case the ClassLoader is already loaded and should have all the 
information in it.

> > How about any Jar that contains LogTarget Factories must create a file
> >
> > META-INF/services/org.apache.avalon.excalibur.logger.LogFactory.xml
>
> Hm.., I think I need to study all thos jar/META stuff 'caus I'm not
> familiar with thos features.

I think it is documented in jdk1.3 docs under manifests or something. Heres 
some sample code

  final ClassLoader classLoader = getClass().getClassLoader();
  final Enumeration enum =
       classLoader.getResources( Deployment.DESCRIPTOR_NAME );
  while( enum.hasMoreElements() )
  {
    final URL url = (URL)enum.nextElement();
    parser.parse( url.toString() );
    getLogger().debug( "deploying " + url );
    deployFromDescriptor( handler.getConfiguration(), 
                          classLoader, url );
  }

However instead of reploying from descriptor you would be registering 
factorys from descriptor ;)

> > ...snip...
> >
> > > This all looks good.
> > >
> > > <skip excellent overview that should be made into an xdoc>
> >
> > +1000
>
> Thank you all :)

no ... thank u ;)

-- 
Cheers,

Pete

*-----------------------------------------------------*
* "Faced with the choice between changing one's mind, *
* and proving that there is no need to do so - almost *
* everyone gets busy on the proof."                   *
*              - John Kenneth Galbraith               *
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to