com.hazelcast.client.impl
Class LifecycleServiceImpl

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

public final class LifecycleServiceImpl
extends Object
implements LifecycleService

Default LifecycleService implementation for the client.


Constructor Summary
LifecycleServiceImpl(HazelcastClientInstanceImpl client)
           
 
Method Summary
 String addLifecycleListener(LifecycleListener lifecycleListener)
          Add a listener object to listen for lifecycle events.
 void fireLifecycleEvent(LifecycleEvent.LifecycleState lifecycleState)
           
 boolean isRunning()
          checks whether or not the instance is running
 boolean removeLifecycleListener(String registrationId)
          Removes a lifecycle listener
 void setStarted()
           
 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
 

Constructor Detail

LifecycleServiceImpl

public LifecycleServiceImpl(HazelcastClientInstanceImpl client)
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)

setStarted

public void setStarted()

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


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