com.hazelcast.core
Interface LifecycleService

All Known Implementing Classes:
LifecycleServiceImpl, LifecycleServiceImpl, TerminatedLifecycleService

public interface LifecycleService

LifecycleService allows you to shutdown, terminate, and listen to LifecycleEvent's on HazelcastInstance.


Method Summary
 String addLifecycleListener(LifecycleListener lifecycleListener)
          Add a listener object to listen for lifecycle events.
 boolean isRunning()
          checks whether or not the instance is running
 boolean removeLifecycleListener(String registrationId)
          Removes a lifecycle listener
 void shutdown()
          gracefully shutdowns HazelcastInstance.
 void terminate()
          terminate HazelcastInstance ungracefully.
 

Method Detail

isRunning

boolean isRunning()
checks whether or not the instance is running

Returns:
true if instance is active and running, false otherwise

shutdown

void shutdown()
gracefully shutdowns HazelcastInstance. Different from terminate(), it waits for partition operations to be completed.


terminate

void terminate()
terminate HazelcastInstance ungracefully. Does not wait for partition operations, forces immediate shutdown.


addLifecycleListener

String addLifecycleListener(LifecycleListener lifecycleListener)
Add a listener object to listen for lifecycle events.

Parameters:
lifecycleListener - the listener object
Returns:
the listener id

removeLifecycleListener

boolean removeLifecycleListener(String registrationId)
Removes a lifecycle listener

Parameters:
registrationId - The listener id returned by addLifecycleListener(LifecycleListener)
Returns:
true if the listener is removed successfully, false otherwise


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.