[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/callback ...

Ron Sigal ron_sigal at yahoo.com
Sat Oct 28 14:41:10 EDT 2006


  User: rsigal  
  Date: 06/10/28 14:41:10

  Modified:    src/main/org/jboss/remoting/callback  CallbackStore.java
  Log:
  JBREM-609, JBREM-615, JBREM-616:
  
  (1) [JBREM-609] Eliminated test that restricts serialization to be "java" or "jboss".
  (2) [JBREM-615] Added counter to distinguish file names with the same time stamp.
  (3) [JBREM-616] Moved callback file deletion inside synchronized block.
  
  Revision  Changes    Path
  1.7       +29 -20    JBossRemoting/src/main/org/jboss/remoting/callback/CallbackStore.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CallbackStore.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/callback/CallbackStore.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- CallbackStore.java	12 Oct 2006 02:48:30 -0000	1.6
  +++ CallbackStore.java	28 Oct 2006 18:41:10 -0000	1.7
  @@ -56,6 +56,9 @@
    */
   public class CallbackStore implements CallbackStoreMBean
   {
  +   private static long previousTimestamp;
  +   private static int timestampCounter;
  +   
      private String filePath = null;
      private String fileSuffix = "ser";
   
  @@ -224,15 +227,8 @@
            String newSerializationType = (String) config.get(InvokerLocator.SERIALIZATIONTYPE);
            if (newSerializationType != null)
            {
  -            if (!"java".equals((newSerializationType)) && !"jboss".equals(newSerializationType))
  -            {
  -               log.error("unrecognized serialization type: " + newSerializationType);
  -            }
  -            else
  -            {
                  serializationType = newSerializationType;
               }
  -         }
            
         }
      }
  @@ -370,10 +366,6 @@
                        log.debug("Error closing ObjectInputStream.", ioe);
                     }
                  }
  -            }
  -         }
  -      }
  -
         if (objectFilePath != null)
         {
            // now remove the file
  @@ -384,6 +376,9 @@
               log.trace("object file (" + objectFilePath + ") has been deleted - " + isDeleted);
            }
         }
  +            }
  +         }
  +      }
   
         return obj;
      }
  @@ -411,7 +406,21 @@
         synchronized (filePath)
         {
            long currentTimestamp = System.currentTimeMillis();
  -         File storeFile = new File(filePath + System.getProperty("file.separator") + String.valueOf(currentTimestamp) + "." + fileSuffix);
  +         
  +         if (previousTimestamp == currentTimestamp)
  +         {
  +            timestampCounter++;
  +         }
  +         else
  +         {
  +            previousTimestamp = currentTimestamp;
  +            timestampCounter = 0;
  +         }
  +         
  +         StringBuffer path = new StringBuffer(filePath);
  +         path.append(System.getProperty("file.separator")).append(String.valueOf(currentTimestamp));
  +         path.append("-").append(timestampCounter).append(".").append(fileSuffix);
  +         File storeFile = new File(path.toString());
            FileOutputStream outFile = null;
            ObjectOutputStream out = null;
   
  
  
  



More information about the jboss-cvs-commits mailing list