private void renewAl() throws LeaseMapException, RemoteException { Map.Entry entry = (Map.Entry) map.entrySet().iterator().next(); ClientLeaseWrapper l = (ClientLeaseWrapper) entry.getKey(); long d = ((Long) entry.getValue()).longValue(); try { l.renew(d); } catch (LeaseException e) { final Map<Lease, Throwable> m = new HashMap<Lease, Throwable>(1); m.put(l, e); throw new LeaseMapException(e.getMessage(), m); } }
public String getMessage(){ String lease = "Lease: "; String exception = "Exception: "; String ret = "\n"; StringBuilder sb = new StringBuilder(1024); sb.append(super.getMessage()); sb.append(ret); Iterator<Entry<Lease,Throwable>> it = exceptionMap.entrySet().iterator(); while (it.hasNext()){ Entry<Lease,Throwable> entry = it.next(); sb.append(lease); sb.append(entry.getKey()); sb.append(exception); sb.append(entry.getValue().getMessage()); sb.append(ret); } return sb.toString(); } }