You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Kevin O'Neill <ke...@rocketred.com.au> on 2003/07/01 10:31:40 UTC

JBoss Service

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.


Re: JBoss Service

Posted by Per Nyfelt <pe...@resourcing.se>.
Hi Kevin,

I did this (turned xindice into a JMX based JBoss service) and posted the code 
to the mailing list several months ago. The tight dependencies on JBoss code 
stopped it from finding its way into scratchpad but if you cannot find it in 
the archive send me an email privately and I'll send you the code.

Best regards,
Per

On Tuesday 01 July 2003 10.31, Kevin O'Neill wrote:
> 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.