001// 002// NAME 003// TransactionNotifier.java 004// 005// COPYRIGHT 006// Copyright 2007-2014 Cloud Software Group, Inc. ALL RIGHTS RESERVED. 007// Cloud Software Group, Inc. Confidential Information 008// 009// HISTORY 010// $Revision: 1.1.2.84 $ $Date: 2014/02/06 20:35:16 $ 011// 012// WARNINGS 013// THIS FILE IS GENERATED, DO NOT EDIT 014// 015 016package com.kabira.platform.swbuiltin; 017 018import java.util.*; 019import com.kabira.platform.annotation.*; 020 021 022/** 023<p> 024 Transaction notifier 025<p> 026<p> 027This class is used for prepare, commit and 028abort callbacks for the current transaction. Users extend 029this class and implement any or all of the 030onPrepare(), onCommit() and onRollback() methods. 031<p> 032Creating an instance of this class enables the 033prepare, commit and abort callbacks for the current 034transaction. 035<p> 036If this class is deleted before the prepare, commit or 037abort, the callbacks will not be invoked. 038<p> 039The instance will automatically delete itself at the 040end of the transaction. 041<p> 042Because onCommit and onRollback are called at transaction 043commit or abort time, these methods are not allowed to 044lock any new objects or resources, or promote any existing 045read locks to write locks. This will result in a fatal 046runtime exception. They are allowed to access any objects 047or resources that are currently locked in the transaction. 048<p> 049The onPrepare operation is allowed to perform additional 050work within the transaction. If a system exception is 051thrown in onPrepare, the exception is propagated to the 052caller and the transaction rolled back. 053<p> 054Transaction notifier callbacks are always 055executed on the local node, even if the notifier 056instance is a distributed reference. 057 058 059*/ 060 061@Managed 062public class TransactionNotifier 063{ 064 private static final String _RuntimeType = "swbuiltin::TransactionNotifier"; 065 066/** 067Create a new TransactionNotifier 068 069*/ 070 public TransactionNotifier() 071 { 072 super(); 073 } 074 075 076 /** 077 <p> 078 Prepare notification 079<p> 080 Called when the transaction that this 081 instance was created in does a prepare. 082 083 084 */ 085 086 public native void onPrepare(); 087 088 089 /** 090 <p> 091 Prepare notification 092<p> 093 Called when the transaction that this 094 instance was created in does a prepare. 095 096 097 */ 098 099 private native void onPrepare_super(); 100 101 102 /** 103 <p> 104 Commit notification 105<p> 106 Called when the transaction that this 107 instance was created in commits. 108 109 110 */ 111 112 public native void onCommit(); 113 114 115 /** 116 <p> 117 Commit notification 118<p> 119 Called when the transaction that this 120 instance was created in commits. 121 122 123 */ 124 125 private native void onCommit_super(); 126 127 128 /** 129 <p> 130 Abort notification 131<p> 132 Called when the transaction that this 133 instance was created in aborts. 134 135 136 */ 137 138 public native void onRollback(); 139 140 141 /** 142 <p> 143 Abort notification 144<p> 145 Called when the transaction that this 146 instance was created in aborts. 147 148 149 */ 150 151 private native void onRollback_super(); 152 153}