com.hazelcast.concurrent.semaphore
Class SemaphoreService

java.lang.Object
  extended by com.hazelcast.concurrent.semaphore.SemaphoreService
All Implemented Interfaces:
ClientAwareService, ManagedService, MembershipAwareService, MigrationAwareService, RemoteService

public class SemaphoreService
extends Object
implements ManagedService, MigrationAwareService, MembershipAwareService, RemoteService, ClientAwareService


Field Summary
static String SERVICE_NAME
           
 
Constructor Summary
SemaphoreService(NodeEngine nodeEngine)
           
 
Method Summary
 void beforeMigration(PartitionMigrationEvent partitionMigrationEvent)
           
 void clearPartitionReplica(int partitionId)
           
 void clientDisconnected(String clientUuid)
          Invoked when a client disconnected from a member.
 void commitMigration(PartitionMigrationEvent event)
           
 boolean containsSemaphore(String name)
           
 SemaphoreProxy createDistributedObject(String objectId)
           
 void destroyDistributedObject(String objectId)
           
 Permit getOrCreatePermit(String name)
           
 void init(NodeEngine nodeEngine, Properties properties)
          Initializes this ManagedService
 void insertMigrationData(Map<String,Permit> migrationData)
           
 void memberAdded(MembershipServiceEvent event)
          Invoked when a new member is added to the cluster.
 void memberAttributeChanged(MemberAttributeServiceEvent event)
          Invoked when a member attribute is changed.
 void memberRemoved(MembershipServiceEvent event)
          Invoked when an existing member leaves the cluster.
 Operation prepareReplicationOperation(PartitionReplicationEvent event)
           
 void reset()
          reset this ManagedService back to initial state.
 void rollbackMigration(PartitionMigrationEvent event)
           
 void shutdown(boolean terminate)
          Shuts down this ManagedService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

SemaphoreService

public SemaphoreService(NodeEngine nodeEngine)
Method Detail

getOrCreatePermit

public Permit getOrCreatePermit(String name)

containsSemaphore

public boolean containsSemaphore(String name)

init

public void init(NodeEngine nodeEngine,
                 Properties properties)
Description copied from interface: ManagedService
Initializes this ManagedService

Specified by:
init in interface ManagedService
Parameters:
nodeEngine - the NodeEngine this ManagedService belongs to.
properties - the Properties. Can be used to pass settings to the service.

reset

public void reset()
Description copied from interface: ManagedService
reset this ManagedService back to initial state. todo: what is the purpose of reset

Specified by:
reset in interface ManagedService

shutdown

public void shutdown(boolean terminate)
Description copied from interface: ManagedService
Shuts down this ManagedService. todo: what is the purpose of the terminate variable.

Specified by:
shutdown in interface ManagedService

memberAdded

public void memberAdded(MembershipServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when a new member is added to the cluster.

Specified by:
memberAdded in interface MembershipAwareService

memberRemoved

public void memberRemoved(MembershipServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when an existing member leaves the cluster.

Specified by:
memberRemoved in interface MembershipAwareService

memberAttributeChanged

public void memberAttributeChanged(MemberAttributeServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when a member attribute is changed.

Specified by:
memberAttributeChanged in interface MembershipAwareService

createDistributedObject

public SemaphoreProxy createDistributedObject(String objectId)
Specified by:
createDistributedObject in interface RemoteService

destroyDistributedObject

public void destroyDistributedObject(String objectId)
Specified by:
destroyDistributedObject in interface RemoteService

beforeMigration

public void beforeMigration(PartitionMigrationEvent partitionMigrationEvent)
Specified by:
beforeMigration in interface MigrationAwareService

prepareReplicationOperation

public Operation prepareReplicationOperation(PartitionReplicationEvent event)
Specified by:
prepareReplicationOperation in interface MigrationAwareService

insertMigrationData

public void insertMigrationData(Map<String,Permit> migrationData)

commitMigration

public void commitMigration(PartitionMigrationEvent event)
Specified by:
commitMigration in interface MigrationAwareService

rollbackMigration

public void rollbackMigration(PartitionMigrationEvent event)
Specified by:
rollbackMigration in interface MigrationAwareService

clearPartitionReplica

public void clearPartitionReplica(int partitionId)
Specified by:
clearPartitionReplica in interface MigrationAwareService

clientDisconnected

public void clientDisconnected(String clientUuid)
Description copied from interface: ClientAwareService
Invoked when a client disconnected from a member.

Specified by:
clientDisconnected in interface ClientAwareService


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