com.hazelcast.concurrent.semaphore
Class Permit

java.lang.Object
  extended by com.hazelcast.concurrent.semaphore.Permit
All Implemented Interfaces:
DataSerializable

public class Permit
extends Object
implements DataSerializable


Field Summary
static int INITIAL_CAPACITY
           
 
Constructor Summary
Permit()
           
Permit(int partitionId, SemaphoreConfig config)
           
 
Method Summary
 boolean acquire(int permitCount, String caller)
           
 int drain(String caller)
           
 int getAsyncBackupCount()
           
 int getAvailable()
           
 int getPartitionId()
           
 int getSyncBackupCount()
           
 int getTotalBackupCount()
           
 boolean init(int permitCount)
           
 boolean isAvailable(int permitCount)
           
 boolean memberRemoved(String caller)
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 boolean reduce(int permitCount)
           
 void release(int permitCount, String caller)
           
 void setInitialized()
           
 String toString()
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

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

Permit

public Permit()

Permit

public Permit(int partitionId,
              SemaphoreConfig config)
Method Detail

memberRemoved

public boolean memberRemoved(String caller)

init

public boolean init(int permitCount)

getAvailable

public int getAvailable()

isAvailable

public boolean isAvailable(int permitCount)

acquire

public boolean acquire(int permitCount,
                       String caller)

drain

public int drain(String caller)

reduce

public boolean reduce(int permitCount)

release

public void release(int permitCount,
                    String caller)

getPartitionId

public int getPartitionId()

getSyncBackupCount

public int getSyncBackupCount()

getAsyncBackupCount

public int getAsyncBackupCount()

setInitialized

public void setInitialized()

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getTotalBackupCount

public int getTotalBackupCount()


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