2009 | OriginalPaper | Buchkapitel
A Domain Specific Language for Composable Memory Transactions in Java
verfasst von : André Rauber Du Bois, Marcos Echevarria
Erschienen in: Domain-Specific Languages
Verlag: Springer Berlin Heidelberg
Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
In this paper we present CMTJava, a domain specific language for
composable memory transactions
[7] in Java. CMTJava provides the abstraction of
transactional objects
. Transactional objects have their fields accessed only by special get and set methods that are automatically generated by the compiler. These methods return
transactional actions
as a result. A transactional action is an action that, when executed, will produce the desired effect. Transactional actions can only be executed by the
atomic
method. Transactional actions are first class values in Java and they are composable: transactions can be combined to generate new transactions. The Java type system guarantees that the fields of transactional objects will never be accessed outside a transaction. CMTJava supports the
retry
and
orElse
constructs from STM Haskell. To validate our design we implemented a simple transactional system following the description of the original Haskell system. CMTJava is implemented as a state passing monad using BBGA closures, a Java extension that supports closures in Java.