Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 88343 invoked from network); 29 Dec 1999 19:45:53 -0000 Received: from unknown (HELO arkin.exoffice.com) (root@207.33.160.104) by 63.211.145.10 with SMTP; 29 Dec 1999 19:45:53 -0000 Received: from exoffice.com (IDENT:arkin@arkin.exoffice.com [207.33.160.104]) by arkin.exoffice.com (8.9.3/8.9.3) with ESMTP id LAA00733; Wed, 29 Dec 1999 11:59:39 -0800 Sender: arkin@arkin.exoffice.com Message-ID: <386A682B.529E00A2@exoffice.com> Date: Wed, 29 Dec 1999 11:59:39 -0800 From: Assaf Arkin Organization: Exoffice X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.13 i686) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org, jwtodd@pacbell.net CC: kvisco@exoffice.com Subject: Re: [LONG TERM PLAN] Proposed Architecture for Tomcat.NextServletContainer References: <38691FD0.ACA719C@exoffice.com> <38693E55.B129B304@apache.org> <38695DC0.B77C4078@exoffice.com> <386A0CCE.FE7F9CE1@pacbell.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > can you share more info on this? i'm doing pretty much the same thing > but haven't had time to make the xml to/from java as clean as i'd like. > i know it can be done and have some thoughts in mind but i'd love to > hear some thoughts from those that have been there/done that. > > i'll take whatever you can offer; class sigs, ascii diags, methodologies, > api's, patterns, etc. if others aren't interested in this please feel free to I can do better than that. I can give you a working implementation, fully open source. Go to http://castor.exolab.org, download the latest release (0.6). You will also need ftp://ftp.exolab.org/pub/jars/xerces.jar since it depends on the serializer API found there. Xerces and ProjectX can coexist in the same classpath, and I'm happily running Tomcat with both. The two most interesting classes there are org.exolab.castor.xml.Marshaller (Java -> XML) and org.exolab.castor.xml.Unmarshaller (XML -> Java). You don't need much documentation to get them up running :-) The trivial Java - XML mapping is done automatically for you by the framework, e.g. an element called server will map to a class called Server, an attribute called sql-name will map to getSqlName/setSqlName methods. The non trivial mapping (e.g. different naming, mapping based on class name attribute, element/attribute switches, etc) relies on MarshalInfo descriptors (modeled after the JavaBean descriptors). There's an XML Schema -> Java source code generator that can do most of the work for you. Unfortunately, documentation is a bit lacking at this point, so I suggest you fire an email directly to Keith (kvisco@exoffice.com) for any question you have. If you're looking for sample code for the non-trivial examples I've described, download the Tyrex sources from tyrex.exolab.org and look in the directory src/main/tyrex/conf. There's enough samples in there to cover all the bases :-) If anyone is willing to help with documentations and sample code, that would be greatly appreciated. arkin > > fire me a private message. this specific is near'n dear to me at the > moment as i've got to get our infrastructure fleshed out so that it is > trivial to add in new java/xml tuples. > > at this time i'm using: > > jdk 1.2.2 > tomcat: http server, servlet engine > project-x: xml parser > > thx much, > > - james > > > > > > > In the Tyrex configuration file I have some non trivial cases, e.g. I > > need to map an element to an object type specified in one of the > > object's attribute. The element maps to a generic DataSource interface, > > but the actual object created and configured is an implementation of > > this interface that can have any arbitrary set of properties that can't > > be expressed in a fixed DTD. Works like a charm. > > > > I also get to map the same object to two different element types, where > > the DTD (element name and attribute list differ) but the same > > implementation can be used in both cases. Also works like a charm. > > > > And in case we get too generic, a portion of the file can always be > > delegated as SAX events to some consumer, which we're using for the DSML > > portions that are handled by a direct DSML->LDAP mapping. > > > > arkin > > > > > -- > > > Stefano Mazzocchi One must still have chaos in oneself to be > > > able to give birth to a dancing star. > > > Friedrich Nietzsche > > > -------------------------------------------------------------------- > > > Come to the first official Apache Software Foundation Conference! > > > ------------------------- http://ApacheCon.Com --------------------- > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org