ActivatedServiceTypeEntry Class

Definition

Holds values for an object type registered on the service end as one that can be activated on request from a client.

C#
public class ActivatedServiceTypeEntry : System.Runtime.Remoting.TypeEntry
C#
[System.Runtime.InteropServices.ComVisible(true)]
public class ActivatedServiceTypeEntry : System.Runtime.Remoting.TypeEntry
Inheritance
ActivatedServiceTypeEntry
Attributes

Examples

C#
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

public class MyClient
{
   public static void Main()
   {
      ChannelServices.RegisterChannel(new TcpChannel(8082));
      // Create an instance of 'ActivatedServiceTypeEntry' class
      // which holds the values for 'HelloServer' type.
      ActivatedServiceTypeEntry myActivatedServiceTypeEntry =
                   new ActivatedServiceTypeEntry(typeof(HelloServer));
      // Register an object Type on the service end so that
      // it can be activated on request from a client.
      RemotingConfiguration.RegisterActivatedServiceType(
                                         myActivatedServiceTypeEntry);
      // Get the registered activated service types .
      ActivatedServiceTypeEntry[] myActivatedServiceEntries =
          RemotingConfiguration.GetRegisteredActivatedServiceTypes();
      Console.WriteLine("Information of first registered activated "
                             +" service type :");
      Console.WriteLine("Object type: "
                       +myActivatedServiceEntries[0].ObjectType);
      Console.WriteLine("Description: "
                           +myActivatedServiceEntries[0].ToString());
      Console.WriteLine("Press enter to stop this process");
      Console.ReadLine();
   }
}

Remarks

The current class is used by the RemotingConfiguration.RegisterActivatedServiceType method, which is the server-side counterpart of the RemotingConfiguration.RegisterActivatedClientType method. The RegisterActivatedServiceType method is used on the server to allow remote activation by clients of specified object types.

To create a client-activated object on the server, you must know its Type, and it must be registered on the server end by using the RegisterActivatedServiceType method. To obtain a proxy for a new client-activated object, the client must first register a channel with ChannelServices and then activate the object by calling new or Activator.CreateInstance.

To activate a client-activated object type with the new keyword, you must first register the object type on the client using the RegisterActivatedClientType method. By calling RegisterActivatedClientType you are giving the remoting infrastructure the location of the remote application where new attempts to create it. If, on the other hand, you use the CreateInstance method to create a new instance of the client-activated object, you must supply the remote application's URL as a parameter, so no prior registration on the client is necessary. To supply the CreateInstance method with the URL of the server on which you want to create the object, you must encapsulate the URL in an instance of the UrlAttribute class.

For a detailed description of client-activated objects and remote object activation, see Activation of Remote Objects.

Constructors

ActivatedServiceTypeEntry(String, String)

Initializes a new instance of the ActivatedServiceTypeEntry class with the given type name and assembly name.

ActivatedServiceTypeEntry(Type)

Initializes a new instance of the ActivatedServiceTypeEntry class with the given Type.

Properties

AssemblyName

Gets the assembly name of the object type configured to be a remote-activated type.

(Inherited from TypeEntry)
ContextAttributes

Gets or sets the context attributes for the client-activated service type.

ObjectType

Gets the Type of the client-activated service type.

TypeName

Gets the full type name of the object type configured to be a remote-activated type.

(Inherited from TypeEntry)

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns the type and assembly name of the client-activated service type as a String.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also