db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer IndirectionHandler.java
Date Mon, 09 Jun 2003 18:50:26 GMT
olegnitz    2003/06/09 11:50:25

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        IndirectionHandler.java
  Log:
  Added the getMatrializingBroker() method for use in MaterializationListeners
  
  Revision  Changes    Path
  1.16      +16 -1     db-ojb/src/java/org/apache/ojb/broker/accesslayer/IndirectionHandler.java
  
  Index: IndirectionHandler.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/IndirectionHandler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- IndirectionHandler.java	6 Jun 2003 20:12:34 -0000	1.15
  +++ IndirectionHandler.java	9 Jun 2003 18:50:25 -0000	1.16
  @@ -297,13 +297,20 @@
       {
           try
           {
  +            // [oleg] getBroker should go before beforeMaterialization()
  +            // releaseBroker() should go after afterMaterialization()
  +            // because getMaterializingBroker() should return not null for them
  +            PersistenceBroker materializingBroker = getBroker();
  +
               beforeMaterialization();
  -            realSubject = getBroker().getObjectByIdentity(id);
  +
  +            realSubject = materializingBroker.getObjectByIdentity(id);
   
               if (realSubject == null)
               {
                   LoggerFactory.getDefaultLogger().warn("OJB broker could not materialize
" + id.toString());
               }
  +
               afterMaterialization();
           }
           catch (Exception ex)
  @@ -342,4 +349,12 @@
   		this.brokerKey = brokerKey;
   	}
   
  +    /**
  +     * This method is for use in MaterializationListeners.
  +     * It allow to use the same broker that was used during the materialization.
  +     */
  +    public PersistenceBroker getMaterializingBroker()
  +    {
  +        return broker;
  +    }
   }
  
  
  

Mime
View raw message