You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oz...@apache.org on 2004/07/12 16:47:41 UTC

cvs commit: jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa AbstractTransactionalResource.java AbstractXAResource.java TransactionalResource.java

ozeigermann    2004/07/12 07:47:41

  Modified:    transaction/src/java/org/apache/commons/transaction/util/xa
                        AbstractTransactionalResource.java
                        AbstractXAResource.java TransactionalResource.java
  Log:
  Removed confusing close method and added Javadocs
  
  Revision  Changes    Path
  1.3       +3 -5      jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/AbstractTransactionalResource.java
  
  Index: AbstractTransactionalResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/AbstractTransactionalResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractTransactionalResource.java	12 Jul 2004 14:28:37 -0000	1.2
  +++ AbstractTransactionalResource.java	12 Jul 2004 14:47:41 -0000	1.3
  @@ -25,7 +25,6 @@
   
   import javax.transaction.Status;
   import javax.transaction.xa.XAException;
  -import javax.transaction.xa.XAResource;
   import javax.transaction.xa.Xid;
   
   /**
  @@ -44,7 +43,6 @@
       public abstract void commit() throws XAException;
       public abstract void rollback() throws XAException;
       public abstract int prepare() throws XAException;
  -    public abstract void close() throws XAException;
   
       public int getStatus() {
           return status;
  
  
  
  1.3       +3 -4      jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java
  
  Index: AbstractXAResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/AbstractXAResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractXAResource.java	1 Jul 2004 09:28:33 -0000	1.2
  +++ AbstractXAResource.java	12 Jul 2004 14:47:41 -0000	1.3
  @@ -56,7 +56,6 @@
           if (ts == null) {
               throw new XAException(XAException.XAER_NOTA);
           }
  -        ts.close();
           setCurrentlyActiveTransactionalResource(null);
           removeActiveTransactionalResource(xid);
       }
  
  
  
  1.3       +51 -5     jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/TransactionalResource.java
  
  Index: TransactionalResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/util/xa/TransactionalResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransactionalResource.java	1 Jul 2004 09:28:33 -0000	1.2
  +++ TransactionalResource.java	12 Jul 2004 14:47:41 -0000	1.3
  @@ -31,11 +31,57 @@
    */
   public interface TransactionalResource {
   
  +    /**
  +     * Commits the changes done inside this transaction reasource. This can mean
  +     * to call commit on a connection associated to the resource or any other
  +     * action that needs to be taken to make changes in this resource permanent.
  +     * 
  +     * @throws XAException
  +     *             when anything goes wrong the error must be described in XA
  +     *             notation
  +     */
       public void commit() throws XAException;
  +
  +    /**
  +     * Prepares the changes done inside this transaction reasource. Same
  +     * semantics as {@link XAResource.prepare(Xid)}.
  +     * 
  +     * @throws XAException
  +     *             when anything goes wrong the error must be described in XA
  +     *             notation
  +     */
       public int prepare() throws XAException;
  +
  +    /**
  +     * Rolls back the changes done inside this transaction reasource. This can mean
  +     * to call roll back on a connection associated to the resource or any other
  +     * action that needs to be taken to undo the changes in this resource permanent.
  +     * 
  +     * @throws XAException
  +     *             when anything goes wrong the error must be described in XA
  +     *             notation
  +     */
       public void rollback() throws XAException;
  -    public void close() throws XAException;
  +
  +    /**
  +     * Returns the current status of this transaction resource.
  +     * 
  +     * @return the current status of this resource as defined by {@link Status}.
  +     */
       public int getStatus();
  +
  +    /**
  +     * Sets the status of this transctional resource. The status set by this method
  +     * must be available over {@link #getStatus()} afterwards.
  +     * @param status the status to be set
  +     */
       public void setStatus(int status);
  +
  +    /**
  +     * Returns the Xid this transctional resource is associated with. This might have been set in
  +     * the constructor of implementing classes. 
  +     *  
  +     * @return the xid this transctional resource is associated with
  +     */
       public Xid getXid();
  -}
  +}
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org