ActivatedServiceTypeEntry クラス

定義

クライアントからの要求に基づいてアクティブにできる型として、サービス エンドで登録されたオブジェクト型の値を保持します。

public ref class ActivatedServiceTypeEntry : System::Runtime::Remoting::TypeEntry
public class ActivatedServiceTypeEntry : System.Runtime.Remoting.TypeEntry
[System.Runtime.InteropServices.ComVisible(true)]
public class ActivatedServiceTypeEntry : System.Runtime.Remoting.TypeEntry
type ActivatedServiceTypeEntry = class
    inherit TypeEntry
[<System.Runtime.InteropServices.ComVisible(true)>]
type ActivatedServiceTypeEntry = class
    inherit TypeEntry
Public Class ActivatedServiceTypeEntry
Inherits TypeEntry
継承
ActivatedServiceTypeEntry
属性

#using <System.Runtime.Remoting.dll>
#using <ActivatedServiceTypeEntry_ObjectType_Share.dll>

using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Tcp;
void main()
{
   ChannelServices::RegisterChannel( gcnew TcpChannel( 8082 ) );
   
   // Create an instance of 'ActivatedServiceTypeEntry' class
   // which holds the values for 'HelloServer' type.
   ActivatedServiceTypeEntry^ myActivatedServiceTypeEntry =
      gcnew ActivatedServiceTypeEntry( HelloServer::typeid );
   
   // 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.
   array<ActivatedServiceTypeEntry^>^ activatedServiceEntries =
      RemotingConfiguration::GetRegisteredActivatedServiceTypes();
   Console::WriteLine( "Information of first registered activated" +
     " service type :" );
   Console::WriteLine( "Object type: {0}",
      activatedServiceEntries[ 0 ]->ObjectType->ToString() );
   Console::WriteLine( "Description: {0}",
      activatedServiceEntries[ 0 ]->ToString() );

   Console::WriteLine( "Press enter to stop this process" );
   Console::ReadLine();
}
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();
   }
}
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp

Public Class MyClient
   
   Public Shared Sub Main()
      ChannelServices.RegisterChannel(New TcpChannel(8082))
      ' Create an instance of 'ActivatedServiceTypeEntry' class
      ' which holds the values for 'HelloServer' type.
      Dim myActivatedServiceTypeEntry As New ActivatedServiceTypeEntry(GetType(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 .
      Dim myActivatedServiceEntries As ActivatedServiceTypeEntry() = RemotingConfiguration. _
                                                         GetRegisteredActivatedServiceTypes()
      Console.WriteLine("Information of first registered activated " + " service type :")
      Console.WriteLine("Object type: " + myActivatedServiceEntries(0).ObjectType.ToString())
      Console.WriteLine("Description: " + myActivatedServiceEntries(0).ToString())
      Console.WriteLine("Press enter to stop this process")
      Console.ReadLine()
   End Sub
End Class

注釈

現在のクラスは、 メソッドによって RemotingConfiguration.RegisterActivatedServiceType 使用されます。これは、 メソッドに対応するサーバー側です RemotingConfiguration.RegisterActivatedClientType 。 メソッドは RegisterActivatedServiceType 、指定したオブジェクトの種類のクライアントによるリモート アクティブ化を許可するために、サーバーで使用されます。

サーバー上にクライアントでアクティブ化されたオブジェクトを作成するには、その Typeを認識している必要があります。また、 メソッドを使用して RegisterActivatedServiceType サーバー側に登録する必要があります。 新しいクライアントでアクティブ化されたオブジェクトのプロキシを取得するには、クライアントが最初に にチャネルChannelServicesを登録してから、 または Activator.CreateInstanceを呼び出newしてオブジェクトをアクティブ化する必要があります。

キーワード (keyword)を使用してクライアントでアクティブ化されたオブジェクトの種類をnewアクティブ化するには、まず メソッドを使用してクライアントにオブジェクトの種類を登録するRegisterActivatedClientType必要があります。 を呼び出 RegisterActivatedClientType すことで、リモート処理インフラストラクチャに、リモート アプリケーションの作成を試みる場所 new が提供されます。 一方、 メソッドを使用 CreateInstance してクライアントでアクティブ化されたオブジェクトの新しいインスタンスを作成する場合は、リモート アプリケーションの URL をパラメーターとして指定する必要があるため、クライアントでの事前登録は必要ありません。 オブジェクトを CreateInstance 作成するサーバーの URL を メソッドに指定するには、 クラスのインスタンスに URL をカプセル化する UrlAttribute 必要があります。

クライアントでアクティブ化されたオブジェクトとリモート オブジェクトのアクティブ化の詳細については、「 リモート オブジェクトのアクティブ化」を参照してください。

コンストラクター

ActivatedServiceTypeEntry(String, String)

指定した型名とアセンブリ名を使用して、ActivatedServiceTypeEntry クラスの新しいインスタンスを初期化します。

ActivatedServiceTypeEntry(Type)

指定した ActivatedServiceTypeEntry を使用して、Type クラスの新しいインスタンスを初期化します。

プロパティ

AssemblyName

リモート アクティブ型になるように構成されたオブジェクト型のアセンブリ名を取得します。

(継承元 TypeEntry)
ContextAttributes

クライアント側でアクティブ化されるサービス型のコンテキスト属性を取得または設定します。

ObjectType

クライアント側でアクティブ化されるサービス型の Type を取得します。

TypeName

リモート アクティブ型になるように構成されたオブジェクト型の完全な型名を取得します。

(継承元 TypeEntry)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

クライアント側でアクティブ化されるサービス型の型名とアセンブリ名を String として返します。

適用対象

こちらもご覧ください