+2002-08-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * ChannelDataStore.cs: use a hash to store other keys
+
2002-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ChannelServices.cs: added private .ctor
// System.Runtime.Remoting.Channels.ChannelDataStore.cs
//
// Author: Rodrigo Moya (rodrigo@ximian.com)
+// Dietmar Maurer (dietmar@ximian.com)
//
// 2002 (C) Copyright, Ximian, Inc.
//
+using System.Collections;
+
namespace System.Runtime.Remoting.Channels
{
public class ChannelDataStore : IChannelDataStore
{
- private string[] channelUris;
+ string[] channelUris;
+ Hashtable hash;
public ChannelDataStore (string[] uris)
{
public object this[object key]
{
- [MonoTODO]
get {
- throw new NotImplementedException ();
+ if (hash == null)
+ hash = new Hashtable ();
+
+ return hash [key];
}
- [MonoTODO]
set {
- throw new NotImplementedException ();
+ if (hash == null)
+ hash = new Hashtable ();
+
+ hash [key] = value;
}
}
}
// System.Runtime.Remoting.Channels.ChannelServices.cs
//
// Author: Rodrigo Moya (rodrigo@ximian.com)
+// Dietmar Maurer (dietmar@ximian.com)
//
// 2002 (C) Copyright, Ximian, Inc.
//
namespace System.Runtime.Remoting.Channels
{
+ internal class ChannelInfoStore : IChannelInfo
+ {
+ object [] data = null;
+
+ public ChannelInfoStore ()
+ {
+ this.data = ChannelServices.GetCurrentChannelInfo ();
+ }
+
+ public object[] ChannelData {
+
+ get {
+ return data;
+ }
+
+ set {
+ data = value;
+ }
+ }
+ }
+
public sealed class ChannelServices
{
private static ArrayList registeredChannels = new ArrayList ();
public static void RegisterChannel (IChannel chnl)
{
+ // fixme: sort it by priority
registeredChannels.Add ((object) chnl);
}
registeredChannels.Remove ((object) chnl);
}
+
+ internal static object [] GetCurrentChannelInfo ()
+ {
+ ArrayList list = new ArrayList ();
+
+ foreach (object chnl_obj in registeredChannels) {
+ IChannelReceiver chnl = chnl_obj as IChannelReceiver;
+ if (chnl != null) {
+ object chnl_data = chnl.ChannelData;
+ if (chnl_data != null)
+ list.Add (chnl_data);
+ }
+ }
+
+ return list.ToArray ();
+ }
}
}
+2002-08-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * ObjRef.cs: gather the channel date at creation time.
+
2002-08-20 Dietmar Maurer <dietmar@ximian.com>
* RemotingServices.cs: Connect impl.
using System;
using System.Runtime.Serialization;
+using System.Runtime.Remoting.Channels;
namespace System.Runtime.Remoting {
[Serializable]
public class ObjRef : IObjectReference, ISerializable {
MarshalByRefObject mbr;
- SerializationInfo si;
+ IChannelInfo chnl_info;
string uri;
Type type;
+
public ObjRef ()
{
+ // no idea why this needs to be public
}
public ObjRef (MarshalByRefObject mbr, Type type)
{
this.mbr = mbr;
this.type = type;
+
+ chnl_info = new ChannelInfoStore ();
}
[MonoTODO]
// This encarnates the object from serialized data.
}
- [MonoTODO]
public virtual IChannelInfo ChannelInfo {
+
get {
- throw new NotImplementedException ();
+ return chnl_info;
}
+
set {
- throw new NotImplementedException ();
+ chnl_info = value;
}
}
// FIXME:
}
- [MonoTODO]
public virtual object GetRealObject (StreamingContext sc)
{
- // FIXME:
+ if (IsFromThisAppDomain ())
+ return mbr;
+ // FIXME:
return null;
}
- [MonoTODO]
public bool IsFromThisAppDomain ()
{
- // FIXME:
-
- return true;
+ return (mbr != null);
}
[MonoTODO]