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

Ron Sigal ron_sigal at yahoo.com
Wed May 9 04:30:35 EDT 2007


  User: rsigal  
  Date: 07/05/09 04:30:35

  Modified:    src/main/org/jboss/remoting/marshal/encryption   Tag:
                        remoting_2_2_0_GA EncryptingUnMarshaller.java
                        EncryptingMarshaller.java
  Log:
  JBREM-714: Added version parameter to read()/write().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.8.1   +9 -4      JBossRemoting/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EncryptingUnMarshaller.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java,v
  retrieving revision 1.1
  retrieving revision 1.1.8.1
  diff -u -b -r1.1 -r1.1.8.1
  --- EncryptingUnMarshaller.java	16 Aug 2006 19:18:30 -0000	1.1
  +++ EncryptingUnMarshaller.java	9 May 2007 08:30:35 -0000	1.1.8.1
  @@ -31,6 +31,7 @@
   import javax.crypto.CipherInputStream;
   
   import org.jboss.remoting.marshal.UnMarshaller;
  +import org.jboss.remoting.marshal.VersionedUnMarshaller;
   import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
   import org.jboss.remoting.serialization.SerializationManager;
   import org.jboss.remoting.serialization.SerializationStreamFactory;
  @@ -52,7 +53,7 @@
    * uses an <code>HTTPUnMarshaller</code> to restore an unencrypted input stream.
    *
    * @author Anil.Saldhana at jboss.org
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.1.8.1 $ 
    */
   
   public class EncryptingUnMarshaller extends SerializableUnMarshaller
  @@ -105,11 +106,12 @@
       * @param inputStream <code>InputStream</code> from which marshalled form is to be retrieved
       * @param metadata    can be any transport specific metadata (such as headers from http transport).
       *                    This can be null, depending on if transport supports metadata.
  +    * @param version     wire format version
       * @return restored object
       * @throws IOException            if there is a problem reading from <code>inputStream</code>
       * @throws ClassNotFoundException if there is a problem finding a class needed for unmarshalling
       */
  -   public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
  +   public Object read(InputStream inputStream, Map metadata, int version) throws IOException, ClassNotFoundException
      {  
         if(cipher == null)
            throw new IllegalStateException("Cipher is null for algo="+ this.cipherAlgorithm);
  @@ -120,11 +122,14 @@
         Object obj = null;
         if(wrappedUnMarshaller != null)
         {
  +         if (wrappedUnMarshaller instanceof VersionedUnMarshaller)
  +            return ((VersionedUnMarshaller)wrappedUnMarshaller).read(ois, metadata, version);
  +         else
            obj = wrappedUnMarshaller.read(ois, metadata); 
         }
         else
         {
  -         obj = super.read(ois, metadata);
  +         obj = super.read(ois, metadata, version);
         } 
         return obj;
      } 
  
  
  
  1.1.8.1   +9 -4      JBossRemoting/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EncryptingMarshaller.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java,v
  retrieving revision 1.1
  retrieving revision 1.1.8.1
  diff -u -b -r1.1 -r1.1.8.1
  --- EncryptingMarshaller.java	16 Aug 2006 19:18:30 -0000	1.1
  +++ EncryptingMarshaller.java	9 May 2007 08:30:35 -0000	1.1.8.1
  @@ -31,6 +31,7 @@
   import javax.crypto.CipherOutputStream; 
   
   import org.jboss.remoting.marshal.Marshaller;
  +import org.jboss.remoting.marshal.VersionedMarshaller;
   import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
   import org.jboss.remoting.serialization.SerializationManager;
   import org.jboss.remoting.serialization.SerializationStreamFactory;
  @@ -115,8 +116,9 @@
       *
       * @param dataObject arbitrary object to be marshalled
       * @param output     <code>OutputStream</code> to which <code>output</code> is to be marshalled
  +    * @param version    wire format version
       */
  -   public void write(Object dataObject, OutputStream output) throws IOException
  +   public void write(Object dataObject, OutputStream output, int version) throws IOException
      { 
         if(cipher == null)
            throw new IllegalStateException("Cipher is null for algo="+ this.cipherAlgorithm);
  @@ -132,11 +134,14 @@
         
         if(wrappedMarshaller != null)
         { 
  +         if (wrappedMarshaller instanceof VersionedMarshaller)
  +            ((VersionedMarshaller) wrappedMarshaller).write(dataObject, oos, version);
  +         else
            wrappedMarshaller.write(dataObject, oos);
         }
         else
         {
  -         super.write(dataObject, oos);
  +         super.write(dataObject, oos, version);
         }  
         oos.flush();  
         
  
  
  



More information about the jboss-cvs-commits mailing list