diff --git a/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java b/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java deleted file mode 100644 index 4f417bb57..000000000 --- a/src/main/java/org/springframework/persistence/AsynchStoreCompletionListener.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.springframework.persistence; - -import java.lang.reflect.Field; - -/** - * Listener interface for asynchronous storage operations. - * Can be annotated with OnlyOnFailure as an optimization - * if the listener is only interested in compensating transactions - * in the event of write failure. - * - * @author Rod Johnson - * - * @param new value type - */ -public interface AsynchStoreCompletionListener { - - /** - * Constant indicating no store completion action - */ - class NONE implements AsynchStoreCompletionListener { - public void onCompletion(AsynchStoreCompletionListener.StoreResult result, Object newValue, Field foreignStore) {} - } - - enum StoreResult { - SUCCESS, - FAILURE, - INDETERMINATE - }; - - void onCompletion(StoreResult result, V newValue, Field foreignStore); - -} diff --git a/src/main/java/org/springframework/persistence/PersistencePolicy.java b/src/main/java/org/springframework/persistence/PersistencePolicy.java deleted file mode 100644 index 63d91895a..000000000 --- a/src/main/java/org/springframework/persistence/PersistencePolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.springframework.persistence; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Persistence policies that can be attached to entities or relationship - * fields. - * @author rodjohnson - * - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.FIELD}) -public @interface PersistencePolicy { - - enum LATENCY_SENSITIVITY { NONE, MEDIUM, HIGH }; - - boolean largeObject() default false; - - boolean queryable() default true; - - boolean immutable() default false; - - boolean transactional() default true; - - boolean lossAcceptable() default false; - - // TODO freshness, or should this be handled separately in a caching annotation - - LATENCY_SENSITIVITY latencySensitivity() default LATENCY_SENSITIVITY.HIGH; - -} diff --git a/src/main/java/org/springframework/persistence/RelatedEntity.java b/src/main/java/org/springframework/persistence/RelatedEntity.java deleted file mode 100644 index f9e538c82..000000000 --- a/src/main/java/org/springframework/persistence/RelatedEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.springframework.persistence; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation indicating that a field may be stored in a foreign store - * and specifying the necessary guarantees. Conceptual rather than - * implementation-specific. - * @see ForeignStoreKeyManager - * - * @author Rod Johnson - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface RelatedEntity { - - /** - * - * Optional information as to how to compute or locate the key value. - * Some strategies may take this into account. - */ - String keyExpression() default ""; - - /** - * Should we use the key of the present entity - * @return - */ - boolean sameKey() default false; - - /** - * Policies for persistence - * @return - */ - PersistencePolicy policy() default @PersistencePolicy(); - - /** - * Name for the preferred data store. Merely a hint. May not be followed. - * @return - */ - String preferredStore() default ""; - - /** - * Is asynchronous store OK? - * @return - */ - boolean asynchStore() default false; - - // TODO - indicates if an asynchronous write should begin - // only after commit of a transaction - boolean afterCommit() default false; - - /** - * Completion listener class. Only used if asynchStore is true. - * Must have a no-arg constructor. - * @return - */ - @SuppressWarnings("unchecked") - Class storeCompletionListenerClass() default AsynchStoreCompletionListener.NONE.class; - - String storeCompletionListenerBeanName() default ""; - -}