On Tue, May 25, 2004 at 10:00:43AM +0200, Vincent Massol wrote:
> Thanks David,
> 
> I'll try this. I'm still interested in your idea about using DOM to pass
> the openejb.xml file. Is there any API to initialize OpenEJB that
> accepts a DOM, InputStream, URL, etc?

You can set openejb.configuration to the path of a file on disk, but
that's it I think.  We could maybe add something later, but this would
certainly work for now in your setup class:

   File file = File.createTempFile( "openejb-conf", ".xml", null );
   file.deleteOnExit();
   
That would create a temp file located in the system temp directory
that will be deleted when the VM exists.  OpenEJB is going to create
one of those for every ejb jar you deploy anyway as we need to
validate your jar in it's own classloader before bringing it into the
classpath of the main classloader.

Not as fancy as you wanted, but that is definitely the approach I'd
take if I were in your shoes.  You're really just looking to hide the
openejb.xml file from users in the situations where they aren't
looking to do anything fancy.  We definitely are working to support
this.

We basically want there to be no configs at all for the common case.
In the 1.0 branch we eliminated the need for an openejb-jar.xml on
ejb-jar.xml files without cmps or multiple resource-refs.  We want to
do the same thing for the openejb.xml, but want to make it a little
better than just picking defaults.  

It will get there though, and when it does, any work you do now will
be unnecessary.  I'd just get the setup working now in the simplest
way possible and rest assured that you will be able to delete most of
the code when we catch up.

Any way you want to create it, the following config file is all we
need to run any statless, stateful, or BMP entity bean.  CMP entities
require mapping and OQL for finder methods and all sorts of
requirements for users to meet.

<openejb>
    <Container id="Default BMP Container" ctype="BMP_ENTITY" />
    <Container id="Default Stateful Container" ctype="STATEFUL" />
    <Container id="Default Stateless Container" ctype="STATELESS" />
    <Connector id="Default JDBC Database">
        JdbcDriver   org.axiondb.jdbc.AxionDriver
        JdbcUrl      jdbc:axiondb:DefaultDatabase
    </Connector>
    <Deployments dir="some/path/" />
</openejb>

Like I say, we've already got a few ideas on how to get rid of even
this small amount of config data.

-David

Reply via email to