다음을 통해 공유


WellKnownServiceTypeEntry 클래스

정의

서비스 끝에 등록된 개체 형식에 대한 값을 서버 활성화 형식 개체(단일 호출 또는 싱글톤)로 보유합니다.

public ref class WellKnownServiceTypeEntry : System::Runtime::Remoting::TypeEntry
public class WellKnownServiceTypeEntry : System.Runtime.Remoting.TypeEntry
[System.Runtime.InteropServices.ComVisible(true)]
public class WellKnownServiceTypeEntry : System.Runtime.Remoting.TypeEntry
type WellKnownServiceTypeEntry = class
    inherit TypeEntry
[<System.Runtime.InteropServices.ComVisible(true)>]
type WellKnownServiceTypeEntry = class
    inherit TypeEntry
Public Class WellKnownServiceTypeEntry
Inherits TypeEntry
상속
WellKnownServiceTypeEntry
특성

예제

#using <System.Runtime.Remoting.dll>
#using <System.dll>
#using <WellKnownServiceTypeEntry_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 it with the 
   // channel services.
   ChannelServices::RegisterChannel( gcnew HttpChannel( 8086 ) );

   // Record the 'HelloServer' type as 'Singleton' well-known type.
   WellKnownServiceTypeEntry^ myWellKnownServiceTypeEntry = gcnew WellKnownServiceTypeEntry( HelloServer::typeid,"SayHello",WellKnownObjectMode::Singleton );

   // Register the remote object as well-known type.
   RemotingConfiguration::RegisterWellKnownServiceType( myWellKnownServiceTypeEntry );

   // Retrieve object types registered on the service end 
   // as well-known types.
   array<WellKnownServiceTypeEntry^>^myWellKnownServiceTypeEntryCollection = RemotingConfiguration::GetRegisteredWellKnownServiceTypes();
   Console::WriteLine( "The 'WellKnownObjectMode' of the remote object : {0}", myWellKnownServiceTypeEntryCollection[ 0 ]->Mode );
   Console::WriteLine( "The 'WellKnownServiceTypeEntry' object: {0}", myWellKnownServiceTypeEntryCollection[ 0 ] );
   Console::WriteLine( "Started the Server, Hit <enter> to exit..." );
   Console::ReadLine();
}
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class MyServer 
{
   public static void Main() 
   {
      // Create a 'HttpChannel' object and register it with the 
      // channel services.
      ChannelServices.RegisterChannel(new HttpChannel(8086));
      // Record the 'HelloServer' type as 'Singleton' well-known type.
      WellKnownServiceTypeEntry myWellKnownServiceTypeEntry= 
          new WellKnownServiceTypeEntry(typeof(HelloServer),
                                        "SayHello",
                                        WellKnownObjectMode.Singleton);
      // Register the remote object as well-known type.
      RemotingConfiguration.RegisterWellKnownServiceType(
                                          myWellKnownServiceTypeEntry);
      // Retrieve object types registered on the service end 
      // as well-known types.
      WellKnownServiceTypeEntry [] myWellKnownServiceTypeEntryCollection = 
            RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
      Console.WriteLine("The 'WellKnownObjectMode' of the remote object : "
                       +myWellKnownServiceTypeEntryCollection[0].Mode);
      Console.WriteLine("The 'WellKnownServiceTypeEntry' object: "+
                  myWellKnownServiceTypeEntryCollection[0].ToString());
      Console.WriteLine("Started the Server, Hit <enter> to exit...");
      Console.ReadLine();
   }
}
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Http

Public Class MyServer
   
   Public Shared Sub Main()
      ' Create a 'HttpChannel' object and register it with the 
      ' channel services.
      ChannelServices.RegisterChannel(New HttpChannel(8086))
      ' Record the 'HelloServer' type as 'Singleton' well-known type.
      Dim myWellKnownServiceTypeEntry As New WellKnownServiceTypeEntry(GetType(HelloServer), _ 
                                                 "SayHello", WellKnownObjectMode.Singleton)
      ' Register the remote object as well-known type.
      RemotingConfiguration.RegisterWellKnownServiceType(myWellKnownServiceTypeEntry)
      ' Retrieve object types registered on the service end 
      ' as well-known types.
      Dim myWellKnownServiceTypeEntryCollection As WellKnownServiceTypeEntry() = _ 
                                      RemotingConfiguration.GetRegisteredWellKnownServiceTypes()
      Console.WriteLine("The 'WellKnownObjectMode' of the remote object : " + _
                                        myWellKnownServiceTypeEntryCollection(0).Mode.ToString())
      Console.WriteLine("The 'WellKnownServiceTypeEntry' object: " + _ 
                                             myWellKnownServiceTypeEntryCollection(0).ToString())
      Console.WriteLine("Started the Server, Hit <enter> to exit...")
      Console.ReadLine()
   End Sub
End Class

설명

서버 활성화 개체 유형은 단일 호출 또는 싱글톤일 수 있습니다. 개체 유형이 단일 호출인 경우 클라이언트의 호출이 들어올 때마다 개체의 새 인스턴스가 만들어집니다. 단일 개체에 대한 모든 호출은 해당 개체의 한 인스턴스에서 처리됩니다.

이 개체의 URI를 알고 있는 클라이언트는 원하는 ChannelServices 채널을 등록하고 개체를 호출 new 하거나 Activator.GetObject활성화하여 이 개체에 대한 프록시를 가져올 수 있습니다.

원격 개체 자체는 등록 프로세스에 의해 만들어지지 않습니다. 이는 클라이언트가 개체에서 메서드를 호출하려고 하거나 클라이언트 쪽에서 개체를 활성화하는 경우에만 발생합니다.

생성자

Name Description
WellKnownServiceTypeEntry(String, String, String, WellKnownObjectMode)

지정된 형식 이름, 어셈블리 이름, 개체 URI 및 WellKnownObjectMode을 사용하여 클래스의 WellKnownServiceTypeEntry 새 인스턴스를 초기화합니다.

WellKnownServiceTypeEntry(Type, String, WellKnownObjectMode)

지정된 Type, 개체 URI 및 WellKnownObjectMode를 사용하여 클래스의 WellKnownServiceTypeEntry 새 인스턴스를 초기화합니다.

속성

Name Description
AssemblyName

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

(다음에서 상속됨 TypeEntry)
ContextAttributes

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

Mode

서버 활성화 WellKnownObjectMode 서비스 유형의 형식을 가져옵니다.

ObjectType

서버 활성화 Type 서비스 유형의 형식을 가져옵니다.

ObjectUri

잘 알려진 서비스 유형의 URI를 가져옵니다.

TypeName

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

(다음에서 상속됨 TypeEntry)

메서드

Name Description
Equals(Object)

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

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

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

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

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

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

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

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

형식 이름, 어셈블리 이름, 개체 URI 및 WellKnownObjectMode 서버 활성화 형식을 .로 String반환합니다.

적용 대상

추가 정보