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을 제공하려면 클래스 인스턴스 UrlAttribute 의 URL을 캡슐화해야 합니다.

생성자

Name Description
ActivatedServiceTypeEntry(String, String)

지정된 형식 이름과 어셈블리 이름을 사용하여 클래스의 ActivatedServiceTypeEntry 새 인스턴스를 초기화합니다.

ActivatedServiceTypeEntry(Type)

지정된 Type클래스를 사용하여 클래스의 새 인스턴스를 ActivatedServiceTypeEntry 초기화합니다.

속성

Name Description
AssemblyName

원격 활성화 형식으로 구성된 개체 형식의 어셈블리 이름을 가져옵니다.

(다음에서 상속됨 TypeEntry)
ContextAttributes

클라이언트 활성화 서비스 유형에 대한 컨텍스트 특성을 가져오거나 설정합니다.

ObjectType

클라이언트 활성화 Type 서비스 유형의 형식을 가져옵니다.

TypeName

원격 활성화 형식으로 구성된 개체 형식의 전체 형식 이름을 가져옵니다.

(다음에서 상속됨 TypeEntry)

메서드

Name Description
Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

클라이언트 활성화 서비스 형식의 형식 및 어셈블리 이름을 .로 String반환합니다.

적용 대상

추가 정보