@PrivateApi public class LifecycleServiceImpl extends Object implements LifecycleService
Constructor and Description |
---|
LifecycleServiceImpl(HazelcastInstanceImpl instance) |
Modifier and Type | Method and Description |
---|---|
String |
addLifecycleListener(LifecycleListener lifecycleListener)
Add a listener object to listen for lifecycle events.
|
void |
fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState) |
void |
fireLifecycleEvent(LifecycleEvent lifecycleEvent) |
boolean |
isRunning()
Checks whether or not the instance is running.
|
boolean |
removeLifecycleListener(String registrationId)
Removes a lifecycle listener.
|
void |
runUnderLifecycleLock(Runnable runnable) |
void |
shutdown()
Gracefully shuts down HazelcastInstance.
|
void |
terminate()
Terminate HazelcastInstance ungracefully.
|
public LifecycleServiceImpl(HazelcastInstanceImpl instance)
public String addLifecycleListener(LifecycleListener lifecycleListener)
LifecycleService
addLifecycleListener
in interface LifecycleService
lifecycleListener
- the listener objectpublic boolean removeLifecycleListener(String registrationId)
LifecycleService
removeLifecycleListener
in interface LifecycleService
registrationId
- the listener ID returned by LifecycleService.addLifecycleListener(LifecycleListener)
public void fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState)
public void fireLifecycleEvent(LifecycleEvent lifecycleEvent)
public boolean isRunning()
LifecycleService
isRunning
in interface LifecycleService
true
, if instance is active and running, false
otherwisepublic void shutdown()
LifecycleService
LifecycleService.terminate()
in that it waits for partition operations to complete.shutdown
in interface LifecycleService
public void terminate()
LifecycleService
LifecycleService.shutdown()
for graceful shutdown.terminate
in interface LifecycleService
public void runUnderLifecycleLock(Runnable runnable)
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.