@Override protected void done() { try { get(); } catch (InterruptedException e) { Log.e(TAG, e.getMessage()); worker.abort(); postCancel(worker); e.printStackTrace(); } catch (ExecutionException e) { Log.e(TAG, e.getMessage()); e.printStackTrace(); throw new RuntimeException("An error occured while executing doInBackground()", e.getCause()); } catch (CancellationException e) { worker.abort(); postCancel(worker); Log.e(TAG, e.getMessage()); e.printStackTrace(); } } };
@Override protected void done() { try { get(); } catch (InterruptedException e) { LogUtils.e(TAG, e); worker.abort(); postCancel(worker); e.printStackTrace(); } catch (ExecutionException e) { LogUtils.e(TAG, e.getMessage()); e.printStackTrace(); throw new RuntimeException("An error occured while executing doInBackground()", e.getCause()); } catch (CancellationException e) { worker.abort(); postCancel(worker); LogUtils.e(TAG, e); e.printStackTrace(); } } };
private void executeWithLastResult(FunctionContext context) { RegionFunctionContext rfContext = (RegionFunctionContext)context; final PartitionedRegion pr = (PartitionedRegion)rfContext.getDataSet(); ResourceManager resMan = pr.getCache().getResourceManager(); RebalanceFactory factory = resMan.createRebalanceFactory(); RebalanceOperation rebalanceOp = factory.start(); try { RebalanceResults rebalanceResults = rebalanceOp.getResults(); } catch (CancellationException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } context.getResultSender().lastResult((Serializable) context.getArguments()); }