net.sf.sasl.distributed.lock
Interface ILockContainer

All Known Subinterfaces:
ILockSequence, ILockSession
All Known Implementing Classes:
DefaultLockSession, DefaultLockSession.LockSequence

public interface ILockContainer

Interface defines methods which must be offered by a lock container. What a lock container is concrete, depends on the implementation, but normally it should be some collection of acquired locks.

Since:
0.0.1 (sasl-distributed-lock-library)
Author:
Philipp Förmer

Method Summary
 void clear()
          Releases all locks that this lock container holds.
 String getName()
          Returns a name of the lock container, for example "lock-transaction-X".
 boolean isActive()
          Returns true if this lock container is active which means it was not yet released via release().
 void release()
          Releases all resources associated with this lock container.
 

Method Detail

clear

void clear()
           throws LockOperationException
Releases all locks that this lock container holds. If the container has nested lock containers than they will be released via release(). The container stays active after the operation.

Throws:
LockOperationException - if an exception occurs during releasing locks and nested containers.
Since:
0.0.1 (sasl-distributed-lock-library)

release

void release()
             throws LockOperationException
Releases all resources associated with this lock container. If the container has got nested containers, than all nested containers of the container must get released and all locks, which are held by the container.
After the operation the lock element should be disconnected from all types of lock operations, which means it is inactive and garbage.

Throws:
LockOperationException
Since:
0.0.1 (sasl-distributed-lock-library)

isActive

boolean isActive()
Returns true if this lock container is active which means it was not yet released via release(). False else. An inactive lock container should be disconnected from all types of lock operations.

Returns:
true or false.
Since:
0.0.1 (sasl-distributed-lock-library)

getName

String getName()
Returns a name of the lock container, for example "lock-transaction-X".

Returns:
null or non null
Since:
0.0.1 (sasl-distributed-lock-library)


Copyright © 2010. All Rights Reserved.