db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg/locking LockManagerFactory.java
Date Tue, 22 Nov 2005 00:35:03 GMT
arminw      2005/11/21 16:35:03

  Modified:    src/java/org/apache/ojb/odmg/locking Tag: OJB_1_0_RELEASE
                        LockManagerFactory.java
  Log:
  use default values for Lock properties to avoid warn messages of configuration factory
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.4   +7 -5      db-ojb/src/java/org/apache/ojb/odmg/locking/Attic/LockManagerFactory.java
  
  Index: LockManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/locking/Attic/LockManagerFactory.java,v
  retrieving revision 1.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- LockManagerFactory.java	22 Mar 2005 15:49:14 -0000	1.5.2.3
  +++ LockManagerFactory.java	22 Nov 2005 00:35:03 -0000	1.5.2.4
  @@ -42,13 +42,13 @@
       private void init()
       {
           Configuration conf = OjbConfigurator.getInstance().getConfigurationFor(null);
  -        Class lockMapClass = conf.getClass("LockMapClass", null);
  +        Class lockMapClass = conf.getClass("LockMapClass", Object.class);
           Class lockManagerClass = conf.getClass("LockManagerClass", null);
           if(lockManagerClass == null)
           {
               throw new OJBRuntimeException(buildErrorMsg(lockMapClass, lockManagerClass));
           }
  -        if(lockMapClass != null)
  +        if(!lockMapClass.equals(Object.class))
           {
               // use the deprecated old odmg locking stuff
               log.info("Setup *deprecated* odmg-locking api.");
  @@ -107,11 +107,13 @@
       {
           String eol = SystemUtils.LINE_SEPARATOR;
           StringBuffer msg = new StringBuffer("Can't setup LockManager. Current used properties
are:" + eol);
  -        msg.append("LockMapClass=" + (lockMap != null ? lockMap.getName() : null) + eol)
  -                .append("LockManagerClass=" + (lockManager != null ? lockManager.getName()
: null) + eol)
  +        msg.append("LockMapClass=").append(lockMap != null ? lockMap.getName() : null)
  +                .append(eol)
  +                .append("LockManagerClass=").append(lockManager != null ? lockManager.getName()
: null).append(eol)
                   .append("For correct setup of the lock manager, please enable the 'LockManagerClass'
property")
                   .append(" in OJB configuration, OJB expects an 'org.apache.ojb.broker.locking.LockManager'
implementation class.")
  -                .append(eol + "Or to enable the *deprecated* odmg-locking api enable the
'LockMapClass' AND the 'LockManager' properties")
  +                .append(eol)
  +                .append("Or to enable the *deprecated* odmg-locking api enable the 'LockMapClass'
AND the 'LockManager' properties")
                   .append(", in this case OJB expects an 'org.apache.ojb.odmg.locking.LockManager'
implementation class.");
           return msg.toString();
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message