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


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

Imports System 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 '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() { 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(); } }
#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(); }
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) { ChannelServices.RegisterChannel(new TcpChannel(8082)); // Create an instance of 'ActivatedServiceTypeEntry' class // which holds the values for 'HelloServer' type. ActivatedServiceTypeEntry myActivatedServiceTypeEntry = new ActivatedServiceTypeEntry(HelloServer.class.ToType()); // 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: " + ((ActivatedServiceTypeEntry)myActivatedServiceEntries. get_Item(0)).get_ObjectType()); Console.WriteLine("Description: " + myActivatedServiceEntries.get_Item(0).ToString()); Console.WriteLine("Press enter to stop this process"); Console.ReadLine(); } //main } //MyClient

System.Runtime.Remoting.TypeEntry
System.Runtime.Remoting.ActivatedServiceTypeEntry


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ActivatedServiceTypeEntry クラスのページへのリンク