db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/odmg/locking LockStrategyFactory.java
Date Tue, 17 Dec 2002 20:50:01 GMT
brj         2002/12/17 12:50:01

  Modified:    src/java/org/apache/ojb/otm/locking LockStrategyFactory.java
               src/java/org/apache/ojb/odmg/locking
                        LockStrategyFactory.java
  Log:
  use ProxyHelper to get the real Class
  
  Revision  Changes    Path
  1.5       +2 -23     jakarta-ojb/src/java/org/apache/ojb/otm/locking/LockStrategyFactory.java
  
  Index: LockStrategyFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/otm/locking/LockStrategyFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LockStrategyFactory.java	8 Nov 2002 13:29:30 -0000	1.4
  +++ LockStrategyFactory.java	17 Dec 2002 20:50:01 -0000	1.5
  @@ -55,20 +55,10 @@
    */
   
   //#ifdef JDK13
  -import java.lang.reflect.Proxy;
  -//#else
  -/*
  -import com.develop.java.lang.reflect.Proxy;
  -*/
  -//#endif
  -
  -
   import org.apache.ojb.broker.PersistenceBrokerException;
  -import org.apache.ojb.broker.VirtualProxy;
  -import org.apache.ojb.broker.accesslayer.IndirectionHandler;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.IsolationLevels;
  -import org.apache.ojb.odmg.OJB;
  +import org.apache.ojb.broker.util.ProxyHelper;
   import org.apache.ojb.odmg.HasBroker;
   import org.apache.ojb.odmg.OJB;
   
  @@ -126,19 +116,8 @@
        */
       public static int getIsolationLevel(Object obj)
       {
  -        Class c = obj.getClass();
  +        Class c = ProxyHelper.getRealClass(obj);
           int isolationLevel = IsolationLevels.IL_READ_UNCOMMITTED;
  -        // for proxies use the class of the real subject
  -        if (Proxy.isProxyClass(c))
  -        {
  -         	IndirectionHandler handler = (IndirectionHandler) Proxy.getInvocationHandler(obj);
  -         	c = handler.getIdentity().getObjectsClass();
  -        }
  -        if (obj instanceof VirtualProxy)
  -        {
  -         	IndirectionHandler handler = VirtualProxy.getIndirectionHandler((VirtualProxy)
obj);
  -         	c = handler.getIdentity().getObjectsClass();   
  -        }
           
           try
           {
  
  
  
  1.7       +3 -13     jakarta-ojb/src/java/org/apache/ojb/odmg/locking/LockStrategyFactory.java
  
  Index: LockStrategyFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/locking/LockStrategyFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LockStrategyFactory.java	8 Nov 2002 14:15:26 -0000	1.6
  +++ LockStrategyFactory.java	17 Dec 2002 20:50:01 -0000	1.7
  @@ -59,6 +59,7 @@
   import org.apache.ojb.broker.accesslayer.IndirectionHandler;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.IsolationLevels;
  +import org.apache.ojb.broker.util.ProxyHelper;
   import org.apache.ojb.odmg.HasBroker;
   import org.apache.ojb.odmg.TxManagerFactory;
   
  @@ -125,19 +126,8 @@
        */
       public static int getIsolationLevel(Object obj)
       {
  -        Class c = obj.getClass();
  +        Class c = ProxyHelper.getRealClass(obj);
           int isolationLevel = IsolationLevels.IL_READ_UNCOMMITTED;
  -        // for proxies use the class of the real subject
  -        if (Proxy.isProxyClass(c))
  -        {
  -            IndirectionHandler handler = (IndirectionHandler) Proxy.getInvocationHandler(obj);
  -            c = handler.getIdentity().getObjectsClass();
  -        }
  -        if (obj instanceof VirtualProxy)
  -        {
  -            IndirectionHandler handler = VirtualProxy.getIndirectionHandler((VirtualProxy)
obj);
  -            c = handler.getIdentity().getObjectsClass();
  -        }
   
           try
           {
  
  
  

Mime
View raw message