avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: LogKit Configurator
Date Sat, 11 Aug 2001 10:16:49 GMT
On Sat, 11 Aug 2001, Peter Donald wrote:

> On Sat, 11 Aug 2001 01:05, giacomo wrote:
> > > Another way I have about doing it is something like
> > >
> > > <targets>
> > >   <target name="file:dev/logs/classloader.log"/>
> > >
> > >   <target name="console:stderr"/>
> > >
> > >   <target name="db:my-table">
> > >     <parameter name="username" value="dbsa"/>
> > >     <parameter name="password" value="secret"/>
> > >   </target>
> > >
> > > </targets>
> >
> > And the next step would be:
> >
> > <targets>
> >   <target name="file" class="logtarget.FileFactory">
> >     <parameter name="filename" value="dev/logs/classloader.log/>
> >   </target>
> >
> >   <target name="console" class="logtarget.FileFactory">
> >     <parameter name="device" value="stderr"/>
> >   </target>
> >
> >   <target name="db" class="logtarget.DBFactory">
> >     <parameter name="table" valuer="my-table"/>
> >     <parameter name="username" value="dbsa"/>
> >     <parameter name="password" value="secret"/>
> >   </target>
> >
> > </targets>
> >
> > and thus we have a full Selector/Component specification. So the
> > TargetFactory interface can be reduced to
> >
> > interface TargetFactory
> > {
> >   LogTarget createTarget( String name,
> >                           Parameter parameters );
> > }
>
> I would prefer a full Configuration object be passed because some log targets
> will potentially have non-flat configuration (db target, jms target etc).
> Other than that I like. However I am not sure I know why you need to provide
> name to target if you specify factory class. Couldn't something simpler such
> as the following work? Or do you see targets as potentially creating multiple
> different types or something?
>
> interface TargetFactory
> {
>   LogTarget createTarget( Configuration configuration );
> }

You're right. As I've mentioned above with "full Selector/Component
specification" it clearly should be:

 interface TargetFactory /* extends Configurable */
 {
   LogTarget createTarget();
 }

Concrete Factories will implement Configurable like normal Components
will do.

Giacomo

>
> 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: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
>
>


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


Mime
View raw message