TARGET_J2EE/JVM fixes
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Messaging / CADMessages.cs
old mode 100755 (executable)
new mode 100644 (file)
index 0c4d1de..ee14562
@@ -7,6 +7,29 @@
 // (C) Patrik Torstensson
 //
 
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System;
 using System.Collections;
 using System.IO;
@@ -147,8 +170,8 @@ namespace System.Runtime.Remoting.Messaging {
 
                        CADObjRef objref = arg as CADObjRef;
                        if (null != objref) {
-                               string typeName = new string (objref.TypeName.ToCharArray());
-                               string uri = new string (objref.URI.ToCharArray());
+                               string typeName = string.Copy (objref.TypeName);
+                               string uri = string.Copy (objref.URI);
                                int domid = objref.SourceDomain;
                                
                                ChannelInfo cinfo = new ChannelInfo (new CrossAppDomainData (domid));
@@ -201,7 +224,7 @@ namespace System.Runtime.Remoting.Messaging {
                                case TypeCode.UInt16: return (UInt16)arg;
                                case TypeCode.UInt32: return (UInt32)arg;
                                case TypeCode.UInt64: return (UInt64)arg;
-                               case TypeCode.String: return new String (((string)arg).ToCharArray());
+                               case TypeCode.String: return string.Copy ((string) arg);
                                case TypeCode.DateTime: return new DateTime (((DateTime)arg).Ticks);
                                default:
                                        if (arg is TimeSpan) return new TimeSpan (((TimeSpan)arg).Ticks);
@@ -255,29 +278,15 @@ namespace System.Runtime.Remoting.Messaging {
        // Used when passing a IMethodCallMessage between appdomains
        internal class CADMethodCallMessage : CADMessageBase {
                string _uri;
-               string _methodName;
-               string _typeName;
-
-               CADArgHolder _methodSignature;
-
-               internal string TypeName {
-                       get {
-                               return _typeName;
-                       }
-               }
-
+               
+               internal RuntimeMethodHandle MethodHandle;
+               
                internal string Uri {
                        get {
                                return _uri;
                        }
                }
 
-               internal string MethodName {
-                       get {
-                               return _methodName;
-                       }
-               }
-
                static internal CADMethodCallMessage Create (IMessage callMsg) {
                        IMethodCallMessage msg = callMsg as IMethodCallMessage;
                        if (null == msg)
@@ -287,9 +296,8 @@ namespace System.Runtime.Remoting.Messaging {
                }
 
                internal CADMethodCallMessage (IMethodCallMessage callMsg) {
-                       _methodName = callMsg.MethodName;
-                       _typeName = callMsg.TypeName;
                        _uri = callMsg.Uri;
+                       MethodHandle = callMsg.MethodBase.MethodHandle;
 
                        ArrayList serializeList = null; 
                        
@@ -297,15 +305,6 @@ namespace System.Runtime.Remoting.Messaging {
 
                        _args = MarshalArguments ( callMsg.Args, ref serializeList);
 
-                       // check if we need to save method signature
-                       if (RemotingServices.IsMethodOverloaded (callMsg)) {
-                               if (null == serializeList)
-                                       serializeList = new ArrayList();
-
-                               _methodSignature = new CADArgHolder (serializeList.Count);
-                               serializeList.Add(callMsg.MethodSignature);
-                       }
-
                        // Save callcontext
                        SaveLogicalCallContext (callMsg, ref serializeList);
                        
@@ -332,13 +331,6 @@ namespace System.Runtime.Remoting.Messaging {
                internal object [] GetArgs (ArrayList args) {
                        return UnmarshalArguments (_args, args);
                }
-                       
-               internal object [] GetMethodSignature (ArrayList args) {
-                       if (null == _methodSignature)
-                               return null;
-
-                       return (object []) args [_methodSignature.index];
-               }
 
                internal int PropertiesCount {
                        get {