Ejemplo n.º 1
0
/**
 * Receives control requests for the service.
 */
void WINAPI ServiceHandler(DWORD control)
{
	switch (control)
	{
		/* Shutdown the service. */
		case SERVICE_CONTROL_STOP:
		case SERVICE_CONTROL_SHUTDOWN:
			logMessage("NORMAL: Handling a stop/shutdown control request, shutting down...\n");

			/* Set the status to stop pending and shutdown JVM. */
			serviceStatus.dwCurrentState = SERVICE_STOP_PENDING;
			serviceStatus.dwControlsAccepted = 0;
			serviceStatus.dwWaitHint = 60000;
			SetServiceStatus(serviceHandle, &serviceStatus);

			/* Notify the JVM to shutdown. */
			shutDownJVM();
			break;
		default:
			break;
	}

	return;
}
Ejemplo n.º 2
0
void shutDownSchedulingServer()
{
	logMessage("Shutting down JVM...\n");
	shutDownJVM();
}