Aracılığıyla paylaş


ActivatedServiceTypeEntry Sınıf

Tanım

İstemciden gelen istek üzerine etkinleştirilebilen hizmet ucunda kayıtlı bir nesne türünün değerlerini tutar.

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
Devralma
ActivatedServiceTypeEntry
Öznitelikler

Örnekler

#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

Açıklamalar

Geçerli sınıf, yöntemin RemotingConfiguration.RegisterActivatedServiceType sunucu tarafı karşılığı RemotingConfiguration.RegisterActivatedClientType olan yöntemi tarafından kullanılır. yöntemi RegisterActivatedServiceType , belirtilen nesne türlerinin istemcileri tarafından uzaktan etkinleştirmeye izin vermek için sunucuda kullanılır.

Sunucuda istemci tarafından etkinleştirilmiş bir nesne oluşturmak için, nesnesini Typebilmeniz ve yöntemini kullanarak RegisterActivatedServiceType sunucu ucunda kaydedilmesi gerekir. İstemci tarafından etkinleştirilen yeni bir nesnenin proxy'sini almak için, istemcinin önce ile ChannelServices bir kanal kaydetmesi ve ardından veya Activator.CreateInstanceçağırarak new nesnesini etkinleştirmesi gerekir.

İstemci tarafından etkinleştirilen nesne türünü anahtar sözcüğüyle new etkinleştirmek için, önce yöntemini kullanarak RegisterActivatedClientType istemciye nesne türünü kaydetmeniz gerekir. Çağrısı RegisterActivatedClientType yaparak uzaktan iletişim altyapısına uzaktan erişim altyapısını oluşturma girişiminde bulunduğu new uzak uygulamanın konumunu vermiş olursunuz. Öte yandan, istemci tarafından etkinleştirilen nesnenin yeni bir örneğini oluşturmak için yöntemini kullanırsanız CreateInstance , uzak uygulamanın URL'sini parametre olarak sağlamanız gerekir, bu nedenle istemcide önceden kayıt yapılması gerekmez. CreateInstance yöntemini, nesnesini oluşturmak istediğiniz sunucunun URL'sini sağlamak için URL'yi sınıfın UrlAttribute bir örneğinde kapsüllemeniz gerekir.

İstemci tarafından etkinleştirilen nesnelerin ve uzak nesne etkinleştirmenin ayrıntılı açıklaması için bkz. Uzak Nesnelerin Etkinleştirilmesi.

Oluşturucular

ActivatedServiceTypeEntry(String, String)

Verilen tür adı ve derleme adıyla sınıfının yeni bir örneğini ActivatedServiceTypeEntry başlatır.

ActivatedServiceTypeEntry(Type)

verilen Typeile sınıfının yeni bir örneğini ActivatedServiceTypeEntry başlatır.

Özellikler

AssemblyName

Uzaktan etkinleştirilmiş bir tür olarak yapılandırılan nesne türünün derleme adını alır.

(Devralındığı yer: TypeEntry)
ContextAttributes

İstemci tarafından etkinleştirilen hizmet türü için bağlam özniteliklerini alır veya ayarlar.

ObjectType

Type İstemci tarafından etkinleştirilen hizmet türünün türünü alır.

TypeName

Uzaktan etkinleştirilen bir tür olarak yapılandırılan nesne türünün tam tür adını alır.

(Devralındığı yer: TypeEntry)

Yöntemler

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

İstemci tarafından etkinleştirilen hizmet türünün türünü ve derleme adını olarak Stringdöndürür.

Şunlara uygulanır

Ayrıca bkz.