/**
* @see org.apache.lenya.transaction.Transactionable#lock()
*/
public void lock() throws TransactionException {
if (isCheckedOut()) {
throw new TransactionException("Cannot lock [" + this + "]: node is checked out.");
}
if (getLogger().isDebugEnabled()) {
getLogger().debug("Locking [" + this + "]");
}
int currentVersion;
try {
currentVersion = getRevisionController().getLatestVersion(getRCPath());
} catch (TransactionException e) {
throw e;
} catch (Exception e) {
throw new TransactionException(e);
}
this.lock = new Lock(currentVersion);
}