WellKnownServiceTypeEntry 클래스

정의

서버 활성 형식 개체(SingleCall 또는 Singleton 개체)로 서비스 쪽에 등록된 개체 형식에 대한 값이 들어 있습니다.

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

설명

Singlecall 또는 singleton 서버 활성 개체 형식일 수 있습니다. 개체 유형을 singlecall 이면의 새 인스턴스는 클라이언트에서 호출 될 때마다 만들어집니다. 단일 개체에 대 한 모든 호출 개체의 한 인스턴스에 의해 처리 됩니다.

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

원격 개체 자체 등록 프로세스에 의해 생성 되지 않도록 하는 것이 반드시 합니다. 이 클라이언트 개체에서 메서드를 호출 하려고 할 때 발생 하거나 클라이언트 쪽에서 개체를 활성화 합니다.

서버 활성화 개체 및 원격 개체 활성화에 대한 자세한 설명은 원격 개체 활성화를 참조하세요.

생성자

WellKnownServiceTypeEntry(String, String, String, WellKnownObjectMode)

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

WellKnownServiceTypeEntry(Type, String, WellKnownObjectMode)

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

속성

AssemblyName

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

(다음에서 상속됨 TypeEntry)
ContextAttributes

서버 활성 서비스 형식의 컨텍스트 특성을 가져오거나 설정합니다.

Mode

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

ObjectType

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

ObjectUri

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

TypeName

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

(다음에서 상속됨 TypeEntry)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

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

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

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

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

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

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

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

서버 활성 형식의 형식 이름, 어셈블리 이름, 개체 URI 및 WellKnownObjectModeString으로 반환합니다.

적용 대상

추가 정보