Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 85825 invoked from network); 13 Aug 2005 10:36:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Aug 2005 10:36:06 -0000 Received: (qmail 63441 invoked by uid 500); 13 Aug 2005 10:36:06 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 63274 invoked by uid 500); 13 Aug 2005 10:36:04 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 68613 invoked by uid 500); 12 Aug 2005 13:49:21 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 12 Aug 2005 13:49:21 -0000 Message-ID: <20050812134921.78918.qmail@minotaur.apache.org> From: aclute@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/cache ObjectCacheTwoLevelImpl.java X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N aclute 2005/08/12 06:49:21 Modified: src/java/org/apache/ojb/broker/core/proxy Tag: OJB_1_0_RELEASE ProxyFactoryCGLIBImpl.java ProxyFactoryJDKImpl.java ProxyHelper.java ProxyFactory.java src/java/org/apache/ojb/broker/cache Tag: OJB_1_0_RELEASE ObjectCacheTwoLevelImpl.java Log: Additional attribute on ProxyFactory to signify whether a specific implementation requires interface-backed objects. Useful for a sanity check in TLCache when forceProxies is set. Revision Changes Path No revision No revision 1.2.2.2 +6 -0 db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryCGLIBImpl.java Index: ProxyFactoryCGLIBImpl.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryCGLIBImpl.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- ProxyFactoryCGLIBImpl.java 9 Aug 2005 20:03:21 -0000 1.2.2.1 +++ ProxyFactoryCGLIBImpl.java 12 Aug 2005 13:49:21 -0000 1.2.2.2 @@ -69,4 +69,10 @@ } + public boolean interfaceRequiredForProxyGeneration() { + return false; + } + + + } 1.2.2.2 +4 -0 db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryJDKImpl.java Index: ProxyFactoryJDKImpl.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactoryJDKImpl.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- ProxyFactoryJDKImpl.java 9 Aug 2005 20:03:21 -0000 1.2.2.1 +++ ProxyFactoryJDKImpl.java 12 Aug 2005 13:49:21 -0000 1.2.2.2 @@ -132,5 +132,9 @@ return interfaces; } + + public boolean interfaceRequiredForProxyGeneration() { + return true; + } } 1.2.2.4 +2 -2 db-ojb/src/java/org/apache/ojb/broker/core/proxy/Attic/ProxyHelper.java Index: ProxyHelper.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/Attic/ProxyHelper.java,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -u -r1.2.2.3 -r1.2.2.4 --- ProxyHelper.java 10 Aug 2005 19:26:53 -0000 1.2.2.3 +++ ProxyHelper.java 12 Aug 2005 13:49:21 -0000 1.2.2.4 @@ -32,7 +32,7 @@ proxyFactoryRef = new SoftReference(getBroker().getProxyFactory()); } - private static ProxyFactory getProxyFactory() { + public static ProxyFactory getProxyFactory() { if (proxyFactoryRef.get() == null) { proxyFactoryRef = new SoftReference(getBroker().getProxyFactory()); } 1.1.2.2 +8 -1 db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactory.java Index: ProxyFactory.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/proxy/ProxyFactory.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- ProxyFactory.java 9 Aug 2005 20:03:21 -0000 1.1.2.1 +++ ProxyFactory.java 12 Aug 2005 13:49:21 -0000 1.1.2.2 @@ -211,4 +211,11 @@ * @return The string representation */ public String toString(Object proxy); + + /** + * Method that returns whether or not this ProxyFactory can generate reference Proxies + * for classes regardless if they extend an interface or not. + * + */ + boolean interfaceRequiredForProxyGeneration(); } No revision No revision 1.1.2.9 +9 -1 db-ojb/src/java/org/apache/ojb/broker/cache/Attic/ObjectCacheTwoLevelImpl.java Index: ObjectCacheTwoLevelImpl.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/Attic/ObjectCacheTwoLevelImpl.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- ObjectCacheTwoLevelImpl.java 10 Aug 2005 19:32:19 -0000 1.1.2.8 +++ ObjectCacheTwoLevelImpl.java 12 Aug 2005 13:49:21 -0000 1.1.2.9 @@ -166,6 +166,14 @@ String forceProxyValue = prop.getProperty(FORCE_PROXIES, "false").trim(); forceProxies = Boolean.valueOf(forceProxyValue).booleanValue(); + if (forceProxies && ProxyHelper.getProxyFactory().interfaceRequiredForProxyGeneration()){ + log.warn("'" + FORCE_PROXIES + "' is set to true, however a ProxyFactory implementation " + + "[" + ProxyHelper.getProxyFactory().getClass().getName() +"] " + + " that requires persistent objects to implement an inteface is being used. Please ensure " + + "that all persistent objects implement an interface, or change the ProxyFactory setting to a dynamic " + + "proxy generator (like ProxyFactoryCGLIBImpl)."); + } + Class[] type = new Class[]{PersistenceBroker.class, Properties.class}; Object[] objects = new Object[]{broker, prop}; try --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org