WellKnownClientTypeEntryとは? わかりやすく解説

WellKnownClientTypeEntry クラス

サーバー側でアクティブ化される型 (単一の呼び出しまたはシングルトン) としてクライアントに登録されたオブジェクト型の値を保持します。

名前空間: System.Runtime.Remoting
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Class WellKnownClientTypeEntry
    Inherits TypeEntry
Dim instance As WellKnownClientTypeEntry
[ComVisibleAttribute(true)] 
public class WellKnownClientTypeEntry : TypeEntry
[ComVisibleAttribute(true)] 
public ref class WellKnownClientTypeEntry :
 public TypeEntry
/** @attribute ComVisibleAttribute(true) */ 
public class WellKnownClientTypeEntry extends
 TypeEntry
ComVisibleAttribute(true) 
public class WellKnownClientTypeEntry extends
 TypeEntry
解説解説

サーバー側でアクティブ化される型には、単一の呼び出しまたはシングルトンがあります。クラスが単一呼び出し型として登録されている場合は、クライアントからの呼び出しが到達するたびに、新しいインスタンスが作成されます。シングルトン オブジェクトのすべての呼び出しは、オブジェクトが収集されていない限り、そのオブジェクトの 1 つのインスタンスによって処理されます。

登録されたサーバー側でアクティブ化されるオブジェクトの URI を知っているすべてのクライアントは、ChannelServices で優先するチャネルを登録し、new または Activator.GetObject を呼び出してそのオブジェクトをアクティブにすることにより、このオブジェクトに対するプロキシを取得できます。new でサーバー側でアクティブ化されるオブジェクトをアクティブにするには、初めに RegisterWellKnownClientType メソッドを使用して、そのサーバー側でアクティブ化されるオブジェクトの型をクライアント側で登録しておく必要があります。RegisterWellKnownClientType を呼び出すと、new キーワードに作成を許可するリモート オブジェクトの場所がリモート処理インフラストラクチャに通知されます。一方、Activator.GetObject メソッドを使用して、サーバー側でアクティブ化されるオブジェクトをアクティブにする場合は、そのオブジェクトの URL を引数として指定する必要があります。このため、クライアント側での事前の登録は必要ありません。

サーバー側でアクティブ化されるオブジェクトとリモート オブジェクト アクティベーションの詳細については、「リモート オブジェクトのアクティべーション」を参照してください。

使用例使用例
Imports System
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Http

