@Override public Object execute() { try { return c.call(); } catch (Exception e) { throw new GridRuntimeException(e); } } };
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Nullable @Override public V get(Object key) { try { return prj.get((K)key); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Nullable @Override public V remove(Object key) { try { return prj.remove((K)key); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Override public final boolean hasNext() { try { return hasNextX(); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Override public final void remove() { try { removeX(); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Override public long expirationTime() { try { return impl.expireTime(); } catch (GridCacheEntryRemovedException e) { assert false : "Entry should not become obsolete while holding lock"; throw new GridRuntimeException(e); } }
/** @return Event that represents a local node joined to topology. */ public GridDiscoveryEvent localJoinEvent() { try { return locJoinEvt.get(); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Override public V peek() { try { return peek(MODES_SMART); } catch (GridException e) { // Should never happen. throw new GridRuntimeException("Unable to perform entry peek() operation.", e); } }
/** {@inheritDoc} */ @Nullable @Override public V putIfAbsent(K key, V val) { try { return prj.putIfAbsent(key, val); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Nullable @Override public V replace(K key, V val) { try { return prj.replace(key, val); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** * Initializes marshaller not to enforce {@link Serializable} interface. * * @throws GridRuntimeException If this marshaller is not supported on the current JVM. */ public GridOptimizedMarshaller() { if (!available()) throw new GridRuntimeException("Using GridOptimizedMarshaller on unsupported JVM version (some of " + "JVM-private APIs required for the marshaller to work are missing)."); }
/** {@inheritDoc} */ @Override public long timeToLive() { try { return impl.ttl(); } catch (GridCacheEntryRemovedException e) { assert false : "Entry should not become obsolete while holding lock"; throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Nullable @Override public V setValue(V val) { try { return set(val, CU.<K, V>empty()); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** * Throws {@link GridRuntimeException} in case if grid is stopping. */ private void checkStopping() { if (cctx.kernalContext().isStopping()) throw new GridRuntimeException("Grid is stopping"); }
/** * Gets ssl handler from the session. * * @param ses Session instance. * @return SSL handler. */ private GridNioSslHandler sslHandler(GridNioSession ses) { GridNioSslHandler hnd = ses.meta(SSL_HANDLER.ordinal()); if (hnd == null) throw new GridRuntimeException("Failed to process incoming message (received message before SSL handler " + "was created): " + ses); return hnd; }
/** {@inheritDoc} */ @Nullable @Override public V next() { it.next(); // Cached value. V val = it.currentValue(); try { return clone ? ctx.cloneValue(val) : val; } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Iterator<T> iterator() { try { GridCacheQueueHeader hdr = (GridCacheQueueHeader)cache.get(queueKey); checkRemoved(hdr); return new QueueIterator(hdr); } catch (GridException e) { throw new GridRuntimeException(e); } }
/** {@inheritDoc} */ @Override public GridCacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry, Collection<GridNode> nodes) { assert cctx.config().getCacheMode() == LOCAL; throw new GridRuntimeException("Distributed queries are not available for local cache " + "(use 'GridCacheQuery.execute(grid.forLocal())' instead) [cacheName=" + cctx.name() + ']'); }
/** {@inheritDoc} */ @Override public GridCacheQueryFuture<?> queryFieldsDistributed(GridCacheQueryBean qry, Collection<GridNode> nodes) { assert cctx.config().getCacheMode() == LOCAL; throw new GridRuntimeException("Distributed queries are not available for local cache " + "(use 'GridCacheQuery.execute(grid.forLocal())' instead) [cacheName=" + cctx.name() + ']'); } }
/** {@inheritDoc} */ @Override public V peek() { try { return peek0(SMART, null, cached.context().tm().localTxx()); } catch (GridException e) { // Should never happen. throw new GridRuntimeException("Unable to perform entry peek() operation.", e); } }