Class ReplicationPartitioningPolicy
java.lang.Object
org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RoundRobinPartitioningPolicy
,UnionPartitioningPolicy
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:
- Author:
- James Sutherland
-
Field Summary
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
name
-
Constructor Summary
ConstructorDescriptionReplicationPartitioningPolicy
(String... pools) ReplicationPartitioningPolicy
(List<String> pools) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConnectionPool
(String connectionPool) PUBLIC: Add the connection pool name to the list of pools to rotate queries through.PUBLIC: Return the list of connection pool names to replicate queries to.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
(List<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
-
Field Details
-
connectionPools
-
-
Constructor Details
-
ReplicationPartitioningPolicy
public ReplicationPartitioningPolicy() -
ReplicationPartitioningPolicy
-
ReplicationPartitioningPolicy
-
-
Method Details
-
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: Return the list of connection pool names to replicate queries to. -
setConnectionPools
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: Add the connection pool name to the list of pools to rotate queries through. -
getConnectionsForQuery
public 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
-