Class ReplicationPartitioningPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
-
- org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RoundRobinPartitioningPolicy
,UnionPartitioningPolicy
public class ReplicationPartitioningPolicy extends PartitioningPolicy
PUBLIC: ReplicationPartitioningPolicy sends requests to a set of connection pools. It is for replicating data across a cluster of database machines. Only modification queries are replicated.- See Also:
- Serialized Form
- Author:
- James Sutherland
- Since:
- EclipseLink 2.2
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>
connectionPools
-
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
name
-
-
Constructor Summary
Constructors Constructor Description ReplicationPartitioningPolicy()
ReplicationPartitioningPolicy(java.lang.String... pools)
ReplicationPartitioningPolicy(java.util.List<java.lang.String> pools)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectionPool(java.lang.String connectionPool)
PUBLIC: Add the connection pool name to the list of pools to rotate queries through.java.util.List<java.lang.String>
getConnectionPools()
PUBLIC: Return the list of connection pool names to replicate queries to.java.util.List<org.eclipse.persistence.internal.databaseaccess.Accessor>
getConnectionsForQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord arguments)
INTERNAL: Get a connection from each pool.void
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Default the connection pools to all pools if unset.void
setConnectionPools(java.util.List<java.lang.String> connectionPools)
PUBLIC: Set the list of connection pool names to replicate queries to.-
Methods inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
acquireAccessor, convertClassNamesToClasses, getAccessor, getName, partitionPersist, setName
-
-
-
-
Method Detail
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Default the connection pools to all pools if unset.- Overrides:
initialize
in classPartitioningPolicy
-
getConnectionPools
public java.util.List<java.lang.String> getConnectionPools()
PUBLIC: Return the list of connection pool names to replicate queries to.
-
setConnectionPools
public void setConnectionPools(java.util.List<java.lang.String> connectionPools)
PUBLIC: Set the list of connection pool names to replicate queries to. A connection pool with the same name must be defined on the ServerSession.
-
addConnectionPool
public void addConnectionPool(java.lang.String connectionPool)
PUBLIC: Add the connection pool name to the list of pools to rotate queries through.
-
getConnectionsForQuery
public java.util.List<org.eclipse.persistence.internal.databaseaccess.Accessor> getConnectionsForQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord arguments)
INTERNAL: Get a connection from each pool.- Specified by:
getConnectionsForQuery
in classPartitioningPolicy
-
-