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 20:57:33 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

------------------------------------------------------------------------------
  This approach results in having the following objects as major
  participants in the message context serialization:            
  
-  MessageContext     
+  a. Message Context     
-  OperationContext   
+  a. Operation Context   
-  ServiceContext     
+  a. Service Context     
-  ServiceGroupContext
+  a. Service Group Context
-  SessionContext     
+  a. Session Context     
-  Options            
+  a. Options            
-   
-                    
  
+ In general, the message context will save objects with pertinent runtime  
+ data.  The message context will not save objects with static deployment   
+ data but instead saves some identifying information about them.  When the 
+ message context is restored, the message context "plugs itself back in" to
+ the deployment set of objects that exist on that engine.                  
+ 
+ == How to Save/Restore a Message Context ==
+ 
+ === Sample code to save a Message Context ===
+ 
+   // attach a stream capable of writing objects to the output stream
+   ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
+                                                                     
+   // save the message context
+   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);       
+                                                                        
+   // restore the message context
+   MessageContext msgContext2 = (MessageContext) inObjStream.readObject();
+                                                                        
+   // if you don't go through the AxisEngine then you need to activate
+   // the restored message context before using it
+   msgContext2.activate(configurationContext);                            
+ 
+ 
+ == Limitations/Restrictions on the Message Context Serialization Support ==
+ 
+  * The message context serialization has the limitation that the server, on
+  which a message context is being reconstituted and resumed, needs to have 
+  the same configuration and deployment as the server from which the message
+  context was saved.  In other words, the server used in the restart must be
+  equal is all respects to the server that stopped (same configuration, same
+  deployment, same web services, etc).  In other words, the application web 
+  service cannot be uninstalled from the server or have its web services    
+  operations modified in a significant way between the time that the message
+  context is saved and then restored.                                       
+ 
+  * Memory footprint is larger, not optimized - if a lot of messages are   
+  saved/restored, then the memory footprint will be larger due to the fact 
+  that a reconstituted message context uses a larger set of unique objects 
+  than a message context that was not save/restored. This may be examined 
+  later.                    
+ 
+  * Application objects stored in the Message Context or Options properties
+  lists need to support java.io.Serializable or java.io.Externalizable in  
+  order to be saved/restored.  Any object that fails to participate in     
+  the save/restore activity causes a NotSerializable exception which is    
+  logged.  Note that this failure may or may not be critical depending on  
+  the application.  In either case, the information is flagged in the log. 
+ 
+ 
+ == Java Serialization Background ==
+ 
+ Object serialization is the process of saving an object's state and       
+ rebuilding the object from the saved information.  The serialization      
+ mechanism provides a way to read and write an object to and from a raw    
+ byte stream.  The process of serializing an object involves traversing the
+ graph created by the object's references to other objects and primitives. 
+ The point is to collect the information needed to preserve the object and 
+ allow the object to regain its state when the object is de-serialized.  In
+ other words, all pertinent data in the object (including other objects    
+ that are referenced by the object) get saved.  There are 3 ways to perform
+ object serialization: using the default mechanism (java.io.Serializable), 
+ customizing the default mechanism, and using a customized protocol        
+ (java.io.Externalizable).                                                 
+ 

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


Mime
View raw message