java.lang.Runnable@Private
@Unstable
public class ServiceShutdownHook
extends java.lang.Object
implements java.lang.Runnable
Service.stop() if the reference is valid.| Constructor | Description |
|---|---|
ServiceShutdownHook(Service service) |
Create an instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
register(int priority) |
Register the service for shutdown with Hadoop's
ShutdownHookManager. |
void |
run() |
Shutdown handler.
|
protected boolean |
shutdown() |
Shutdown operation.
|
void |
unregister() |
Unregister the hook.
|
public ServiceShutdownHook(Service service)
service - the servicepublic void register(int priority)
ShutdownHookManager.priority - shutdown hook prioritypublic void unregister()
public void run()
Service.stop() operation is invoked.run in interface java.lang.Runnableprotected boolean shutdown()
Subclasses may extend it, but it is primarily made available for testing.
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.