导出 (0) 打印
全部展开

RoleEnvironment.RequestRecycle 方法

Requests that the current role instance be stopped and restarted.

命名空间: Microsoft.WindowsAzure.ServiceRuntime
程序集: Microsoft.WindowsAzure.ServiceRuntime(在 microsoft.windowsazure.serviceruntime.dll 中)

用法

RoleEnvironment.RequestRecycle

声明
Public Shared Sub RequestRecycle
public static void RequestRecycle ()
public static function RequestRecycle ()

异常类型条件
RoleEnvironmentException

The role instance could not be stopped and restarted.

When the RequestRecycle method is called, the load balancer takes the role instance out of the rotation and the normal shutdown cycle is initiated. New requests are not routed to the role instance while it is restarting.

Windows Azure raises the Stopping event and calls the OnStop method where you can run the necessary code to prepare the role instance to be recycled.


此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不保证所有实例成员都是线程安全的。

开发平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003、Windows Server 2008 和 Windows 2000

目标平台

社区附加资源

显示:
© 2014 Microsoft