com.sun.jini.outrigger.snaplogstore
Class PendingTxn

java.lang.Object
  extended by com.sun.jini.outrigger.snaplogstore.PendingTxn
All Implemented Interfaces:
Serializable

 class PendingTxn
extends Object
implements Serializable

This object represents a pending transaction in a BackEnd. As operations are performed under the transaction, they are logged into this object. When the transaction is committed, each operation is committed into the DB.

Author:
Sun Microsystems, Inc.

Nested Class Summary
(package private) static class PendingTxn.PendingOp
          A superclass for the objects that represent pending operations.
(package private) static class PendingTxn.TakeOp
          An object that represents a pending take.
(package private) static class PendingTxn.WriteOp
          An object that represents a pending write.
 
Field Summary
private  long id
           
private  Hashtable ops
           
private  int state
           
private  StoredObject transaction
           
 
Constructor Summary
PendingTxn(Long id)
          Create a new PendingTxn for the given id.
 
Method Summary
(package private)  void addTake(byte[] cookie)
          Add a new pending take operation.
(package private)  void addWrite(Resource entry)
          Add a new pending write operation.
(package private)  void commit(BackEnd processor)
          Commit all the operations by invoking the relevant method on the processor object.
 boolean equals(Object o)
           
(package private)  Resource get(ByteArrayWrapper cookie)
          Get a pending write resource.
 int hashCode()
           
(package private)  void prepare(StoredObject tr)
          Set the Transaction object.
(package private)  boolean recover(Recover space)
          Recover prepared transactions.
(package private)  Resource remove(ByteArrayWrapper cookie)
          Remove a pending write.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private long id

state

private int state

ops

private Hashtable ops

transaction

private StoredObject transaction
Constructor Detail

PendingTxn

PendingTxn(Long id)
Create a new PendingTxn for the given id.

Method Detail

addWrite

void addWrite(Resource entry)
Add a new pending write operation.


addTake

void addTake(byte[] cookie)
Add a new pending take operation.


get

Resource get(ByteArrayWrapper cookie)
Get a pending write resource.


remove

Resource remove(ByteArrayWrapper cookie)
Remove a pending write.


recover

boolean recover(Recover space)
          throws Exception
Recover prepared transactions. This method returns true if this pending transaction was recovered.

Throws:
Exception

prepare

void prepare(StoredObject tr)
Set the Transaction object.


commit

void commit(BackEnd processor)
Commit all the operations by invoking the relevant method on the processor object.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.