2002-08-05 Rodrigo Moya <rodrigo@ximian.com>
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Channels / ChannelServices.cs
1 //
2 // System.Runtime.Remoting.Channels.ChannelServices.cs
3 //
4 // Author: Rodrigo Moya (rodrigo@ximian.com)
5 //
6 // 2002 (C) Copyright, Ximian, Inc.
7 //
8
9 using System.Collections;
10 using System.Runtime.Remoting.Messaging;
11
12 namespace System.Runtime.Remoting.Channels
13 {
14         public sealed class ChannelServices
15         {
16                 private static ArrayList registeredChannels = new ArrayList ();
17                 
18                 public static IChannel[] RegisteredChannels
19                 {
20                         get {
21                                 IChannel[] channels = new IChannel[registeredChannels.Count];
22
23                                 for (int i = 0; i < registeredChannels.Count; i++)
24                                         channels[i] = (IChannel) registeredChannels[i];
25
26                                 return channels;
27                         }
28                 }
29
30                 [MonoTODO]
31                 public static IMessageCtrl AsyncDispatchMessage (IMessage msg,
32                                                                  IMessageSink replySink)
33                 {
34                         throw new NotImplementedException ();
35                 }
36
37                 [MonoTODO]
38                 public static IServerChannelSink CreateServerChannelSinkChain (
39                         IServerChannelSinkProvider provider,
40                         IChannelReceiver channel)
41                 {
42                         throw new NotImplementedException ();
43                 }
44
45                 [MonoTODO]
46                 public static ServerProcessing DispatchMessage (
47                         IServerChannelSinkStack sinkStack,
48                         IMessage msg,
49                         out IMessage replyMsg)
50                 {
51                         throw new NotImplementedException ();
52                 }
53
54                 [MonoTODO]
55                 public static IChannel GetChannel (string name)
56                 {
57                         throw new NotImplementedException ();
58                 }
59
60                 [MonoTODO]
61                 public static IDictionary GetChannelSinkProperties (object obj)
62                 {
63                         throw new NotImplementedException ();
64                 }
65
66                 [MonoTODO]
67                 public static string[] GetUrlsForObject (MarshalByRefObject obj)
68                 {
69                         throw new NotImplementedException ();
70                 }
71
72                 public static void RegisterChannel (IChannel chnl)
73                 {
74                         registeredChannels.Add ((object) chnl);
75                 }
76
77                 [MonoTODO]
78                 public static IMessage SyncDispatchMessage (IMessage msg)
79                 {
80                         throw new NotImplementedException ();
81                 }
82
83                 public static void UnregisterChannel (IChannel chnl)
84                 {
85                         if (chnl == null)
86                                 throw new ArgumentNullException ();
87                         if (!registeredChannels.Contains ((object) chnl))
88                                 throw new RemotingException ();
89
90                         registeredChannels.Remove ((object) chnl);
91                 }
92         }
93 }