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); } }
return; throw new LeaseMapException("Expired Sets", newExceptionMap); throw new LeaseMapException( (lme == null) ? "Expired Sets" : lme.getMessage(), newExceptionMap);
private void updateAll(boolean isRenew) throws LeaseMapException { LeaseUpdateBatch batch = createBatch(isRenew); Map<SpaceLease, Throwable> errors = LeaseUtils.updateBatch(_spaceProxy, batch); if (errors != null) { for (SpaceLease lease : errors.keySet()) if (remove(lease) == null) throw new ConcurrentModificationException(); throw new LeaseMapException("Failed to " + (isRenew ? "renew" : "cancel") + " one or more leases", errors); } }
public void cancelAll() throws LeaseMapException, RemoteException { int size = map.size(); if (size == 0) return; Object[] regIDs = new Object[size]; Uuid[] leaseIDs = new Uuid[size]; int i = 0; for (Iterator iter = map.keySet().iterator(); iter.hasNext(); i++) { RegistrarLease ls = (RegistrarLease) iter.next(); regIDs[i] = ls.getRegID(); leaseIDs[i] = ls.getReferentUuid(); } Exception[] exceptions = server.cancelLeases(regIDs, leaseIDs); if (exceptions == null) return; i = 0; HashMap emap = new HashMap(13); for (Iterator iter = map.keySet().iterator(); iter.hasNext(); i++) { RegistrarLease ls = (RegistrarLease) iter.next(); Exception ex = exceptions[i]; if (ex != null) { emap.put(ls, ex); iter.remove(); } } throw new LeaseMapException("lease cancellation failures", emap); } }
throw new LeaseMapException("lease cancellation failures", emap);
throw new LeaseMapException("Some leases failed to cancel", exceptionMap);
throw new LeaseMapException("lease renewal failures", emap);
throw new ConcurrentModificationException(); throw new LeaseMapException( "Failure canceling one or more leases", rslt);
throw new LeaseMapException("lease renewal failures", emap);
throw new LeaseMapException("lease cancellation failures", emap);
throw new LeaseMapException("lease renewal failures", emap);
throw new ConcurrentModificationException(); throw new LeaseMapException( "Failure canceling one or more leases", rslt);
throw new LeaseMapException("renewing", bad);
throw new LeaseMapException("Some leases failed to renew", exceptionMap);
throw new LeaseMapException("renewing", bad);