This topic has not yet been written. The content below is from the topic description.
Rather than show all of the code for the client, this example concentrates on a representative portion. Before invoking operations on the object, the client must first bind to the object. In the local case this simply requires the client to create an instance of the object. Example 6.9. Binding to the Object public static void main (String[] args) { TransactionalQueue myQueue = new TransactionalQueue(); Before invoking one of the queue’s operations, the client starts a transaction. The queueSize operation is shown below: AtomicAction A = new AtomicAction(); int size = 0; try { A.begin(0); try { size = queue.queueSize(); } catch (Exception e) { } if (size >= 0) { A.commit(true); System.out.println(“Size of queue: “+size); } else A.rollback(); } catch (Exception e) { System.err.println(“Caught unexpected exception!�); } }