ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Ws Wiki] Update of "FrontPage/Axis2/MessageContextSaveRestore" by AnnRobinson
Date Tue, 31 Oct 2006 21:27:25 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by AnnRobinson:
http://wiki.apache.org/ws/FrontPage/Axis2/MessageContextSaveRestore

------------------------------------------------------------------------------
  === Sample code to save a Message Context ===
  
    // attach a stream capable of writing objects to the output stream
+ 
-    ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
+   ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
                                                                      
    // save the message context
+ 
-    outObjStream.writeObject(msgContext);                               
+   outObjStream.writeObject(msgContext);                               
  
  
  === Sample code to restore a Message Context ===
  
    // attach a stream capable of reading objects from the input stream
+ 
-    ObjectInputStream inObjStream = new ObjectInputStream(inStream);       
+   ObjectInputStream inObjStream = new ObjectInputStream(inStream);       
                                                                           
    // restore the message context
+ 
-    MessageContext msgContext2 = (MessageContext) inObjStream.readObject();
+   MessageContext msgContext2 = (MessageContext) inObjStream.readObject();
                                                                           
-   // if you don't go through the axis engine then you need to 
+   // if you don't go through the axis engine then you need to
+ 
-    // activate the restored message context before using it
+   // activate the restored message context before using it
+ 
-     msgContext2.activate(configurationContext);                            
+   msgContext2.activate(configurationContext);                            
    
    
  == Limitations/Restrictions on the Message Context Serialization Support ==
@@ -145, +151 @@

  reading and writing the object.                                           
  
   private void writeObject ( ObjectOutputStream out ) throws IOException
+  
   -  use out.defaultWriteObject() for default serialization              
                                                                          
   private void readObject ( ObjectInputStream in ) throws IOException,   
   ClassNotFoundException
+  
   -  use in.defaultReadObject() for default de-serialization             
                                                                          
  The object can also explicitly declare the specific variables or fields to 

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org


Mime
View raw message