ozone core API

org.ozoneDB.core
Class FixHack

java.lang.Object
  extended byorg.ozoneDB.core.Transaction
      extended byorg.ozoneDB.core.FixHack
All Implemented Interfaces:
Locker

class FixHack
extends Transaction


Field Summary
 
Fields inherited from class org.ozoneDB.core.Transaction
acquireCount, blocker, blockTimeout, callStack, commandCount, deadlocked, deadlockWaitTimeMaximum, deadlockWaitTimeMaximumMaximum, deadlockWaitTimeMaximumMinimum, env, HASHTABLE_INIT_SIZE, maxLockLevel, owner, ownerName, rollbackOnly, sleeping, startTime, status, STATUS_ABORTED, STATUS_ABORTING, STATUS_COMMITED, STATUS_COMMITING, STATUS_NONE, STATUS_PREPARED, STATUS_PREPARING, STATUS_STARTED, stopped, taID
 
Constructor Summary
(package private) FixHack(TransactionID taID)
           
 
Method Summary
 void abort(DbCommand command)
          Once this method is called it MUST cleanup the entire transaction stuff without exception.
protected  ObjectContainer acquireContainer(ObjectContainer container, int lockLevel)
           
 ObjectContainer acquireObject(ObjectID id, int lockLevel)
          Set a lock on the container specified by the given object ID and join the container to this transaction.
 Lockable blockedBy()
          Helper method to implement the Locker interface to support deadlock recognition via core.dr package
protected  void callOnActivateIfNeeded(ObjectContainer container)
           
protected  void callOnPassivateIfNeeded(ObjectContainer container)
           
 void commit()
          Commit this transaction.
 ObjectContainer copyObject(ObjectID id)
           
 ObjectContainer createObject(java.lang.String className, int access, java.lang.String name, java.lang.String sig, java.lang.Object[] args, ObjectID id)
          Create a new database object.
 void deleteObject(ObjectID id)
           
 boolean equals(java.lang.Object obj)
           
 org.ozoneDB.data.SimpleArrayList getCallStack()
           
protected  long getDeadlockWaitTimeMaximum()
           
 TransactionManager getManager()
           
protected  long increaseDeadlockWaitTimeMaximum()
           
 java.lang.Object invokeObject(ObjectID id, int methodIndex, java.lang.Object[] args, int lockLevel)
           
 java.lang.Object invokeObject(ObjectID id, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args, int lockLevel)
           
 boolean isBlocked()
          Returns wether this locker is blocked.
 boolean isDeadlocked()
           
protected  boolean isSleeping()
           
 int maxLockLevel()
           
 void nameObject(ObjectID id, java.lang.String name)
           
 org.ozoneDB.OzoneProxy objectForID(ObjectID id)
           
 org.ozoneDB.OzoneProxy objectForName(java.lang.String name)
           
 DxSet objectNames()
           
 User owner()
           
 boolean performCommand(DbCommand command)
           
 void prepareCommit()
           
 void releaseObject(ObjectContainer objectContainer)
          The corresponding method to acquireObject(org.ozoneDB.core.ObjectID, int).
 void requireWriteLockingCallByUser(ObjectContainer container)
          A user calls OzoneObject.requireWriteLocking().
 void reset()
           
 void setDeadlocked(boolean to)
           
protected  void setDeadlockWaitTimeMaximum(long to)
           
 void sleep(long millis)
           
 int status()
           
 void stop()
           
 TransactionID taID()
           
 
Methods inherited from class org.ozoneDB.core.Transaction
finalize, toString
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixHack

FixHack(TransactionID taID)
Method Detail

stop

public void stop()
Overrides:
stop in class Transaction

reset

public void reset()
Overrides:
reset in class Transaction

setDeadlockWaitTimeMaximum

protected void setDeadlockWaitTimeMaximum(long to)
Overrides:
setDeadlockWaitTimeMaximum in class Transaction

getDeadlockWaitTimeMaximum

protected long getDeadlockWaitTimeMaximum()
Overrides:
getDeadlockWaitTimeMaximum in class Transaction

