Brooklyn

brooklyn.util.mutex
[Java] Class MutexSupport

java.lang.Object
  brooklyn.util.mutex.MutexSupport
All Implemented Interfaces:
WithMutexes

public class MutexSupport

Method Summary
void acquireMutex(java.lang.String mutexId, java.lang.String description)

void cleanup()

void cleanupMutex(java.lang.String mutexId)

forces deletion of the given mutex if it is unused; normally not required as is done automatically on close (but possibly needed where there are cancelations and risk of memory leaks)

java.util.Map getAllSemaphores()

Returns the semaphores in use at the time the method is called, for inspection purposes (and testing).

protected SemaphoreWithOwners getSemaphore(java.lang.String mutexId)

protected SemaphoreWithOwners getSemaphore(java.lang.String mutexId, boolean requestBeforeReturning)

boolean hasMutex(java.lang.String mutexId)

void releaseMutex(java.lang.String mutexId)

java.lang.String toString()

boolean tryAcquireMutex(java.lang.String mutexId, java.lang.String description)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

acquireMutex

@Override
public void acquireMutex(java.lang.String mutexId, java.lang.String description)


cleanup

public void cleanup()


cleanupMutex

public void cleanupMutex(java.lang.String mutexId)
forces deletion of the given mutex if it is unused; normally not required as is done automatically on close (but possibly needed where there are cancelations and risk of memory leaks)


getAllSemaphores

public java.util.Map getAllSemaphores()
Returns the semaphores in use at the time the method is called, for inspection purposes (and testing). The semaphores used by this class may change over time so callers are strongly discouraged from manipulating the semaphore objects themselves.


getSemaphore

protected SemaphoreWithOwners getSemaphore(java.lang.String mutexId)


getSemaphore

protected SemaphoreWithOwners getSemaphore(java.lang.String mutexId, boolean requestBeforeReturning)


hasMutex

@Override
public boolean hasMutex(java.lang.String mutexId)


releaseMutex

@Override
public void releaseMutex(java.lang.String mutexId)


toString

@Override
public java.lang.String toString()


tryAcquireMutex

@Override
public boolean tryAcquireMutex(java.lang.String mutexId, java.lang.String description)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.