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

ActivatedClientTypeEntry クラス

サーバーアクティブにできる型としてクライアント エンド登録されオブジェクト型の値を保持します

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

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

クライアント側アクティブ化されるオブジェクトインスタンスクライアント作成するには、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.Object
   System.Runtime.Remoting.TypeEntry
    System.Runtime.Remoting.ActivatedClientTypeEntry
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ActivatedClientTypeEntry メンバ
System.Runtime.Remoting 名前空間
RegisterActivatedClientType
その他の技術情報
クライアント アクティベーション

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

指定した型名アセンブリ名、およびアプリケーションURL使用して、ActivatedClientTypeEntry クラス新しインスタンス初期化します。

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

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

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

パラメータ

typeName

クライアント側アクティブ化される型の型名

assemblyName

クライアント側アクティブ化される型のアセンブリ名

appUrl

型をアクティブにするアプリケーションURL

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

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

指定した TypeアプリケーションURL使用して、ActivatedClientTypeEntry クラス新しインスタンス初期化します。

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

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

Dim instance As New ActivatedClientTypeEntry(type,
 appUrl)
public ActivatedClientTypeEntry (
    Type type,
    string appUrl
)
public:
ActivatedClientTypeEntry (
    Type^ type, 
    String^ appUrl
)
public ActivatedClientTypeEntry (
    Type type, 
    String appUrl
)
public function ActivatedClientTypeEntry (
    type : Type, 
    appUrl : String
)

パラメータ

type

クライアント側アクティブ化される型の Type

appUrl

型をアクティブにするアプリケーションURL

解説解説
使用例使用例

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");
// Create activated client type entry.
ActivatedClientTypeEntry^ activatedClientTypeEntry = gcnew ActivatedClientTypeEntry(
 HelloServer::typeid, "tcp://localhost:8082" );

// Create activated client type entry.
ActivatedClientTypeEntry myActivatedClientTypeEntry = 
    new ActivatedClientTypeEntry(HelloServer.class.ToType(),
 
    "tcp://localhost:8082");
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ActivatedClientTypeEntry クラス
ActivatedClientTypeEntry メンバ
System.Runtime.Remoting 名前空間

ActivatedClientTypeEntry コンストラクタ

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

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

関連項目

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

ActivatedClientTypeEntry プロパティ


ActivatedClientTypeEntry メソッド


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

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

関連項目

ActivatedClientTypeEntry クラス
System.Runtime.Remoting 名前空間
RegisterActivatedClientType

その他の技術情報

クライアント アクティベーション

ActivatedClientTypeEntry メンバ

サーバーアクティブにできる型としてクライアント エンド登録されオブジェクト型の値を保持します

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


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

関連項目

ActivatedClientTypeEntry クラス
System.Runtime.Remoting 名前空間
RegisterActivatedClientType

その他の技術情報

クライアント アクティベーション


このページでは「.NET Framework クラス ライブラリ リファレンス」からActivatedClientTypeEntryを検索した結果を表示しています。
Weblioに収録されているすべての辞書からActivatedClientTypeEntryを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からActivatedClientTypeEntry を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ActivatedClientTypeEntry」の関連用語

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

   

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



ActivatedClientTypeEntryのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS