From 7ca1cfe20c1aadfc2ce5230fd4c8d13deea9a093 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Thu, 14 Feb 2008 05:43:22 +0000 Subject: [PATCH] Enable PersisentProviderImpl subclass to override the default BrokerImpl alias if none is defined in application. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@627668 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/persistence/PersistenceProviderImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java index b25353e5b..b0974da49 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java @@ -136,7 +136,7 @@ public class PersistenceProviderImpl if (!Configurations.containsProperty(BrokerValue.KEY, cp.getProperties())) { cp.addProperty("openjpa." + BrokerValue.KEY, - BrokerValue.NON_FINALIZING_ALIAS); + getDefaultBrokerAlias()); } BrokerFactory factory = getBrokerFactory(cp, poolValue, @@ -158,6 +158,15 @@ public class PersistenceProviderImpl throw PersistenceExceptions.toPersistenceException(e); } } + + /* + * Returns a default Broker alias to be used when no openjpa.BrokerImpl + * is specified. This method allows PersistenceProvider subclass to + * override the default broker alias. + */ + protected String getDefaultBrokerAlias() { + return BrokerValue.NON_FINALIZING_ALIAS; + } /** * Java EE 5 class transformer.