org.apache.openjpa.slice
Interface ReplicationPolicy

All Known Implementing Classes:
ReplicationPolicy.Default

public interface ReplicationPolicy

Policy to select one or more of the physical databases referred as slice in which a given persistent instance will be persisted. This interface is invoked for entity types that are specified as ReplicatedTypes in the configuration.

Author:
Pinaki Poddar
See Also:
DistributionPolicy

Nested Class Summary
static class ReplicationPolicy.Default
          Implements a default replication policy to replicate the given instance across all available slices.
 
Method Summary
 String[] replicate(Object pc, List<String> slices, Object context)
          Gets the name of the slices where a given instance will be replicated.
 

Method Detail

replicate

String[] replicate(Object pc,
                   List<String> slices,
                   Object context)
Gets the name of the slices where a given instance will be replicated.

Parameters:
pc - The newly persistent or to-be-merged object.
slices - list of names of the active slices. The ordering of the list is either explicit openjpa.slice.Names property or implicit i.e. alphabetic order of available identifiers if openjpa.slice.Names is unspecified.
context - generic persistence context managing the given instance.
Returns:
identifier of the slices. This names must match one of the given slice names.
See Also:
DistributedConfiguration.getActiveSliceNames()


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.