org.multiverse.stms.alpha.programmatic
Class AlphaProgrammaticLong

java.lang.Object
  extended by org.multiverse.stms.alpha.mixins.DefaultTxObjectMixin
      extended by org.multiverse.stms.alpha.programmatic.AlphaProgrammaticLong
All Implemented Interfaces:
org.multiverse.api.commitlock.CommitLock, org.multiverse.api.programmatic.ProgrammaticLong, org.multiverse.MultiverseConstants, AlphaTransactionalObject

public final class AlphaProgrammaticLong
extends DefaultTxObjectMixin
implements org.multiverse.api.programmatic.ProgrammaticLong

The AlphaStm specific implementation of the ProgrammaticLong.

Author:
Peter Veentjer

Field Summary
 
Fields inherited from interface org.multiverse.MultiverseConstants
___SANITY_CHECKS_ENABLED
 
Constructor Summary
AlphaProgrammaticLong(AlphaStm stm, long value)
           
AlphaProgrammaticLong(AlphaTransaction tx, long value)
           
AlphaProgrammaticLong(long value)
           
 
Method Summary
 AlphaTranlocal ___openForCommutingOperation()
          Opens this AlphaTransactionalObject for a commuting operation.
 AlphaTranlocal ___openUnconstructed()
          Creates a fresh AlphaTranlocal.
 boolean atomicCompareAndSet(long expected, long update)
           
 long atomicGet()
           
 void atomicInc(long amount)
           
 long atomicSet(long newValue)
           
 void commutingInc(long amount)
           
 void commutingInc(org.multiverse.api.Transaction tx, long amount)
           
static AlphaProgrammaticLong createUncommitted(AlphaStm stm)
           
 long get()
           
 long get(org.multiverse.api.Transaction tx)
           
 void inc(long amount)
           
 void inc(org.multiverse.api.Transaction tx, long amount)
           
 long set(long newValue)
           
 long set(org.multiverse.api.Transaction tx, long newValue)
           
 
Methods inherited from class org.multiverse.stms.alpha.mixins.DefaultTxObjectMixin
___getListeners, ___getLockOwner, ___load, ___load, ___registerRetryListener, ___releaseLock, ___storeInitial, ___storeUpdate, ___tryLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphaProgrammaticLong

public AlphaProgrammaticLong(long value)

AlphaProgrammaticLong

public AlphaProgrammaticLong(AlphaStm stm,
                             long value)

AlphaProgrammaticLong

public AlphaProgrammaticLong(AlphaTransaction tx,
                             long value)
Method Detail

createUncommitted

public static AlphaProgrammaticLong createUncommitted(AlphaStm stm)

get

public long get()
Specified by:
get in interface org.multiverse.api.programmatic.ProgrammaticLong

get

public long get(org.multiverse.api.Transaction tx)
Specified by:
get in interface org.multiverse.api.programmatic.ProgrammaticLong

atomicGet

public long atomicGet()
Specified by:
atomicGet in interface org.multiverse.api.programmatic.ProgrammaticLong

set

public long set(long newValue)
Specified by:
set in interface org.multiverse.api.programmatic.ProgrammaticLong

set

public long set(org.multiverse.api.Transaction tx,
                long newValue)
Specified by:
set in interface org.multiverse.api.programmatic.ProgrammaticLong

atomicSet

public long atomicSet(long newValue)
Specified by:
atomicSet in interface org.multiverse.api.programmatic.ProgrammaticLong

inc

public void inc(long amount)
Specified by:
inc in interface org.multiverse.api.programmatic.ProgrammaticLong

inc

public void inc(org.multiverse.api.Transaction tx,
                long amount)
Specified by:
inc in interface org.multiverse.api.programmatic.ProgrammaticLong

commutingInc

public void commutingInc(long amount)
Specified by:
commutingInc in interface org.multiverse.api.programmatic.ProgrammaticLong

commutingInc

public void commutingInc(org.multiverse.api.Transaction tx,
                         long amount)
Specified by:
commutingInc in interface org.multiverse.api.programmatic.ProgrammaticLong

atomicInc

public void atomicInc(long amount)
Specified by:
atomicInc in interface org.multiverse.api.programmatic.ProgrammaticLong

atomicCompareAndSet

public boolean atomicCompareAndSet(long expected,
                                   long update)
Specified by:
atomicCompareAndSet in interface org.multiverse.api.programmatic.ProgrammaticLong

___openForCommutingOperation

public AlphaTranlocal ___openForCommutingOperation()
Description copied from interface: AlphaTransactionalObject
Opens this AlphaTransactionalObject for a commuting operation.

Specified by:
___openForCommutingOperation in interface AlphaTransactionalObject
Overrides:
___openForCommutingOperation in class DefaultTxObjectMixin
Returns:
the AlphaTranlocal opened

___openUnconstructed

public AlphaTranlocal ___openUnconstructed()
Description copied from interface: AlphaTransactionalObject
Creates a fresh AlphaTranlocal. This can be used when a write on a tranlocal needs to be done, but no tranlocal has been created yet (so should be created in the constructor).

Specified by:
___openUnconstructed in interface AlphaTransactionalObject
Returns:
the created AlphaTranlocal.


Copyright © 2008-2010 Multiverse. All Rights Reserved.