increaseDeadlockWaitTimeMaximum

protected long increaseDeadlockWaitTimeMaximum()
Overrides:
increaseDeadlockWaitTimeMaximum in class Transaction

setDeadlocked

public void setDeadlocked(boolean to)
Specified by:
setDeadlocked in interface Locker
Overrides:
setDeadlocked in class Transaction

isDeadlocked

public boolean isDeadlocked()
Specified by:
isDeadlocked in interface Locker
Overrides:
isDeadlocked in class Transaction

status

public int status()
Overrides:
status in class Transaction

owner

public User owner()
Overrides:
owner in class Transaction

maxLockLevel

public int maxLockLevel()
Overrides:
maxLockLevel in class Transaction

releaseObject

public void releaseObject(ObjectContainer objectContainer)
Description copied from class: Transaction
The corresponding method to Transaction.acquireObject(org.ozoneDB.core.ObjectID, int).
It calls on passivate and unpins the container

Overrides:
releaseObject in class Transaction

callOnPassivateIfNeeded

protected void callOnPassivateIfNeeded(ObjectContainer container)
Overrides:
callOnPassivateIfNeeded in class Transaction

acquireObject

public ObjectContainer acquireObject(ObjectID id,
                                     int lockLevel)
                              throws org.ozoneDB.ObjectNotFoundException,
                                     java.io.IOException,
                                     java.lang.ClassNotFoundException,
                                     org.ozoneDB.TransactionException,
                                     TransactionError
Description copied from class: Transaction
Set a lock on the container specified by the given object ID and join the container to this transaction. If a container is returned, it is pinned. Thus, it has to be unpinned by the caller.

Overrides:
acquireObject in class Transaction
Parameters:
id - ObjectID of the container which we try to join to this transaction.
lockLevel - The lock level we need on this object (container).
Returns:
The container for the specified id, if all was ok.
Throws:
org.ozoneDB.ObjectNotFoundException - If there is no such object.
java.io.IOException
java.lang.ClassNotFoundException
org.ozoneDB.TransactionException
TransactionError

callOnActivateIfNeeded

protected void callOnActivateIfNeeded(ObjectContainer container)
Overrides:
callOnActivateIfNeeded in class Transaction

acquireContainer

protected ObjectContainer acquireContainer(ObjectContainer container,
                                           int lockLevel)
                                    throws PermissionError,
                                           org.ozoneDB.TransactionException,
                                           TransactionError,
                                           java.io.IOException,
                                           org.ozoneDB.ObjectNotFoundException,
                                           java.lang.ClassNotFoundException
Overrides:
acquireContainer in class Transaction
Throws:
PermissionError
org.ozoneDB.TransactionException
TransactionError
java.io.IOException
org.ozoneDB.ObjectNotFoundException
java.lang.ClassNotFoundException

requireWriteLockingCallByUser

public void requireWriteLockingCallByUser(ObjectContainer container)
Description copied from class: Transaction
A user calls OzoneObject.requireWriteLocking(). This means that no user-visible declaed exceptions can be thrown. Thus, the same measures regarding catching and wrapping exceptions have to be taken as in Transaction.invokeObject(org.ozoneDB.core.ObjectID, java.lang.String, java.lang.String, java.lang.Object[], int).

Overrides:
requireWriteLockingCallByUser in class Transaction

performCommand

public boolean performCommand(DbCommand command)
Overrides:
performCommand in class Transaction

prepareCommit

public void prepareCommit()
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Overrides:
prepareCommit in class Transaction
Throws:
java.io.IOException
java.lang.ClassNotFoundException

commit

public void commit()
            throws java.io.IOException,
                   java.lang.ClassNotFoundException
Description copied from class: Transaction
Commit this transaction. The transaction has to be in PREPARED state. Ones this method is called it MUST commit the entire transaction stuff without any exception.

Overrides:
commit in class Transaction
Throws:
java.io.IOException
java.lang.ClassNotFoundException

abort

public void abort(DbCommand command)
           throws java.io.IOException,
                  java.lang.ClassNotFoundException
