com.hazelcast.instance
Class LifecycleServiceImpl

java.lang.Object
  extended by com.hazelcast.instance.LifecycleServiceImpl
All Implemented Interfaces:
LifecycleService

public class LifecycleServiceImpl
extends Object
implements LifecycleService


Field Summary
static int DEFAULT_GRACEFUL_SHUTDOWN_WAIT
           
 
Constructor Summary
LifecycleServiceImpl(HazelcastInstanceImpl instance)
           
 
Method Summary
 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 shutdowns HazelcastInstance.
 void terminate()
          terminate HazelcastInstance ungracefully.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GRACEFUL_SHUTDOWN_WAIT

public static final int DEFAULT_GRACEFUL_SHUTDOWN_WAIT
See Also:
Constant Field Values
Constructor Detail

LifecycleServiceImpl

public LifecycleServiceImpl(HazelcastInstanceImpl instance)
Method Detail

addLifecycleListener

public String addLifecycleListener(LifecycleListener lifecycleListener)
Description copied from interface: LifecycleService
Add a listener object to listen for lifecycle events.

Specified by:
addLifecycleListener in interface LifecycleService
Parameters:
lifecycleListener - the listener object
Returns:
the listener id

removeLifecycleListener

public boolean removeLifecycleListener(String registrationId)
Description copied from interface: LifecycleService
Removes a lifecycle listener

Specified by:
removeLifecycleListener in interface LifecycleService
Parameters:
registrationId - The listener id returned by LifecycleService.addLifecycleListener(LifecycleListener)
Returns:
true if the listener is removed successfully, false otherwise

fireLifecycleEvent

public void fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState)

fireLifecycleEvent

public void fireLifecycleEvent(LifecycleEvent lifecycleEvent)

isRunning

public boolean isRunning()
Description copied from interface: LifecycleService
checks whether or not the instance is running

Specified by:
isRunning in interface LifecycleService
Returns:
true if instance is active and running, false otherwise

shutdown

public void shutdown()
Description copied from interface: LifecycleService
gracefully shutdowns HazelcastInstance. Different from LifecycleService.terminate(), it waits for partition operations to be completed.

Specified by:
shutdown in interface LifecycleService

terminate

public void terminate()
Description copied from interface: LifecycleService
terminate HazelcastInstance ungracefully. Does not wait for partition operations, forces immediate shutdown.

Specified by:
terminate in interface LifecycleService

runUnderLifecycleLock

public void runUnderLifecycleLock(Runnable runnable)


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