Public Class MyClient
   
   Public Shared Sub Main()
      ' Create a 'HttpChannel' object and  register with channel services.
      ChannelServices.RegisterChannel(New HttpChannel())
      Console.WriteLine(" Start calling from Client One.......")
      Dim myWellKnownClientTypeEntry As New
 WellKnownClientTypeEntry(GetType(HelloServer), _ 
                                                  "http://localhost:8086/SayHello")
      myWellKnownClientTypeEntry.ApplicationUrl = "http://localhost:8086/SayHello"
      RemotingConfiguration.RegisterWellKnownClientType(myWellKnownClientTypeEntry)
      ' Get the proxy object for the remote object.
      Dim myHelloServerObject As New
 HelloServer()
      ' Retrieve an array of object types registered on the 
      ' client end as well-known types.
      Dim myWellKnownClientTypeEntryCollection As
 WellKnownClientTypeEntry() = _ 
                                       RemotingConfiguration.GetRegisteredWellKnownClientTypes()
      Console.WriteLine("The Application Url to activate the Remote
 Object :" + _ 
                                           myWellKnownClientTypeEntryCollection(0).ApplicationUrl)
      Console.WriteLine("The 'WellKnownClientTypeEntry' object
 :" + _ 
                                              myWellKnownClientTypeEntryCollection(0).ToString())
      ' Make remote method calls.
      Dim i As Integer
      For i = 0 To 4
         Console.WriteLine(myHelloServerObject.HelloMethod(" Client
 One"))
      Next i
   End Sub 'Main
End Class 'MyClient 
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class MyClient 
{
   public static void Main()
   {
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices.RegisterChannel(new HttpChannel());
   Console.WriteLine(" Start calling from Client One.......");
   WellKnownClientTypeEntry myWellKnownClientTypeEntry = 
                  new WellKnownClientTypeEntry(typeof(HelloServer)
,
                                  "http://localhost:8086/SayHello");
   myWellKnownClientTypeEntry.ApplicationUrl="http://localhost:8086/SayHello";
   RemotingConfiguration.RegisterWellKnownClientType(myWellKnownClientTypeEntry);
   // Get the proxy object for the remote object.
   HelloServer myHelloServerObject = new HelloServer();
   // Retrieve an array of object types registered on the 
   // client end as well-known types.
   WellKnownClientTypeEntry [] myWellKnownClientTypeEntryCollection = 
          RemotingConfiguration.GetRegisteredWellKnownClientTypes();
   Console.WriteLine("The Application Url to activate the Remote Object :"
        +myWellKnownClientTypeEntryCollection[0].ApplicationUrl);
   Console.WriteLine("The 'WellKnownClientTypeEntry' object :"
            +myWellKnownClientTypeEntryCollection[0].ToString());
   // Make remote method calls.
   for (int i = 0; i < 5; i++)
         Console.WriteLine(myHelloServerObject.HelloMethod(" Client One"));
   }
}
#using <System.Runtime.Remoting.dll>
#using <System.dll>
#using <WellKnownClientTypeEntry_Share.dll>

using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Http;

int main()
{
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices::RegisterChannel( gcnew HttpChannel );
   Console::WriteLine( " Start calling from Client One......." );
   WellKnownClientTypeEntry^ myWellKnownClientTypeEntry = gcnew WellKnownClientTypeEntry(
 HelloServer::typeid,"http://localhost:8086/SayHello" );
   myWellKnownClientTypeEntry->ApplicationUrl = "http://localhost:8086/SayHello";
   RemotingConfiguration::RegisterWellKnownClientType( myWellKnownClientTypeEntry
 );

   // Get the proxy object for the remote object.
   HelloServer^ myHelloServerObject = gcnew HelloServer;

   // Retrieve an array of object types registered on the 
   // client end as well-known types.
   array<WellKnownClientTypeEntry^>^myWellKnownClientTypeEntryCollection =
 RemotingConfiguration::GetRegisteredWellKnownClientTypes();
   Console::WriteLine( "The Application Url to activate the Remote Object :{0}",
 myWellKnownClientTypeEntryCollection[ 0 ]->ApplicationUrl );
   Console::WriteLine( "The 'WellKnownClientTypeEntry' object :{0}", myWellKnownClientTypeEntryCollection[
 0 ] );

   // Make remote method calls.
   for ( int i = 0; i < 5; i++ )
      Console::WriteLine( myHelloServerObject->HelloMethod( " Client One"
 ) );
}
import System.*;
import System.Runtime.Remoting.*;
import System.Runtime.Remoting.Channels.*;
import System.Runtime.Remoting.Channels.Http.*;

public class MyClient
{
    public static void main(String[]
 args)
    {
        // Create a 'HttpChannel' object and  register with channel
 services.
        ChannelServices.RegisterChannel(new HttpChannel());
        Console.WriteLine(" Start calling from Client One.......");
        WellKnownClientTypeEntry myWellKnownClientTypeEntry = 
            new WellKnownClientTypeEntry(HelloServer.class.ToType()
,
            "http://localhost:8086/SayHello");
        myWellKnownClientTypeEntry.
            set_ApplicationUrl("http://localhost:8086/SayHello");
        RemotingConfiguration.RegisterWellKnownClientType(
            myWellKnownClientTypeEntry);
        // Get the proxy object for the remote object.
        HelloServer myHelloServerObject = new HelloServer();
        // Retrieve an array of object types registered on the 
        // client end as well-known types.
        WellKnownClientTypeEntry myWellKnownClientTypeEntryCollection[] =
            RemotingConfiguration.GetRegisteredWellKnownClientTypes();
        Console.WriteLine("The Application Url to activate the Remote Object
 :" 
            + myWellKnownClientTypeEntryCollection[0].get_ApplicationUrl());
        Console.WriteLine("The 'WellKnownClientTypeEntry' object :" 
            + myWellKnownClientTypeEntryCollection.get_Item(0).ToString());
        // Make remote method calls.
        for (int i = 0; i < 5; i++) {
            Console.WriteLine(myHelloServerObject.HelloMethod(" Client One"));
        }
    } //main
} //MyClient
継承階層継承階層
System.Object
   System.Runtime.Remoting.TypeEntry
    System.Runtime.Remoting.WellKnownClientTypeEntry
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WellKnownClientTypeEntry メンバ
System.Runtime.Remoting 名前空間
RegisterWellKnownClientType
その他の技術情報
サーバー アクティベーション

WellKnownClientTypeEntry コンストラクタ (String, String, String)

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

名前空間: System.Runtime.Remoting
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    typeName As String, _
    assemblyName As String, _
    objectUrl As String _
)
Dim typeName As String
Dim assemblyName As String
Dim objectUrl As String

Dim instance As New WellKnownClientTypeEntry(typeName,
 assemblyName, objectUrl)
public WellKnownClientTypeEntry (
    string typeName,
    string assemblyName,
    string objectUrl
)
public:
WellKnownClientTypeEntry (
    String^ typeName, 
    String^ assemblyName, 
    String^ objectUrl
)
public WellKnownClientTypeEntry (
    String typeName, 
    String assemblyName, 
    String objectUrl
)
public function WellKnownClientTypeEntry (
    typeName : String, 
    assemblyName : String, 
    objectUrl : String
)

パラメータ

typeName

サーバー側でアクティブ化される型の型名。

assemblyName

サーバー側でアクティブ化される型のアセンブリ名。

objectUrl

サーバー側でアクティブ化される型の URL。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WellKnownClientTypeEntry クラス
WellKnownClientTypeEntry メンバ
System.Runtime.Remoting 名前空間

WellKnownClientTypeEntry コンストラクタ (Type, String)

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

名前空間: System.Runtime.Remoting
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    type As Type, _
    objectUrl As String _
)
Dim type As Type
Dim objectUrl As String

