I'm thinking about creating a jboss service that provides access to a
version of xindice embeded as a JBoss JMX service.
I want the mbean to manage the lifecycle of the database instance. So the
first place I looked was the XindiceServlet, but this doesn't seem to
register itself into the DatabaseManager environment (though the rest of
loading the config up looked good).
Next I thought about using the embeded driver. A couple of things have
stopped me there. The first is that the config is either loaded from the
location determined by the xindice.home system variable, or the default
config. A bit of refactoring would allow me to seperate the config loading
code into a protected method and load the config via a custom subclass so
that looked doable. The second was a call at the end of the constructor:
this.db = Database.getDatabase(dbname);
if (this.db == null) {
this.db = new Database();
}
if (log.isInfoEnabled()) {
log.info("Database name: '" + dbname + "'");
}
db.setConfig(config);
So it looked as though my database config would be over written if the
user constructed a new embeded.
Another issue with the embeded is shutdown. I'm not sure when it's called.
It's easy to see with the servlet and I want to make sure it's nicley
cleaned up when jboss shuts down.
So I'm a little unsure what I should do. Ideally I would be able to create
the instance and then users could call the normal register stuff (which
would be ignored as the database already existed). I suppose I could
create an embeded subclass on a different uri or an mbean iml, but I
thought I'd hit the list first.
-k.