Object pollInternal(long timeout) throws InterruptedException { PollOperation operation = new PollOperation(name, timeout); final NodeEngine nodeEngine = getNodeEngine(); try { Invocation inv = nodeEngine .getOperationService() .createInvocationBuilder(QueueService.SERVICE_NAME, operation, getPartitionId()) .build(); Future f = inv.invoke(); return f.get(); } catch (Throwable throwable) { throw ExceptionUtil.rethrowAllowInterrupted(throwable); } }
boolean offerInternal(Data data, long timeout) throws InterruptedException { throwExceptionIfNull(data); OfferOperation operation = new OfferOperation(name, timeout, data); final NodeEngine nodeEngine = getNodeEngine(); try { Invocation inv = nodeEngine .getOperationService() .createInvocationBuilder(QueueService.SERVICE_NAME, operation, getPartitionId()) .build(); Future f = inv.invoke(); return (Boolean) nodeEngine.toObject(f.get()); } catch (Throwable throwable) { throw ExceptionUtil.rethrowAllowInterrupted(throwable); } }