You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oz...@apache.org on 2004/06/05 18:50:00 UTC

cvs commit: jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory PessimisticMapWrapper.java

ozeigermann    2004/06/05 09:50:00

  Modified:    transaction/src/java/org/apache/commons/transaction/file
                        ResourceManager.java FileResourceManager.java
               transaction/src/java/org/apache/commons/transaction/locking
                        GenericLock.java
               transaction/src/java/org/apache/commons/transaction/memory
                        PessimisticMapWrapper.java
  Log:
  Fixed some minor Javadoc issues
  
  Revision  Changes    Path
  1.2       +8 -8      jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/ResourceManager.java
  
  Index: ResourceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/ResourceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResourceManager.java	14 May 2004 13:06:45 -0000	1.1
  +++ ResourceManager.java	5 Jun 2004 16:50:00 -0000	1.2
  @@ -61,7 +61,7 @@
       public final static int ISOLATION_LEVEL_READ_COMMITTED = 10;
   
       /**
  -     * Isolation level <b>repeated read</b>: data written by other transactions can be read after they commit if this transaction has not read this data before  
  +     * Isolation level <b>repeatable read</b>: data written by other transactions can be read after they commit if this transaction has not read this data before  
        */
       public final static int ISOLATION_LEVEL_REPEATABLE_READ = 50;
   
  @@ -145,7 +145,7 @@
        * The higher the value the higher the isolation.
        *  
        * @return one of the predefined isolation levels {@link #ISOLATION_LEVEL_READ_UNCOMMITTED}, 
  -     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATED_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
  +     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATABLE_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
        * or any other int representing an isolation level
        * @throws ResourceManagerException if an error occured
        */
  @@ -156,7 +156,7 @@
        * This array must not be <code>null</code> or empty as every resource manager has some sort of isolation level.
        * 
        * @return array of the predefined isolation levels {@link #ISOLATION_LEVEL_READ_UNCOMMITTED}, 
  -     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATED_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
  +     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATABLE_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
        * or any other int representing an isolation level
        * @throws ResourceManagerException if an error occured
        * @see #getDefaultIsolationLevel
  @@ -178,7 +178,7 @@
        * 
        * @param txId identifier for the concerned transaction
        * @return one of the predefined isolation levels {@link #ISOLATION_LEVEL_READ_UNCOMMITTED}, 
  -     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATED_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
  +     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATABLE_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
        * or any other int representing an isolation level
        * @throws ResourceManagerException if an error occured
        * @see #getDefaultIsolationLevel
  @@ -193,7 +193,7 @@
        * 
        * @param txId identifier for the concerned transaction
        * @param level one of the predefined isolation levels {@link #ISOLATION_LEVEL_READ_UNCOMMITTED}, 
  -     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATED_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
  +     * {@link #ISOLATION_LEVEL_READ_COMMITTED}, {@link #ISOLATION_LEVEL_REPEATABLE_READ} or {@link #ISOLATION_LEVEL_SERIALIZABLE} 
        * or any other int representing an isolation level
        * @throws ResourceManagerException if an error occured
        * @see #getDefaultIsolationLevel
  
  
  
  1.2       +19 -12    jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/FileResourceManager.java
  
  Index: FileResourceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/FileResourceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileResourceManager.java	14 May 2004 13:06:45 -0000	1.1
  +++ FileResourceManager.java	5 Jun 2004 16:50:00 -0000	1.2
  @@ -188,7 +188,7 @@
       protected boolean dirty = false;
       protected int operationMode = OPERATION_MODE_STOPPED;
       protected long defaultTimeout = DEFAULT_TIMEOUT_MSECS;
  -    protected boolean debug; 
  +    protected boolean debug;
   
       protected LoggerFacade logger;
   
  @@ -223,7 +223,12 @@
        * @param logger the logger to be used by this store
        * @param debug if set to <code>true</code> logs all locking information to "transaction.log" for debugging inspection 
        */
  -    public FileResourceManager(String storeDir, String workDir, boolean urlEncodePath, LoggerFacade logger, boolean debug) {
  +    public FileResourceManager(
  +        String storeDir,
  +        String workDir,
  +        boolean urlEncodePath,
  +        LoggerFacade logger,
  +        boolean debug) {
           this.workDir = workDir;
           this.storeDir = storeDir;
           this.urlEncodePath = urlEncodePath;
  @@ -235,7 +240,8 @@
        * Gets the store directory.
        * 
        * @return the store directory
  -     * @see #FileResourceManager(String, String)
  +     * @see #FileResourceManager(String, String, boolean, LoggerFacade)
  +     * @see #FileResourceManager(String, String, boolean, LoggerFacade, boolean)
        */
       public String getStoreDir() {
           return storeDir;
  @@ -245,7 +251,8 @@
        * Gets the working directory.
        * 
        * @return the work directory
  -     * @see #FileResourceManager(String, String)
  +     * @see #FileResourceManager(String, String, boolean, LoggerFacade)
  +     * @see #FileResourceManager(String, String, boolean, LoggerFacade, boolean)
        */
       public String getWorkDir() {
           return workDir;
  @@ -644,7 +651,7 @@
               context.isLightWeight = true;
               // XXX higher isolation might be needed to make sure upgrade to commit lock always works
               context.isolationLevel = ISOLATION_LEVEL_READ_COMMITTED;
  -//            context.isolationLevel = ISOLATION_LEVEL_REPEATABLE_READ;
  +            //            context.isolationLevel = ISOLATION_LEVEL_REPEATABLE_READ;
               globalTransactions.put(txId, context);
           }
   
  @@ -752,7 +759,7 @@
               context.isLightWeight = true;
               // XXX higher isolation might be needed to make sure upgrade to commit lock always works
               context.isolationLevel = ISOLATION_LEVEL_READ_COMMITTED;
  -//            context.isolationLevel = ISOLATION_LEVEL_REPEATABLE_READ;
  +            //            context.isolationLevel = ISOLATION_LEVEL_REPEATABLE_READ;
               globalTransactions.put(txId, context);
           }
   
  @@ -1522,12 +1529,12 @@
               buf.append(Long.toString(startTime)).append('\n');
               if (debug) {
                   buf.append("----- Lock Debug Info -----\n");
  -                
  +
                   for (Iterator it = locks.iterator(); it.hasNext();) {
                       MultiLevelLock lock = (MultiLevelLock) it.next();
  -                    buf.append(lock.toString()+"\n");
  +                    buf.append(lock.toString() + "\n");
                   }
  -                
  +
               }
               return buf.toString();
           }
  
  
  
  1.2       +12 -9     jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java
  
  Index: GenericLock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GenericLock.java	14 May 2004 13:06:45 -0000	1.1
  +++ GenericLock.java	5 Jun 2004 16:50:00 -0000	1.2
  @@ -35,7 +35,7 @@
    * 
    * <p>The idea is to have an ascending number of
    * lock levels ranging from <code>0</code> to <code>maxLockLevel</code> as specified in 
  - * {@link #GenericLock(Object, int, StoreLogger)}: the higher the lock level the stronger and more restrictive the lock. To determine which lock may coexist with other locks you have to imagine matching pairs of lock levels.
  + * {@link #GenericLock(Object, int, LoggerFacade)}: the higher the lock level the stronger and more restrictive the lock. To determine which lock may coexist with other locks you have to imagine matching pairs of lock levels.
    * For each pair both parts allow for all lock levels less than or equal to the matching other part. Pairs are composed by the lowest and highest level not yet part of a pair and successively applying this 
    * method until no lock level is left. For an even amount of levels each level is part of exactly one pair.
    * For an odd amount the middle level is paired with itself. The highst lock level may coexist with the lowest one (<code>0</code>) which by definition means 
  @@ -132,7 +132,7 @@
           long timeoutMSecs)
           throws InterruptedException {
   
  -            logger.logFiner(
  +        logger.logFiner(
               ownerId.toString()
                   + " trying to acquire lock for "
                   + resourceId.toString()
  @@ -156,7 +156,9 @@
                   return false;
               } else {
                   long started = System.currentTimeMillis();
  -                for (long remaining = timeoutMSecs; remaining > 0; remaining = timeoutMSecs - (System.currentTimeMillis() - started)) {
  +                for (long remaining = timeoutMSecs;
  +                    remaining > 0;
  +                    remaining = timeoutMSecs - (System.currentTimeMillis() - started)) {
   
                       logger.logFiner(
                           ownerId.toString()
  @@ -235,7 +237,8 @@
   
       public Object getOwner() {
           LockOwner owner = getMaxLevelOwner();
  -        if (owner == null) return null;
  +        if (owner == null)
  +            return null;
           return owner.ownerId;
       }
   
  @@ -246,10 +249,10 @@
           for (Iterator it = owners.values().iterator(); it.hasNext();) {
               LockOwner owner = (LockOwner) it.next();
               buf.append("- ").append(owner.ownerId.toString()).append(": ").append(owner.lockLevel);
  -            
  +
           }
           return buf.toString();
  -         
  +
       }
   
       protected synchronized LockOwner getMaxLevelOwner() {
  
  
  
  1.3       +5 -5      jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory/PessimisticMapWrapper.java
  
  Index: PessimisticMapWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory/PessimisticMapWrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PessimisticMapWrapper.java	3 Jun 2004 14:15:31 -0000	1.2
  +++ PessimisticMapWrapper.java	5 Jun 2004 16:50:00 -0000	1.3
  @@ -48,7 +48,7 @@
   
       /**
        * Creates a new pessimistic transactional map wrapper. Temporary maps and sets to store transactional
  -     * data will be instances of {@link HashMap} and {@link HashSet}. 
  +     * data will be instances of {@link java.util.HashMap} and {@link java.util.HashSet}. 
        * 
        * @param wrapped map to be wrapped
        */
  
  
  

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