Dim instance As New WellKnownClientTypeEntry(type,
 objectUrl)
public WellKnownClientTypeEntry (
    Type type,
    string objectUrl
)
public:
WellKnownClientTypeEntry (
    Type^ type, 
    String^ objectUrl
)
public WellKnownClientTypeEntry (
    Type type, 
    String objectUrl
)
public function WellKnownClientTypeEntry (
    type : Type, 
    objectUrl : String
)

パラメータ

type

サーバー側でアクティブ化される型の Type。

objectUrl

サーバー側でアクティブ化される型の URL。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WellKnownClientTypeEntry クラス
WellKnownClientTypeEntry メンバ
System.Runtime.Remoting 名前空間

WellKnownClientTypeEntry コンストラクタ

WellKnownClientTypeEntry クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
WellKnownClientTypeEntry (Type, String) 指定した型と URL を使用して、WellKnownClientTypeEntry クラスの新しいインスタンスを初期化します。
WellKnownClientTypeEntry (String, String, String) 指定した型、アセンブリ名、および URL を使用して、WellKnownClientTypeEntry クラスの新しいインスタンスを初期化します。
参照参照

関連項目

WellKnownClientTypeEntry クラス
WellKnownClientTypeEntry メンバ
System.Runtime.Remoting 名前空間

WellKnownClientTypeEntry プロパティ


WellKnownClientTypeEntry メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WellKnownClientTypeEntry クラス
System.Runtime.Remoting 名前空間
RegisterWellKnownClientType

その他の技術情報

サーバー アクティベーション

WellKnownClientTypeEntry メンバ

サーバー側でアクティブ化される型 (単一の呼び出しまたはシングルトン) としてクライアントに登録されたオブジェクト型の値を保持します。

WellKnownClientTypeEntry データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WellKnownClientTypeEntry オーバーロードされます。 WellKnownClientTypeEntry クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WellKnownClientTypeEntry クラス
System.Runtime.Remoting 名前空間
RegisterWellKnownClientType

その他の技術情報

サーバー アクティベーション



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「WellKnownClientTypeEntry」の関連用語

WellKnownClientTypeEntryのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WellKnownClientTypeEntryのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS