Exemplo n.º 1
0
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     lock (channelTemplates)
     {
         activatedServiceEntries.Add(entry.ObjectType, entry);
     }
 }
Exemplo n.º 2
0
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     RemotingConfigHandler.RegisterActivatedServiceType(entry);
     if (!RemotingConfiguration.s_ListeningForActivationRequests)
     {
         RemotingConfiguration.s_ListeningForActivationRequests = true;
         ActivationServices.StartListeningForRemoteRequests();
     }
 }
Exemplo n.º 3
0
 public static ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
 {
     lock (channelTemplates)
     {
         ActivatedServiceTypeEntry[] entries = new ActivatedServiceTypeEntry[activatedServiceEntries.Count];
         activatedServiceEntries.Values.CopyTo(entries, 0);
         return(entries);
     }
 }
Exemplo n.º 4
0
        /// <summary>Registers an object type recorded in the provided <see cref="T:System.Runtime.Remoting.ActivatedServiceTypeEntry" /> on the service end as one that can be activated on request from a client.</summary>
        /// <param name="entry">Configuration settings for the client-activated type. </param>
        /// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
        /// </PermissionSet>
        public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
        {
            Hashtable obj = RemotingConfiguration.channelTemplates;

            lock (obj)
            {
                RemotingConfiguration.activatedServiceEntries.Add(entry.ObjectType, entry);
            }
        }
            internal ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
            {
                ActivatedServiceTypeEntry[] entryArray = new ActivatedServiceTypeEntry[this._exportableClasses.Count];
                int num = 0;

                foreach (DictionaryEntry entry in this._exportableClasses)
                {
                    entryArray[num++] = (ActivatedServiceTypeEntry)entry.Value;
                }
                return(entryArray);
            }
 internal void StoreActivatedExports(RemotingXmlConfigFileData configData)
 {
     foreach (RemotingXmlConfigFileData.TypeEntry entry in configData.ServerActivatedEntries)
     {
         ActivatedServiceTypeEntry entry2 = new ActivatedServiceTypeEntry(entry.TypeName, entry.AssemblyName)
         {
             ContextAttributes = CreateContextAttributesFromConfigEntries(entry.ContextAttributes)
         };
         RemotingConfiguration.RegisterActivatedServiceType(entry2);
     }
 }
        public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
        {
            RemotingConfigHandler.RegisterActivatedServiceType(entry);

            // make sure we're listening for activation requests
            //  (all registrations for activated service types will come through here)
            if (!s_ListeningForActivationRequests)
            {
                s_ListeningForActivationRequests = true;
                ActivationServices.StartListeningForRemoteRequests();
            }
        } // RegisterActivatedServiceType
Exemplo n.º 8
0
        /// <summary>Retrieves an array of object types registered on the service end that can be activated on request from a client.</summary>
        /// <returns>An array of object types registered on the service end that can be activated on request from a client.</returns>
        /// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
        /// </PermissionSet>
        public static ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
        {
            Hashtable obj = RemotingConfiguration.channelTemplates;

            ActivatedServiceTypeEntry[] result;
            lock (obj)
            {
                ActivatedServiceTypeEntry[] array = new ActivatedServiceTypeEntry[RemotingConfiguration.activatedServiceEntries.Count];
                RemotingConfiguration.activatedServiceEntries.Values.CopyTo(array, 0);
                result = array;
            }
            return(result);
        }
Exemplo n.º 9
0
 // Register a service type that can be activated by a remote client.
 public static void RegisterActivatedServiceType
     (ActivatedServiceTypeEntry entry)
 {
     if (entry == null)
     {
         throw new ArgumentNullException("entry");
     }
     lock (typeof(RemotingConfiguration))
     {
         EnsureLoaded();
         if (activatedServiceTypes == null)
         {
             activatedServiceTypes = new Hashtable();
         }
         activatedServiceTypes[entry.ObjectType] = entry;
     }
 }
            internal void AddActivatedType(string typeName, string assemblyName, IContextAttribute[] contextAttributes)
            {
                if (typeName == null)
                {
                    throw new ArgumentNullException("typeName");
                }
                if (assemblyName == null)
                {
                    throw new ArgumentNullException("assemblyName");
                }
                if (this.CheckForRedirectedClientType(typeName, assemblyName))
                {
                    throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_CantUseRedirectedTypeForWellKnownService"), new object[] { typeName, assemblyName }));
                }
                ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(typeName, assemblyName)
                {
                    ContextAttributes = contextAttributes
                };
                string key = this.EncodeTypeAndAssemblyNames(typeName, assemblyName);

                this._exportableClasses.Add(key, entry);
            }
	// Register a service type that can be activated by a remote client.
	public static void RegisterActivatedServiceType
				(ActivatedServiceTypeEntry entry)
			{
				if(entry == null)
				{
					throw new ArgumentNullException("entry");
				}
				lock(typeof(RemotingConfiguration))
				{
					EnsureLoaded();
					if(activatedServiceTypes == null)
					{
						activatedServiceTypes = new Hashtable();
					}
					activatedServiceTypes[entry.ObjectType] = entry;
				}
			}
Exemplo n.º 12
0
        public static void RegisterActivatedServiceType(Type type)
        {
            ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(type);

            RemotingConfiguration.RegisterActivatedServiceType(entry);
        }
Exemplo n.º 13
0
		public static void RegisterActivatedServiceType (ActivatedServiceTypeEntry entry) 
		{
			lock (channelTemplates)
			{
				activatedServiceEntries.Add (entry.ObjectType, entry);
			}
		}
