> -----Original Message----- > From: David Blevins [mailto:[EMAIL PROTECTED] > Sent: 24 May 2004 19:49 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [openejb-user] Java API to configure openEJB? > > On Mon, May 24, 2004 at 10:36:45AM +0200, Vincent Massol wrote: > > I was more thinking about a Java API rather than properties. My need is > > to embed openEjb in java code so it's easier to call a Java API than to > > use some properties. For example: > > > > public void addEjbJar(File ejbjar); > > public void createContainer(...); > > etc > > > > > How would you feel about two system properties for this, something > > like: > > > openejb.conf.deployment.dirs=<classpath-style dir list> > > > openejb.conf.deployment.jars=<classpath-style jar list> > > > > > > > Sure, but I think it would be even better to have: > > > > public void addEjbJar(File ejbjar); > > Well, we do have methods that look like that in our code, but it's very > hard to support them for integration purposes as they are what I would > call "dirty internals" and have more to do with Castor XML usage and > generated objects than OpenEJB. That code is already gone in OpenEJB 2.
I think a nice strategy for any Java embeddable application/framework is to always offer a Java API for everything. Then as a second layer, offering a XML configuration file or other configuration front is always nice for end user usability. However, the java API is really useful when it comes to embedding/reusing. This is really what I love in Jetty. It's 100% java and the XML configuration file is only a byproduct. It really makes it embeddable. >From what I've read here and there, one important feature of openEJB is its embeddability. Thus having a 100% java API makes sense to me. Anyway, that's just some user feedback, take it with a pinch of salt :-) > > What about using DOM to create the four or five XML tags required in an > openejb.xml file? A very good idea! I'll play with this. How do I pass a DOM object to configure openEJB? >From what I gathered that container is configured by calling OpenEJB.init(...). However the parameter is a Properties element and the EnvProps.CONFIGURATION property seems to be pointing to a String. Any other API I can use? Thanks -Vincent
