From 12878c9c05199a62304b1ff807a3e4ea1e878af9 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 4 Oct 2011 16:08:06 +0000 Subject: [PATCH] rollback wrong commit git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1178849 13f79535-47bb-0310-9956-ffa450edef68 --- .../DistributedJDBCConfigurationImpl.java | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java b/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java index e2a7ca1e1..ad9124a6c 100644 --- a/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java +++ b/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java @@ -79,10 +79,10 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl protected BooleanValue lenientPlugin; protected StringValue masterPlugin; protected StringListValue namesPlugin; - public PluginValue distributionPolicyPlugin; - public PluginValue replicationPolicyPlugin; - public PluginValue queryTargetPolicyPlugin; - public PluginValue finderTargetPolicyPlugin; + public PluginValue distributionPolicyPlugin; + public PluginValue replicationPolicyPlugin; + public PluginValue queryTargetPolicyPlugin; + public PluginValue finderTargetPolicyPlugin; public StringListValue replicatedTypesPlugin; private ReplicatedTypeRepository _replicationRepos; @@ -101,22 +101,22 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl false); // load globals brokerPlugin.setString(DistributedBrokerImpl.class.getName()); - distributionPolicyPlugin = addPlugin(DistributionPolicy.class, PREFIX_SLICE + "DistributionPolicy", true); + distributionPolicyPlugin = addPlugin(PREFIX_SLICE + "DistributionPolicy", true); distributionPolicyPlugin.setAlias("random", DistributionPolicy.Default.class.getName()); distributionPolicyPlugin.setDefault("random"); distributionPolicyPlugin.setString("random"); distributionPolicyPlugin.setDynamic(true); - replicationPolicyPlugin = addPlugin(ReplicationPolicy.class, PREFIX_SLICE + "ReplicationPolicy", true); + replicationPolicyPlugin = addPlugin(PREFIX_SLICE + "ReplicationPolicy", true); replicationPolicyPlugin.setAlias("all", ReplicationPolicy.Default.class.getName()); replicationPolicyPlugin.setDefault("all"); replicationPolicyPlugin.setString("all"); replicationPolicyPlugin.setDynamic(true); - queryTargetPolicyPlugin = addPlugin(QueryTargetPolicy.class, PREFIX_SLICE + "QueryTargetPolicy", true); + queryTargetPolicyPlugin = addPlugin(PREFIX_SLICE + "QueryTargetPolicy", true); queryTargetPolicyPlugin.setDynamic(true); - finderTargetPolicyPlugin = addPlugin(FinderTargetPolicy.class, PREFIX_SLICE + "FinderTargetPolicy", true); + finderTargetPolicyPlugin = addPlugin(PREFIX_SLICE + "FinderTargetPolicy", true); finderTargetPolicyPlugin.setDynamic(true); replicatedTypesPlugin = new StringListValue(PREFIX_SLICE + "ReplicatedTypes"); @@ -212,14 +212,16 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl public DistributionPolicy getDistributionPolicyInstance() { if (distributionPolicyPlugin.get() == null) { - distributionPolicyPlugin.instantiate(this, true); + distributionPolicyPlugin.instantiate(DistributionPolicy.class, + this, true); } - return distributionPolicyPlugin.get(); + return (DistributionPolicy) distributionPolicyPlugin.get(); } public String getDistributionPolicy() { if (distributionPolicyPlugin.get() == null) { - distributionPolicyPlugin.instantiate(this, true); + distributionPolicyPlugin.instantiate(DistributionPolicy.class, + this, true); } return distributionPolicyPlugin.getString(); } @@ -234,14 +236,16 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl public ReplicationPolicy getReplicationPolicyInstance() { if (replicationPolicyPlugin.get() == null) { - replicationPolicyPlugin.instantiate(this, true); + replicationPolicyPlugin.instantiate(ReplicationPolicy.class, + this, true); } - return replicationPolicyPlugin.get(); + return (ReplicationPolicy) replicationPolicyPlugin.get(); } public String getReplicationPolicy() { if (replicationPolicyPlugin.get() == null) { - replicationPolicyPlugin.instantiate(this, true); + replicationPolicyPlugin.instantiate(ReplicationPolicy.class, + this, true); } return replicationPolicyPlugin.getString(); } @@ -256,14 +260,16 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl public QueryTargetPolicy getQueryTargetPolicyInstance() { if (queryTargetPolicyPlugin.get() == null) { - queryTargetPolicyPlugin.instantiate(this, true); + queryTargetPolicyPlugin.instantiate(ReplicationPolicy.class, + this, true); } - return queryTargetPolicyPlugin.get(); + return (QueryTargetPolicy) queryTargetPolicyPlugin.get(); } public String getQueryTargetPolicy() { if (queryTargetPolicyPlugin.get() == null) { - queryTargetPolicyPlugin.instantiate(this, true); + queryTargetPolicyPlugin.instantiate(QueryTargetPolicy.class, + this, true); } return queryTargetPolicyPlugin.getString(); } @@ -278,14 +284,16 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl public FinderTargetPolicy getFinderTargetPolicyInstance() { if (finderTargetPolicyPlugin.get() == null) { - finderTargetPolicyPlugin.instantiate(this, true); + finderTargetPolicyPlugin.instantiate(ReplicationPolicy.class, + this, true); } - return finderTargetPolicyPlugin.get(); + return (FinderTargetPolicy) finderTargetPolicyPlugin.get(); } public String getFinderTargetPolicy() { if (finderTargetPolicyPlugin.get() == null) { - finderTargetPolicyPlugin.instantiate(this, true); + finderTargetPolicyPlugin.instantiate(FinderTargetPolicy.class, + this, true); } return finderTargetPolicyPlugin.getString(); }