01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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;
25: import javax.resource.spi.work.Work;
26: import javax.resource.spi.work.WorkCompletedException;
27: import javax.transaction.xa.Xid;
28:
29: /**
30: * Extends XATerminator to include registration calls
31: *
32: * @author <a href="adrian@jboss.com">Adrian Brock</a>
33: * @version $Revision: 57208 $
34: */
35: public interface JBossXATerminator extends XATerminator {
36: /**
37: * Invoked for transaction inflow of work
38: *
39: * @param work the work starting
40: * @param xid the xid of the work
41: * @param timeout the transaction timeout
42: * @throws WorkCompletedException with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED
43: * when work is already present for the xid or whose completion is in progress, only
44: * the global part of the xid must be used for this check.
45: */
46: void registerWork(Work work, Xid xid, long timeout)
47: throws WorkCompletedException;
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 work, Xid xid) throws WorkCompletedException;
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 work, Xid 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 work, Xid xid);
73: }
|