Interface Lease
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
public interface Lease extends java.io.CloseableRepresents an acquired lease from anInterProcessSemaphore. It is the client's responsibility to close this lease when it is no longer needed so that other blocked clients can use it. If the client crashes (or its session expires, etc.) the lease will automatically be closed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Releases the lease so that other clients/processes can acquire itbyte[]getData()Return the data stored in the node for this leasejava.lang.StringgetNodeName()Return the the node for this lease
-
-
-
Method Detail
-
close
void close() throws java.io.IOExceptionReleases the lease so that other clients/processes can acquire it- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException- errors
-
getData
byte[] getData() throws java.lang.ExceptionReturn the data stored in the node for this lease- Returns:
- data
- Throws:
java.lang.Exception- errors
-
getNodeName
java.lang.String getNodeName()
Return the the node for this lease- Returns:
- data
- Throws:
java.lang.Exception- errors
-
-