/** * @param entries Entries. * @return First entry. * @throws IgniteCheckedException If failed. */ private IgniteTxEntry unmarshal(@Nullable Collection<IgniteTxEntry> entries) throws IgniteCheckedException { if (entries == null) return null; IgniteTxEntry firstEntry = null; for (IgniteTxEntry e : entries) { e.unmarshal(ctx, false, ctx.deploy().globalLoader()); if (firstEntry == null) firstEntry = e; } return firstEntry; }
@Override public void onMessage(UUID nodeId, Object msg, byte plc) { if (msg instanceof TxLocksResponse) { try { ((TxLocksResponse)msg).finishUnmarshal(clientCtx, clientCtx.deploy().globalLoader()); res.set(true); } catch (Exception e) { log.error("Message unmarshal failed", e); } finally { latch.countDown(); } } } });
/** {@inheritDoc} */ @Override public Value value(GridKernalContext ctx) throws IgniteCheckedException { CacheObjectValueContext valCtx = ctx.query().objectContext(); obj.finishUnmarshal(valCtx, ctx.cache().context().deploy().globalLoader()); return new GridH2ValueCacheObject(obj, valCtx); }
clsLdr = val.getClass().getClassLoader(); else if (kernalCtx.config().isPeerClassLoadingEnabled()) clsLdr = kernalCtx.cache().context().deploy().globalLoader(); else clsLdr = null; kernalCtx.cache().context().deploy().globalLoader() : null);
/** * @param nodeId Sender node ID. * @param cacheMsg Message. */ private void unmarshall(UUID nodeId, GridCacheMessage cacheMsg) { if (cctx.localNodeId().equals(nodeId)) return; try { cacheMsg.finishUnmarshal(cctx, cctx.deploy().globalLoader()); } catch (IgniteCheckedException e) { cacheMsg.onClassError(e); } catch (BinaryObjectException e) { cacheMsg.onClassError(new IgniteCheckedException(e)); } catch (Error e) { if (cacheMsg.ignoreClassErrors() && X.hasCause(e, NoClassDefFoundError.class, UnsupportedClassVersionError.class)) { cacheMsg.onClassError( new IgniteCheckedException("Failed to load class during unmarshalling: " + e, e) ); } else throw e; } } }
/** * Finds next element. * * @throws IgniteCheckedException If failed. */ @SuppressWarnings("unchecked") private void findNext() throws IgniteCheckedException { curr = null; while (idx < docs.length) { Document doc; try { doc = searcher.doc(docs[idx++].doc); } catch (IOException e) { throw new IgniteCheckedException(e); } ClassLoader ldr = null; if (ctx != null && ctx.deploy().enabled()) ldr = ctx.cache().internalCache(cacheName).context().deploy().globalLoader(); K k = unmarshall(doc.getBinaryValue(KEY_FIELD_NAME).bytes, ldr); if (filters != null && !filters.apply(k)) continue; V v = type.valueClass() == String.class ? (V)doc.get(VAL_STR_FIELD_NAME) : this.<V>unmarshall(doc.getBinaryValue(VAL_FIELD_NAME).bytes, ldr); assert v != null; curr = new IgniteBiTuple<>(k, v); break; } }
GridCacheDeploymentManager depMgr = cctx.deploy(); ClassLoader ldr = depMgr.globalLoader();
U.clearClassFromClassCache(ctx.cache().context().deploy().globalLoader(), sampleClassName()); U.clearClassFromClassCache(ctx.cache().context().deploy().globalLoader(), alias);
/** * @param info Entry to marshal. * @param ctx Context. * @param cacheObjCtx Cache object context. * @throws IgniteCheckedException If failed. */ protected final void marshalInfo(GridCacheEntryInfo info, GridCacheSharedContext ctx, CacheObjectContext cacheObjCtx ) throws IgniteCheckedException { assert ctx != null; if (info != null) { info.marshal(cacheObjCtx); if (addDepInfo) { if (info.key() != null) prepareObject(info.key().value(cacheObjCtx, false), ctx); CacheObject val = info.value(); if (val != null) { val.finishUnmarshal(cacheObjCtx, ctx.deploy().globalLoader()); prepareObject(val.value(cacheObjCtx, false), ctx); } } } }
oldVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); newVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
cacheMsg.finishUnmarshal(cctx, cctx.deploy().globalLoader());
ldr = depMgr.globalLoader();
info.unmarshalValue(cctx, cctx.deploy().globalLoader());
oldVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); checkSecurityPermission(SecurityPermission.CACHE_PUT); val.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
ClassLoader ldr = ctx.deploy().globalLoader();
"adding entry [msgId=" + msgId + ", e=" + e + ", tx=" + this + ']'; e.unmarshal(cctx, false, cctx.deploy().globalLoader());
nearTx = !F.isEmpty(req.nearWrites()) ? startNearRemoteTx(ctx.deploy().globalLoader(), nodeId, req) : null; dhtTx = startRemoteTx(nodeId, req, res);
tx.addWrite(entry, ctx.deploy().globalLoader());