User: mnf999 Date: 02/03/07 10:11:10 Modified: src/main/org/jboss/invocation MarshalledInvocation.java Log: Adapted to the new maps in payloads Revision Changes Path 1.5 +26 -17 jboss/src/main/org/jboss/invocation/MarshalledInvocation.java Index: MarshalledInvocation.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/invocation/MarshalledInvocation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MarshalledInvocation.java 27 Feb 2002 05:40:18 -0000 1.4 +++ MarshalledInvocation.java 7 Mar 2002 18:11:10 -0000 1.5 @@ -34,7 +34,7 @@ * * @see <related> * @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a> -* @version $Revision: 1.4 $ +* @version $Revision: 1.5 $ * Revisions: * * <p><b>Revisions:</b> @@ -187,11 +187,21 @@ // For externalization to work } + public MarshalledInvocation(Invocation invocation) + { + this(invocation.payload, invocation.as_is_payload); + public MarshalledInvocation(Map payload) { super(payload); } + public MarshalledInvocation(Map payload, Map as_is_payload) + { + super(payload); + this.as_is_payload = as_is_payload; + } + public MarshalledInvocation( Object id, Method m, @@ -219,7 +229,7 @@ // Keep it in the payload if (m != null) { - payload.put(METHOD, m); + transient_payload.put(METHOD, m); return m; } @@ -256,7 +266,8 @@ */ public Object getValue(Object key) { - Object value = payload.get(key); + + Object value = super.getValue(key); // The map may contain serialized values of the fields if (value instanceof MarshalledValue) @@ -281,6 +292,7 @@ throws IOException { + // FIXME marcf: the "specific" treatment of Transactions should be abstracted. // Write the TPC, not the local transaction out.writeObject(tpc); @@ -290,12 +302,7 @@ server but not in the generic JMX land. they will travel in the payload as MarshalledValue objects, see the Invocation getter logic */ - // FIXME MARCF: we can put some optimizations in what we serialize and not, for example - // classes that come from the JDK will be present at deserialization on the server side. - // So there is no need to marshal a "Principal" for example. - // This code could be "if class.getName().startsWith("java") then don't serialize. - // think about time, test these string manipulation to see if it is good (test method arguments - // with native object and with extensions... compare) + Iterator keys = payload.keySet().iterator(); while (keys.hasNext()) { @@ -305,18 +312,18 @@ // Bench the above for speed. //Replace the current object with a Marshalled representation - if (currentKey != TRANSACTION) - { - if (currentKey == METHOD) - // We write the hash instead of the method - sentData.put(METHOD, new Long(calculateHash((Method) payload.get(METHOD)))); - else - sentData.put (currentKey, new MarshalledValue(payload.get(currentKey))); - } + if (currentKey == METHOD) + // We write the hash instead of the method + sentData.put(METHOD, new Long(calculateHash((Method) payload.get(METHOD)))); + else + sentData.put (currentKey, new MarshalledValue(payload.get(currentKey))); } // The map contains only serialized representations of every other object out.writeObject(sentData); + + // This map is "safe" as is + out.writeObject(as_is_payload); } public void readExternal(java.io.ObjectInput in) @@ -327,5 +334,7 @@ // The map contains only serialized representations of every other object payload = (Map) in.readObject(); + + as_is_payload = (Map) in.readObject(); } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development