Exportar (0) Imprimir
Expandir Tudo

Classe RoleInstance

[Este tópico é uma documentação de pré-lançamento e está sujeito a alterações em versões futuras. Os tópicos em branco são incluídos como espaços reservados.]

Represents an instance of a role.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (em microsoft.windowsazure.serviceruntime.dll)

'Uso
Dim instance As RoleInstance

public abstract class RoleInstance
public abstract class RoleInstance
public abstract class RoleInstance

A hosted service in Windows Azure can be defined to contain web roles, worker roles, and VM roles. A role is a component of an application that performs specific functionality. A role instance is a running copy of the role in Windows Azure or the Windows Azure Compute Emulator. Roles are defined in the service model for the hosted service. For more information, see Setting Up a Hosted Service for Windows Azure.

The following code example shows how to retrieve information about role instances:


foreach (var role in RoleEnvironment.Roles) 
{
   foreach (var roleInstance in role.Value.Instances)      
   {
      Trace.WriteLine("Role Instance ID: " + roleInstance.Id, "Information");
      foreach (RoleInstanceEndpoint instanceEndpoint in roleInstance.InstanceEndpoints.Values) 
      {
         Trace.WriteLine("Instance endpoint IP address and port: " + instanceEndpoint.IPEndpoint, "Information"); 
      }
      Trace.WriteLine("Role instance fault domain: " + roleInstance.FaultDomain, "Information");
      Trace.WriteLine("Role for the instance: " + roleInstance.Role.Name, "Information");
      Trace.WriteLine("Role instance update domain: " + roleInstance.UpdateDomain, "Information");
   }
}

System.Object
  Microsoft.WindowsAzure.ServiceRuntime.RoleInstance

Todos os membros estáticos públicos (Compartilhados no Visual Basic) desse tipo são thread-safe. Quaisquer membros de instância não têm garantia de ser thread-safe.

Plataformas de desenvolvimento

Windows XP Professional com Service Pack 2 (SP2)

Plataformas de destino

Contribuições da comunidade

Mostrar:
© 2015 Microsoft