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 한 다음 호출 하 여 개체를 활성화할 new 또는 Activator.CreateInstance합니다.

클라이언트 활성 개체 형식을 활성화 하는 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으로 반환합니다.

적용 대상

추가 정보