com.hazelcast.core
Interface LifecycleService

All Known Implementing Classes:
LifecycleServiceImpl

public interface LifecycleService

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


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

Method Detail

isRunning

boolean isRunning()
whether the instance is running

Returns:
true if instance is active and running

shutdown

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


terminate

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


addLifecycleListener

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

Parameters:
lifecycleListener - Listener object
Returns:
listener id

removeLifecycleListener

boolean removeLifecycleListener(String registrationId)
Remove lifecycle listener

Parameters:
registrationId - The listener id returned by addLifecycleListener(LifecycleListener)
Returns:
true if removed successfully


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