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

Ron Sigal ron_sigal at yahoo.com
Wed Oct 11 22:48:30 EDT 2006


  User: rsigal  
  Date: 06/10/11 22:48:30

  Modified:    src/main/org/jboss/remoting/callback  CallbackStore.java
  Log:
  JBREM-609:  Gets serialization type from configuration map and constructs appropriate object streams.
  
  Revision  Changes    Path
  1.6       +20 -2     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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- CallbackStore.java	19 Jul 2006 16:39:17 -0000	1.5
  +++ CallbackStore.java	12 Oct 2006 02:48:30 -0000	1.6
  @@ -22,6 +22,8 @@
   package org.jboss.remoting.callback;
   
   import org.jboss.logging.Logger;
  +import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.serialization.SerializationStreamFactory;
   
   import java.io.File;
   import java.io.FileInputStream;
  @@ -60,6 +62,8 @@
      private boolean isStarted = false;
      private boolean purgeOnShutdown = false;
   
  +   private String serializationType = "java";
  +
      /**
       * Key for setting which directory to write the callback objects.
       * The default value is the property value of 'jboss.server.data.dir' and if this is not set,
  @@ -217,6 +221,19 @@
            {
               fileSuffix = newFileSuffix;
            }
  +         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;
  +            }
  +         }
  +         
         }
      }
   
  @@ -318,7 +335,8 @@
                  // of the list is automatically ordered by the OS and all file names are numeric by time.
                  objectFilePath = filePath + System.getProperty("file.separator") + objectFileList[0];
                  inFile = new FileInputStream(objectFilePath);
  -               in = new ObjectInputStream(inFile);
  +               in = SerializationStreamFactory.getManagerInstance(serializationType).createRegularInput(inFile);
  +
                  try
                  {
                     obj = in.readObject();
  @@ -400,7 +418,7 @@
            try
            {
               outFile = new FileOutputStream(storeFile, false);
  -            out = new ObjectOutputStream(outFile);
  +            out = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(outFile);
               out.writeObject(object);
               out.flush();
            }
  
  
  



More information about the jboss-cvs-commits mailing list