KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tm > JBossXATerminator


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.tm;
23
24 import javax.resource.spi.XATerminator JavaDoc;
25 import javax.resource.spi.work.Work JavaDoc;
26 import javax.resource.spi.work.WorkCompletedException JavaDoc;
27 import javax.transaction.xa.Xid JavaDoc;
28
29 /**
30  * Extends XATerminator to include registration calls
31  *
32  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
33  * @version $Revision: 37459 $
34  */

35 public interface JBossXATerminator extends XATerminator JavaDoc
36 {
37    /**
38     * Invoked for transaction inflow of work
39     *
40     * @param work the work starting
41     * @param xid the xid of the work
42     * @param timeout the transaction timeout
43     * @throws WorkCompletedException with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED
44     * when work is already present for the xid or whose completion is in progress, only
45     * the global part of the xid must be used for this check.
46     */

47    void registerWork(Work JavaDoc work, Xid JavaDoc xid, long timeout) throws WorkCompletedException JavaDoc;
48    
49    /**
50     * Invoked for transaction inflow of work
51     *
52     * @param work the work starting
53     * @param xid the xid of the work
54     * @throws WorkCompletedException with error code WorkException.TX_RECREATE_FAILED if it is unable to recreate the transaction context
55     */

56    void startWork(Work JavaDoc work, Xid JavaDoc xid) throws WorkCompletedException JavaDoc;
57
58    /**
59     * Invoked when transaction inflow work ends
60     *
61     * @param work the work ending
62     * @param xid the xid of the work
63     */

64    void endWork(Work JavaDoc work, Xid JavaDoc xid);
65
66    /**
67     * Invoked when the work fails
68     *
69     * @param work the work ending
70     * @param xid the xid of the work
71     */

72    void cancelWork(Work JavaDoc work, Xid JavaDoc xid);
73 }
74
Popular Tags