01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.oldboss.framework.bo;
16:
17: import com.metaboss.enterprise.bo.BOException;
18:
19: /**
20: * Definition of the generic Domain Object Transaction Interface
21: * The transaction object allows to :
22: * (1) "Add" (better word associate) any number of any Domain Business Objects to it
23: * (2) Commit all changes to all domain business objects at once
24: * (3) Rollback all changes to all domain business onbects at once
25: */
26: public interface BOTransaction {
27: /** Naming URL of the component */
28: public static final String COMPONENT_URL = "component:/com.oldboss.framework.bo.BOTransaction";
29:
30: /**
31: * This method commits all the changes to all BOs associated with this transaction
32: * The order in which BOs will be comitted is corresponding to the
33: * order in which they were "added" to the transaction
34: * After Commit has succeeded:
35: * - Deleted BOs will remain deleted and unusable - have to be deleted
36: * - New BOS will become existing readonly and no longer associated with this Tx
37: * - Existing BOs will become existing readonly and no longer associated with this Tx
38: * - This transaction object itself is unusable and has to be deleted
39: */
40: public void doCommit() throws BOException;
41:
42: /**
43: * This method rollsback all the changes to all BOs associated with this transaction
44: * The order in which BOs will be rolled back is corresponding to the
45: * order in which they were "added" to the transaction
46: * After Rollback has succeeded:
47: * - Deleted New BOs will remain deleted and unusable - have to be deleted
48: * - Deleted Existing BOs will become existing read only and no longer associated with this Tx
49: * - New BOs will become deleted and unusable - have to be deleted
50: * - Existing BOs will become existing readonly and no longer associated with this Tx
51: * - This transaction object itself is unusable and has to be deleted
52: */
53: public void doRollback() throws BOException;
54:
55: /**
56: * This method retruns true if transaction is active, that is it has not been committed or rolled back yet
57: * @return boolean true if transaction is active
58: */
59: public boolean isActive();
60: }
|