Exemplo n.º 14
0
		public static ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes () 
		{
			lock (channelTemplates)
			{
				ActivatedServiceTypeEntry[] entries = new ActivatedServiceTypeEntry[activatedServiceEntries.Count];
				activatedServiceEntries.Values.CopyTo (entries,0);
				return entries;
			}
		}
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     Contract.Requires(entry != null);
 }
        public static void RegisterActivatedServiceType(Type type)
        {
            ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(type);

            RegisterActivatedServiceType(entry);
        }
Exemplo n.º 17
0
 // helper for Configuration::RegisterActivatedServiceType
 internal static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {   
     Info.AddActivatedType(entry.TypeName, entry.AssemblyName, 
                           entry.ContextAttributes);
 } // RegisterActivatedServiceType
Exemplo n.º 18
0
            //
            // helper functions to retrieve registered types
            //


            internal ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
            {
                ActivatedServiceTypeEntry[] entries =
                    new ActivatedServiceTypeEntry[_exportableClasses.Count];

                int co = 0;
                foreach (DictionaryEntry dictEntry in _exportableClasses)
                {
                    entries[co++] = (ActivatedServiceTypeEntry)dictEntry.Value;
                }
                    
                return entries;
            } // GetRegisteredActivatedServiceTypes
 public static void RegisterActivatedServiceType(Type type)
 {
     ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(type);
     RemotingConfiguration.RegisterActivatedServiceType(entry);
 } // RegisterActivatedServiceType
 public static void RegisterActivatedServiceType(Type type)
 {
     ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(type);
     RegisterActivatedServiceType(entry);
 }
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     RemotingConfigHandler.RegisterActivatedServiceType(entry);
     if (!s_ListeningForActivationRequests)
     {
         s_ListeningForActivationRequests = true;
         ActivationServices.StartListeningForRemoteRequests();
     }
 }
 internal void AddActivatedType(string typeName, string assemblyName, IContextAttribute[] contextAttributes)
 {
     if (typeName == null)
     {
         throw new ArgumentNullException("typeName");
     }
     if (assemblyName == null)
     {
         throw new ArgumentNullException("assemblyName");
     }
     if (this.CheckForRedirectedClientType(typeName, assemblyName))
     {
         throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_CantUseRedirectedTypeForWellKnownService"), new object[] { typeName, assemblyName }));
     }
     ActivatedServiceTypeEntry entry = new ActivatedServiceTypeEntry(typeName, assemblyName) {
         ContextAttributes = contextAttributes
     };
     string key = this.EncodeTypeAndAssemblyNames(typeName, assemblyName);
     this._exportableClasses.Add(key, entry);
 }
 internal static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     Info.AddActivatedType(entry.TypeName, entry.AssemblyName, entry.ContextAttributes);
 }
        public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
        {
            RemotingConfigHandler.RegisterActivatedServiceType(entry);

            // make sure we're listening for activation requests
            //  (all registrations for activated service types will come through here)
            if (!s_ListeningForActivationRequests)
            {
                s_ListeningForActivationRequests = true;
                ActivationServices.StartListeningForRemoteRequests();
            }
        } // RegisterActivatedServiceType
 internal ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
 {
     ActivatedServiceTypeEntry[] entryArray = new ActivatedServiceTypeEntry[this._exportableClasses.Count];
     int num = 0;
     foreach (DictionaryEntry entry in this._exportableClasses)
     {
         entryArray[num++] = (ActivatedServiceTypeEntry) entry.Value;
     }
     return entryArray;
 }
Exemplo n.º 26
0
            } // GetRegisteredWellKnownClientTypes


            //
            // end of helper functions to retrieve registered types
            //

            internal void AddActivatedType(String typeName, String assemblyName,
                                           IContextAttribute[] contextAttributes)
            {
                if (typeName == null)
                    throw new ArgumentNullException("typeName");
                if (assemblyName == null)
                    throw new ArgumentNullException("assemblyName");
                Contract.EndContractBlock();

                if (CheckForRedirectedClientType(typeName, assemblyName))
                {
                    throw new RemotingException(
                        String.Format(
                            CultureInfo.CurrentCulture, Environment.GetResourceString(
                                "Remoting_Config_CantUseRedirectedTypeForWellKnownService"),
                            typeName, assemblyName));
                }                                

                ActivatedServiceTypeEntry aste =  
                    new ActivatedServiceTypeEntry(typeName, assemblyName);
                aste.ContextAttributes = contextAttributes;
            
                //   The assembly name is stored in lowercase to let it be case-insensitive.
                String key = EncodeTypeAndAssemblyNames(typeName, assemblyName);
                _exportableClasses.Add(key, aste);
            } // AddActivatedType
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
   Contract.Requires(entry != null);
 }
Exemplo n.º 28
0
            //
            // XML Configuration Helper Functions
            //

            internal void StoreActivatedExports(RemotingXmlConfigFileData configData)
            {
                foreach (RemotingXmlConfigFileData.TypeEntry entry in configData.ServerActivatedEntries)
                {
                    ActivatedServiceTypeEntry aste =
                        new ActivatedServiceTypeEntry(entry.TypeName, entry.AssemblyName);
                    aste.ContextAttributes = 
                        CreateContextAttributesFromConfigEntries(entry.ContextAttributes);
                
                    RemotingConfiguration.RegisterActivatedServiceType(aste);
                }
            } // StoreActivatedExports
Exemplo n.º 29
0
 public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
 {
     throw new NotImplementedException();
 }