You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Craig R. McClanahan" <cm...@mytownnet.com> on 2000/02/13 03:49:30 UTC

[Catalina] Using XML Parsing Package in "org.apache.tomcat.util.xml"

Costin,

I'd like to try using the XmlMapper stuff you've built (in package
org.apache.tomcat.util.xml) to configure Catalina.  Are the interfaces
and functionality stable enough to start using?  In addition, I'll let
you know if I would find particular modifications useful.

Craig



Re: [Catalina] Using XML Parsing Package in "org.apache.tomcat.util.xml"

Posted by co...@eng.sun.com.
> * Right now, you're passing in the root object that
>   gets pushed on the stack.  This means you cannot
>   use the ObjectCreate approach to create the outermost
>   object with a configurable class name.  How about if we
>   change this so that readXml() returns the very first object
>   it adds to the hierarchy (i.e. the outermost object that
>   it parses)?

That's how it worked in the first draft. It should be easy to re-implement
that ( or it should work - try to pass a null ). 
( it is good to have both methods, for simple cases it might be simpler to 
pass the object you want to "fill" - I have to do that for Context when I
read web.xml, since Context is created in server.xml  configuration, and
then I just want to set properties on it)


> * In Catalina, the set of rules to be configured will vary
>   depending on how you are deploying your container
>   hierarchy.  I could handle this in the shell program, but
>   I'd prefer to add a method to XmlMapper that loads a
>   set of rules from a resource file in some reasonable format.
>   That way, you could support mutliple configuration file
>   formats with a pretty generic startup/shutdown program.

Any addition is good, as long as it doesn't brake something that works :-)

Costin


Re: [Catalina] Using XML Parsing Package in "org.apache.tomcat.util.xml"

Posted by "Craig R. McClanahan" <cm...@mytownnet.com>.
costin@eng.sun.com wrote:

> > Costin,
> >
> > I'd like to try using the XmlMapper stuff you've built (in package
> > org.apache.tomcat.util.xml) to configure Catalina.  Are the interfaces
> > and functionality stable enough to start using?  In addition, I'll let
> > you know if I would find particular modifications useful.
>
> It should be good enough, it can read web.xml ( not so easy ).
>
> You can add new XmlActions if you need (in XMLMapper if generic,
> local in your class if specific to the application ).
>
> Make any changes you want, and let me know what you think ( I spent a lot
> of time for XmlMapper...)
>

XmlMapper is quite nice.  I was able to set up the rules to read a
configuration file for Catalina with almost no problems.

I find myself wishing for a change and an enhancement, and thought I'd run
them by you first:

* Right now, you're passing in the root object that
  gets pushed on the stack.  This means you cannot
  use the ObjectCreate approach to create the outermost
  object with a configurable class name.  How about if we
  change this so that readXml() returns the very first object
  it adds to the hierarchy (i.e. the outermost object that
  it parses)?

* In Catalina, the set of rules to be configured will vary
  depending on how you are deploying your container
  hierarchy.  I could handle this in the shell program, but
  I'd prefer to add a method to XmlMapper that loads a
  set of rules from a resource file in some reasonable format.
  That way, you could support mutliple configuration file
  formats with a pretty generic startup/shutdown program.

I'd be happy to work on these (and add some more Javadocs :-).

>
> Costin
>
>

Craig



Re: [Catalina] Using XML Parsing Package in "org.apache.tomcat.util.xml"

Posted by co...@eng.sun.com.
> Costin,
> 
> I'd like to try using the XmlMapper stuff you've built (in package
> org.apache.tomcat.util.xml) to configure Catalina.  Are the interfaces
> and functionality stable enough to start using?  In addition, I'll let
> you know if I would find particular modifications useful.

It should be good enough, it can read web.xml ( not so easy ).

You can add new XmlActions if you need (in XMLMapper if generic,
local in your class if specific to the application ). 

Make any changes you want, and let me know what you think ( I spent a lot
of time for XmlMapper...)

Costin