Description copied from class: Transaction
Once this method is called it MUST cleanup the entire transaction stuff without exception. An exception signals an internal server error.

Note: This may be called after/from prepareCommit() !

Overrides:
abort in class Transaction
Throws:
java.io.IOException
java.lang.ClassNotFoundException

blockedBy

public Lockable blockedBy()
Description copied from class: Transaction
Helper method to implement the Locker interface to support deadlock recognition via core.dr package

Specified by:
blockedBy in interface Locker
Overrides:
blockedBy in class Transaction

isBlocked

public boolean isBlocked()
Description copied from class: Transaction
Returns wether this locker is blocked.

Specified by:
isBlocked in interface Locker
Overrides:
isBlocked in class Transaction

createObject

public ObjectContainer createObject(java.lang.String className,
                                    int access,
                                    java.lang.String name,
                                    java.lang.String sig,
                                    java.lang.Object[] args,
                                    ObjectID id)
                             throws java.lang.Exception,
                                    org.ozoneDB.OzoneObjectException
Description copied from class: Transaction
Create a new database object. If the className is null, an empty container is created.

Overrides:
createObject in class Transaction
Parameters:
className -
access -
name -
id - The ID of the new container or null.
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

copyObject

public ObjectContainer copyObject(ObjectID id)
                           throws java.lang.Exception
Overrides:
copyObject in class Transaction
Throws:
java.lang.Exception

deleteObject

public void deleteObject(ObjectID id)
                  throws org.ozoneDB.ObjectNotFoundException,
                         java.io.IOException,
                         java.lang.ClassNotFoundException,
                         org.ozoneDB.TransactionException,
                         TransactionError,
                         org.ozoneDB.OzoneRemoteException,
                         org.ozoneDB.OzoneInternalException,
                         org.ozoneDB.OzoneObjectException
Overrides:
deleteObject in class Transaction
Throws:
org.ozoneDB.ObjectNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
org.ozoneDB.TransactionException
TransactionError
org.ozoneDB.OzoneRemoteException
org.ozoneDB.OzoneInternalException
org.ozoneDB.OzoneObjectException

invokeObject

public java.lang.Object invokeObject(ObjectID id,
                                     java.lang.String methodName,
                                     java.lang.String sig,
                                     java.lang.Object[] args,
                                     int lockLevel)
                              throws java.lang.Exception,
                                     org.ozoneDB.OzoneObjectException
Overrides:
invokeObject in class Transaction
Parameters:
id -
methodName -
sig -
lockLevel -
Returns:
the result of the invocation
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

invokeObject

public java.lang.Object invokeObject(ObjectID id,
                                     int methodIndex,
                                     java.lang.Object[] args,
                                     int lockLevel)
                              throws java.lang.Exception,
                                     org.ozoneDB.OzoneObjectException
Overrides:
invokeObject in class Transaction
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

nameObject

public void nameObject(ObjectID id,
                       java.lang.String name)
                throws java.lang.Exception
Overrides:
nameObject in class Transaction
Throws:
java.lang.Exception

objectNames

public DxSet objectNames()
                  throws java.lang.Exception
Overrides:
objectNames in class Transaction
Throws:
java.lang.Exception

objectForName

public org.ozoneDB.OzoneProxy objectForName(java.lang.String name)
                                     throws java.lang.Exception
Overrides:
objectForName in class Transaction
Throws:
java.lang.Exception

objectForID

public org.ozoneDB.OzoneProxy objectForID(ObjectID id)
                                   throws java.lang.Exception
Overrides:
objectForID in class Transaction
Throws:
java.lang.Exception

sleep

public void sleep(long millis)
Overrides:
sleep in class Transaction

isSleeping

protected boolean isSleeping()
Overrides:
isSleeping in class Transaction

taID

public TransactionID taID()
Overrides:
taID in class Transaction

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Transaction

getCallStack

public org.ozoneDB.data.SimpleArrayList getCallStack()
Overrides:
getCallStack in class Transaction

getManager

public TransactionManager getManager()
Overrides:
getManager in class Transaction

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.