* <p>
* Assumes that no one else will be serializing the lease
* during this call.
*/
MarshalledInstance getMarshalledClientLease() {
final Lease cl = getClientLease();
if (cl == null) {
// We are deformed, best we can do is return the (possibly
// stale) pre-marshalled lease we already have
return marshalledClientLease;
} else {
try {
cl.setSerialFormat(Lease.DURATION);
return new MarshalledInstance(cl);
} catch (IOException e) {
// Can't create a new MarshalledInstance, return the old one
return marshalledClientLease;
} finally {
cl.setSerialFormat(Lease.ABSOLUTE);
}
}
}