You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Alejandro Guízar <00...@academ01.ccm.itesm.mx> on 2004/08/15 09:32:53 UTC

Application Server and Slide integration

I just got the time to put my stuff together. This work is about enlisting
Slide in JTA transactions when using the API directly. For additional
information, please refer to the topic "Application Server and Slide
Application integration" in the mailing list.

The main contribution is subclassing ExtendedStore (attached as
ExternalTransactionStore.java) to allow for an extra parameter that
specifies the JNDI name of the transaction manager.

I had to alter org.apache.slide.common.AbstractService (attached as
AbstractService.java). There are a few comparisons of the form:
"currentContext.getGlobalTransactionId() !=
                xid.getGlobalTransactionId()"
that don't work for JBoss' implementation of Xid, because
getGlobalTransactionId() returns a clone of the internal field value. 

Comparing by value solves the problem:
"!Arrays.equals(currentContext.getGlobalTransactionId(),
              xid.getGlobalTransactionId())"

Lastly, Namespace has to expose a method to override the default transaction
manager.

package org.apache.slide.common;
public final class Namespace {
  /**
   * Allows for overriding the default transaction manager used by this
   * namespace.
   * @param transactionManager the new transaction manager
   */
  public void initTransactionManager(
      TransactionManager transactionManager) {
    if (this.transactionManager instanceof SlideTransactionManager) {
      this.transactionManager = transactionManager;
    }
  }
}

I'm attaching a sample domain configuration file (SlideDomain.xml) using the
new store. Also attached is a sample datasource configuration
(repository-ds.xml) that works with JBoss. Note that no dependency on JBoss
is created; the only requirement is that the app server makes its
transaction manager available through JNDI.

Please tell me if everything is ok.

-Alejandro

--- Original message ---
Why not use the wrapper classes that fake 2P commit? They should work...

Concerning the usefulness of your implementation, you just name it, if
anyone wants to go directly to the Slide API and not use the WebDAV layer
the JCA approach is useless.

Could you please find a datasource configuration that works with JBoss and
submit all needed info / classes / config to have it in in JBoss.

Please, also add the ASF copyright and the slide package header to your
classes. I will add your stuff to the CVS then.

RE: Application Server and Slide integration

Posted by Alejandro Guízar <00...@academ01.ccm.itesm.mx>.
Forgot to attach the classes! Here they are.

-Alejandro