/** * @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; }
dbMgr, snpMgr, new GridCacheDeploymentManager<K, V>(), new GridCachePartitionExchangeManager<K, V>(), affMgr,
addEntries(ldr, keys, cache); addEntries(ldr, keys, (((GridNearCacheAdapter)cache).dht()));
/** * @param o Object to prepare for marshalling. * @param ctx Context. * @throws IgniteCheckedException If failed. */ protected final void prepareObject(@Nullable Object o, GridCacheSharedContext ctx) throws IgniteCheckedException { assert addDepInfo || forceAddDepInfo; if (!skipPrepare && o != null) { GridDeploymentInfo d = ctx.deploy().globalDeploymentInfo(); if (d != null) { prepare(d); // Global deployment has been injected. skipPrepare = true; } else { Class<?> cls = U.detectClass(o); ctx.deploy().registerClass(cls); ClassLoader ldr = U.detectClassLoader(cls); if (ldr instanceof GridDeploymentInfo) prepare((GridDeploymentInfo)ldr); } } }
GridCacheDeploymentManager depMgr = cctx.deploy(); ClassLoader ldr = depMgr.globalLoader(); depMgr.p2pContext( nodeId, depInfo.classLoaderId(),
cache.context().deploy().ignoreOwnership(true); e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); checkSecurityPermission(SecurityPermission.CACHE_PUT); val.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); cache.context().deploy().ignoreOwnership(false);
cctx.deploy().ignoreOwnership(true); cctx.deploy().ignoreOwnership(false);
/** * Enter a cache call. */ public void enter() { if (ctx.deploymentEnabled()) ctx.deploy().onEnter(); rwLock.readLock().lock(); checkState(true, true); }
/** * @param bytes Bytes. * @return Cache key object. * @throws IgniteCheckedException If failed. */ public KeyCacheObject toCacheKeyObject(byte[] bytes) throws IgniteCheckedException { Object obj = ctx.cacheObjects().unmarshal(cacheObjCtx, bytes, deploy().localLoader()); return cacheObjects().toCacheKeyObject(cacheObjCtx, this, obj, false); }
/** * Undeploys and removes all entries for class loader. * * @param ldr Class loader to undeploy. */ public final void onUndeploy(ClassLoader ldr) { ctx.deploy().onUndeploy(ldr, context()); }
/** * Prepares deployable object. * * @param deployable Deployable object. */ public void prepare(GridCacheDeployable deployable) { assert depEnabled; // Only set deployment info if it was not set automatically. if (deployable.deployInfo() == null) { GridDeploymentInfoBean dep = globalDeploymentInfo(); if (dep == null) { GridDeployment locDep0 = locDep.get(); if (locDep0 != null) { // Will copy sequence number to bean. dep = new GridDeploymentInfoBean(locDep0); } } if (dep != null) deployable.prepare(dep); if (log.isDebugEnabled()) log.debug("Prepared grid cache deployable [dep=" + dep + ", deployable=" + deployable + ']'); } }
", msg=" + cacheMsg + ']'; cctx.deploy().p2pContext( nodeId, bean.classLoaderId(), cacheMsg.finishUnmarshal(cctx, cctx.deploy().globalLoader());
cache.context().deploy().ignoreOwnership(true); e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); checkSecurityPermission(SecurityPermission.CACHE_PUT); val.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); cache.context().deploy().ignoreOwnership(false);
/** * @param o Object to prepare for marshalling. * @param ctx Context. * @throws IgniteCheckedException If failed. */ protected final void prepareObject(@Nullable Object o, GridCacheSharedContext ctx) throws IgniteCheckedException { assert addDepInfo || forceAddDepInfo; if (!skipPrepare && o != null) { GridDeploymentInfo d = ctx.deploy().globalDeploymentInfo(); if (d != null) { prepare(d); // Global deployment has been injected. skipPrepare = true; } else { Class<?> cls = U.detectClass(o); ctx.deploy().registerClass(cls); ClassLoader ldr = U.detectClassLoader(cls); if (ldr instanceof GridDeploymentInfo) prepare((GridDeploymentInfo)ldr); } } }
ctx.cache().context().deploy().ignoreOwnership(true); ctx.cache().context().deploy().ignoreOwnership(false);
/** * @param opCtx Cache operation context. */ private void onEnter(CacheOperationContext opCtx) { ctx.itHolder().checkWeakQueue(); if (ctx.deploymentEnabled()) ctx.deploy().onEnter(); if (opCtx != null) checkAtomicOpsInTx(opCtx); }
/** * @param bytes Bytes. * @return Cache key object. * @throws IgniteCheckedException If failed. */ public KeyCacheObject toCacheKeyObject(byte[] bytes) throws IgniteCheckedException { Object obj = ctx.cacheObjects().unmarshal(cacheObjCtx, bytes, deploy().localLoader()); return cacheObjects().toCacheKeyObject(cacheObjCtx, this, obj, false); }
/** * Undeploys and removes all entries for class loader. * * @param ldr Class loader to undeploy. */ public final void onUndeploy(ClassLoader ldr) { ctx.deploy().onUndeploy(ldr, context()); }
/** * Prepares deployable object. * * @param deployable Deployable object. */ public void prepare(GridCacheDeployable deployable) { assert depEnabled; // Only set deployment info if it was not set automatically. if (deployable.deployInfo() == null) { GridDeploymentInfoBean dep = globalDeploymentInfo(); if (dep == null) { GridDeployment locDep0 = locDep.get(); if (locDep0 != null) { // Will copy sequence number to bean. dep = new GridDeploymentInfoBean(locDep0); } } if (dep != null) deployable.prepare(dep); if (log.isDebugEnabled()) log.debug("Prepared grid cache deployable [dep=" + dep + ", deployable=" + deployable + ']'); } }
@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(); } } } });