![JAR search and dependency download from the Maven repository](/logo.png)
org.multiverse.annotations.FieldGranularity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multiverse-core Show documentation
Show all versions of multiverse-core Show documentation
Contains the core interfaces/classes of the Multiverse project. So no STM implementations
package org.multiverse.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation that can be placed above a field to indicate that the STM should use a field level granularity
* instead of object level granularity. If you have a transactional object with 2 mutable fields, 2
* transactions could conflict even if they are writing to a different one. This reduce this 'unneeded'
* failure, this annotation can be placed on fields.
*
* Under water these fields are transformed to transactional references or transactional refs.
*
*
* &at;TransactionalObject
* class Person{
* &at;FieldGranularity
* private String name;
* &at;FieldGranularity
* private int age;
* }
*
*
* This is transformed to:
*
*
* &at;TransactionalObject
* class Person{
* private final Ref<String> name = new ...
* private final IntRef age = new ...
* }
*
*
* @author Peter Veentjer.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface FieldGranularity {
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy