ActivatedClientTypeEntry クラス
アセンブリ: mscorlib (mscorlib.dll 内)


クライアント側でアクティブ化されるオブジェクトのインスタンスをクライアントで作成するには、Type を確認し、RegisterActivatedClientType メソッドを使用して、クライアント側で登録する必要があります。クライアント側でアクティブ化されるオブジェクトの新しいインスタンスのプロキシを取得するには、クライアントは最初にそのチャネルを ChannelServices で登録してから new を呼び出して、そのオブジェクトをアクティブにする必要があります。
クライアント側でアクティブ化されるオブジェクトの型を new キーワードを使用してアクティブにするには、初めに RegisterActivatedClientType メソッドを使用して、そのオブジェクトの型をクライアント側で登録しておく必要があります。RegisterActivatedClientType を呼び出すと、new が作成しようとするリモート アプリケーションの場所がリモート処理インフラストラクチャに通知されます。一方、Activator.CreateInstance メソッドを使用して、クライアント側でアクティブ化されるオブジェクトの新しいインスタンスを作成する場合は、リモート アプリケーションの URL をパラメータで指定する必要があります。このため、クライアント エンドでの事前の登録は必要ありません。Activator.CreateInstance メソッドに、オブジェクトを作成するサーバーの URL を指定するには、UrlAttribute クラスのインスタンスにその URL をカプセル化する必要があります。
クライアント側でアクティブ化されるオブジェクトとリモート オブジェクト アクティベーションの詳細については、「リモート オブジェクトのアクティべーション」を参照してください。

ActivatedClientTypeEntry を使用して、クライアント側でアクティブ化されるリモート オブジェクトを登録する方法を次のコード例に示します。この例には、クライアント、サーバー、およびクライアントとサーバーから使用されるリモート オブジェクトの 3 つの部分が含まれます。
Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.Tcp Public Class MyClient Public Shared Sub Main() ' Register TCP Channel. ChannelServices.RegisterChannel(New TcpChannel()) ' Create activated client type entry. Dim myActivatedClientTypeEntry As _ New ActivatedClientTypeEntry(GetType(HelloServer), _ "tcp://localhost:8082") ' Register type on client to activate it on the server. RemotingConfiguration.RegisterActivatedClientType( _ myActivatedClientTypeEntry) ' Activate a client activated object type. Dim myHelloServer As New HelloServer("ParameterString") ' Print the object type. Console.WriteLine("Object type of client activated object: " + _ myActivatedClientTypeEntry.ObjectType.ToString()) ' Print the application URL. Console.WriteLine("Application url where the type is activated: " + _ myActivatedClientTypeEntry.ApplicationUrl) ' Print the string representation of the type entry. Console.WriteLine( _ "Type name, assembly name and application URL " + _ "of the remote object: " + _ myActivatedClientTypeEntry.ToString()) ' Print a blank line. Console.WriteLine() ' Check that server was located. If myHelloServer Is Nothing Then Console.WriteLine("Could not locate server") Else Console.WriteLine("Calling remote object") Console.WriteLine(myHelloServer.HelloMethod("Bill")) End If End Sub 'Main End Class 'MyClient
using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; public class MyClient { public static void Main() { // Register TCP Channel. ChannelServices.RegisterChannel(new TcpChannel()); // Create activated client type entry. ActivatedClientTypeEntry myActivatedClientTypeEntry = new ActivatedClientTypeEntry(typeof(HelloServer), "tcp://localhost:8082"); // Register type on client to activate it on the server. RemotingConfiguration.RegisterActivatedClientType( myActivatedClientTypeEntry); // Activate a client activated object type. HelloServer myHelloServer = new HelloServer("ParameterString"); // Print the object type. Console.WriteLine( "Object type of client activated object: " + myActivatedClientTypeEntry.ObjectType.ToString()); // Print the application URL. Console.WriteLine( "Application url where the type is activated: " + myActivatedClientTypeEntry.ApplicationUrl); // Print the string representation of the type entry. Console.WriteLine( "Type name, assembly name and application URL " + "of the remote object: " + myActivatedClientTypeEntry.ToString()); // Print a blank line. Console.WriteLine(); // Check that server was located. if (myHelloServer == null) { Console.WriteLine("Could not locate server"); } else { Console.WriteLine("Calling remote object"); Console.WriteLine(myHelloServer.HelloMethod("Bill")); } } }
#using <System.Runtime.Remoting.dll> #using <ActivatedClientTypeEntry_Share.dll> using namespace System; using namespace System::Runtime::Remoting; using namespace System::Runtime::Remoting::Channels; using namespace System::Runtime::Remoting::Channels::Tcp; static void main() { // Register TCP Channel. ChannelServices::RegisterChannel( gcnew TcpChannel ); // Create activated client type entry. ActivatedClientTypeEntry^ activatedClientTypeEntry = gcnew ActivatedClientTypeEntry( HelloServer::typeid, "tcp://localhost:8082" ); // Register type on client to activate it on the server. RemotingConfiguration::RegisterActivatedClientType( activatedClientTypeEntry ); // Activate a client activated object type. HelloServer^ helloServer = gcnew HelloServer( "ParameterString" ); // Print the object type. Console::WriteLine( "Object type of client activated object: {0}", activatedClientTypeEntry->ObjectType->ToString() ); // Print the application URL. Console::WriteLine( "Application url where the type is activated: {0}", activatedClientTypeEntry->ApplicationUrl->ToString() ); // Print the string representation of the type entry. Console::WriteLine( "Type and assembly name and application URL of the remote object: {0}", activatedClientTypeEntry->ToString() ); // Print a blank line. Console::WriteLine(); // Check that server was located. if ( !helloServer ) { Console::WriteLine( "Could not locate server" ); } else { Console::WriteLine( "Calling remote object" ); Console::WriteLine( helloServer->HelloMethod( "Bill" ) ); } }
import System.*; import System.Runtime.Remoting.*; import System.Runtime.Remoting.Channels.*; import System.Runtime.Remoting.Channels.Tcp.*; public class MyClient { public static void main(String[] args) { // Register TCP Channel. ChannelServices.RegisterChannel(new TcpChannel()); // Create activated client type entry. ActivatedClientTypeEntry myActivatedClientTypeEntry = new ActivatedClientTypeEntry(HelloServer.class.ToType(), "tcp://localhost:8082"); // Register type on client to activate it on the server. RemotingConfiguration.RegisterActivatedClientType( myActivatedClientTypeEntry); // Activate a client activated object type. HelloServer myHelloServer = new HelloServer("ParameterString"); // Print the object type. Console.WriteLine(("Object type of client activated object: " + myActivatedClientTypeEntry.get_ObjectType().ToString())); // Print the application URL. Console.WriteLine("Application url where the type is activated: " + myActivatedClientTypeEntry.get_ApplicationUrl()); // Print the string representation of the type entry. Console.WriteLine("Type name, assembly name and application URL " + "of the remote object: " + myActivatedClientTypeEntry.ToString()); // Print a blank line. Console.WriteLine(); // Check that server was located. if (myHelloServer == null) { Console.WriteLine("Could not locate server"); } else { Console.WriteLine("Calling remote object"); Console.WriteLine(myHelloServer.HelloMethod("Bill")); } } //main } //MyClient
Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.Tcp Public Class MyServer Public Shared Sub Main() ChannelServices.RegisterChannel(New TcpChannel(8082)) RemotingConfiguration.RegisterActivatedServiceType(GetType(HelloServer)) Console.WriteLine("Press enter to stop this process") Console.ReadLine() End Sub 'Main End Class 'MyServer
using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; public class MyServer { public static void Main() { ChannelServices.RegisterChannel(new TcpChannel(8082)); RemotingConfiguration.RegisterActivatedServiceType(typeof(HelloServer)); Console.WriteLine("Press enter to stop this process"); Console.ReadLine(); } }
#using <ActivatedClientTypeEntry_Share.dll> #using <System.Runtime.Remoting.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 ) ); RemotingConfiguration::RegisterActivatedServiceType( HelloServer::typeid ); Console::WriteLine( "Press enter to stop this process" ); Console::ReadLine(); }
import System.*; import System.Runtime.Remoting.*; import System.Runtime.Remoting.Channels.*; import System.Runtime.Remoting.Channels.Tcp.*; public class MyServer { public static void main(String[] args) { ChannelServices.RegisterChannel(new TcpChannel(8082)); RemotingConfiguration.RegisterActivatedServiceType(HelloServer. class.ToType()); Console.WriteLine("Press enter to stop this process"); Console.ReadLine(); } //main } //MyServer
クライアントとサーバーから使用されるリモート オブジェクトを提供するコード例を次に示します。
Imports System Public Class HelloServer Inherits MarshalByRefObject Public Sub New(myString As String) Console.WriteLine("HelloServer activated") Console.WriteLine("Parameter passed to the constructor is " + myString) End Sub 'New Public Function HelloMethod(myName As String) As String Console.WriteLine("HelloMethod : {0}", myName) Return "Hi there " + myName End Function 'HelloMethod End Class 'HelloServer
using System; public class HelloServer : MarshalByRefObject { public HelloServer(String myString) { Console.WriteLine("HelloServer activated"); Console.WriteLine("Parameter passed to the constructor is "+myString); } public String HelloMethod(String myName) { Console.WriteLine("HelloMethod : {0}",myName); return "Hi there " + myName; } }
using namespace System; public ref class HelloServer: public MarshalByRefObject { public: HelloServer( String^ myString ) { Console::WriteLine( "HelloServer activated" ); Console::WriteLine( "Paramater passed to the constructor is {0}", myString ); } String^ HelloMethod( String^ myName ) { Console::WriteLine( "HelloMethod : {0}", myName ); return String::Format( "Hi there {0}", myName ); } };
import System.*; public class HelloServer extends MarshalByRefObject { public HelloServer(String myString) { Console.WriteLine("HelloServer activated"); Console.WriteLine("Parameter passed to the constructor is " + myString); } //HelloServer public String HelloMethod(String myName) { Console.WriteLine("HelloMethod : {0}", myName); return "Hi there " + myName; } //HelloMethod } //HelloServer

System.Runtime.Remoting.TypeEntry
System.Runtime.Remoting.ActivatedClientTypeEntry


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ActivatedClientTypeEntry コンストラクタ (String, String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim typeName As String Dim assemblyName As String Dim appUrl As String Dim instance As New ActivatedClientTypeEntry(typeName, assemblyName, appUrl)
public function ActivatedClientTypeEntry ( typeName : String, assemblyName : String, appUrl : String )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ActivatedClientTypeEntry コンストラクタ (Type, String)
アセンブリ: mscorlib (mscorlib.dll 内)



ActivatedClientTypeEntry の作成方法を次のコード例に示します。
' Create activated client type entry. Dim myActivatedClientTypeEntry As _ New ActivatedClientTypeEntry(GetType(HelloServer), _ "tcp://localhost:8082")
// Create activated client type entry. ActivatedClientTypeEntry myActivatedClientTypeEntry = new ActivatedClientTypeEntry(typeof(HelloServer), "tcp://localhost:8082");

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ActivatedClientTypeEntry コンストラクタ

名前 | 説明 |
---|---|
ActivatedClientTypeEntry (Type, String) | 指定した Type とアプリケーションの URL を使用して、ActivatedClientTypeEntry クラスの新しいインスタンスを初期化します。 |
ActivatedClientTypeEntry (String, String, String) | 指定した型名、アセンブリ名、およびアプリケーションの URL を使用して、ActivatedClientTypeEntry クラスの新しいインスタンスを初期化します。 |

ActivatedClientTypeEntry プロパティ

名前 | 説明 | |
---|---|---|
![]() | ApplicationUrl | 型をアクティブにするアプリケーションの URL を取得します。 |
![]() | AssemblyName | リモート アクティブ型になるように構成されたオブジェクト型のアセンブリ名を取得します。 ( TypeEntry から継承されます。) |
![]() | ContextAttributes | クライアント側でアクティブ化される型のコンテキスト属性を取得または設定します。 |
![]() | ObjectType | クライアント側でアクティブ化される型の Type を取得します。 |
![]() | TypeName | リモート アクティブ型になるように構成されたオブジェクト型の完全な型名を取得します。 ( TypeEntry から継承されます。) |

ActivatedClientTypeEntry メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 クライアント側でアクティブ化される型の型名、アセンブリ名、およびアプリケーションの URL を String として返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ActivatedClientTypeEntry メンバ
サーバーでアクティブにできる型としてクライアント エンドで登録されたオブジェクト型の値を保持します。
ActivatedClientTypeEntry データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | ApplicationUrl | 型をアクティブにするアプリケーションの URL を取得します。 |
![]() | AssemblyName | リモート アクティブ型になるように構成されたオブジェクト型のアセンブリ名を取得します。(TypeEntry から継承されます。) |
![]() | ContextAttributes | クライアント側でアクティブ化される型のコンテキスト属性を取得または設定します。 |
![]() | ObjectType | クライアント側でアクティブ化される型の Type を取得します。 |
![]() | TypeName | リモート アクティブ型になるように構成されたオブジェクト型の完全な型名を取得します。(TypeEntry から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 クライアント側でアクティブ化される型の型名、アセンブリ名、およびアプリケーションの URL を String として返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からActivatedClientTypeEntryを検索する場合は、下記のリンクをクリックしてください。

- ActivatedClientTypeEntryのページへのリンク