org.multiverse.api
Interface Stm<B extends TransactionFactoryBuilder,P extends ProgrammaticReferenceFactoryBuilder>


public interface Stm<B extends TransactionFactoryBuilder,P extends ProgrammaticReferenceFactoryBuilder>

The main interface for software transactional memory. Updates/reads in the stm should only be done through the Transaction. So see that for more details.

It is important that an TransactionalObject only is used within a single stm. If it is 'shared' between different stm's, isolation problems could happen. This can be caused by the fact that different stm's probably use different clocks. And the clock is needed to prevent isolation problems.

All methods on the Stm are of course thread safe.

Author:
Peter Veentjer.

Method Summary
 P getProgrammaticReferenceFactoryBuilder()
          Returns the programmatic reference factory this Stm exposes.
 B getTransactionFactoryBuilder()
          Gets the TransactionFactoryBuilder that needs to be used to execute transactions on this Stm.
 long getVersion()
          Returns the current clock version (this is logical time).
 

Method Detail

getVersion

long getVersion()
Returns the current clock version (this is logical time). The returned value will always be equal or larger than zero.

This method is useful for stm's based on a central clock, but once this has been removed (a shared clock causes contention and therefor limits scalability) this method is going to be removed.

Returns:
the current clock version.

getTransactionFactoryBuilder

B getTransactionFactoryBuilder()
Gets the TransactionFactoryBuilder that needs to be used to execute transactions on this Stm. See the TransactionFactoryBuilder for more info.

Returns:
the TransactionFactoryBuilder that needs to be used to execute transactions on this Stm.

getProgrammaticReferenceFactoryBuilder

P getProgrammaticReferenceFactoryBuilder()
Returns the programmatic reference factory this Stm exposes. See the ProgrammaticReference for more information when to use it.

Returns:
the used ProgrammaticReferenceFactory.


Copyright © 2008-2010 Multiverse. All Rights Reserved.