/**
   * {@inheritDoc}
   *
   * @param ctx
   */
  @Override
  public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
    super.prepareMarshal(ctx);

    GridCacheContext cctx = ctx.cacheContext(cacheId);

    prepareMarshalCacheObjects(keys, cctx);

    if (op == TRANSFORM) entryProcessorsBytes = marshalCollection(entryProcessors, ctx);
    else prepareMarshalCacheObjects(vals, cctx);

    if (filter != null) {
      boolean hasFilter = false;

      for (CacheEntryPredicate p : filter) {
        if (p != null) {
          hasFilter = true;

          p.prepareMarshal(cctx);
        }
      }

      if (!hasFilter) filter = null;
    }

    invokeArgsBytes = marshalInvokeArguments(invokeArgs, ctx);

    if (expiryPlc != null)
      expiryPlcBytes = CU.marshal(ctx, new IgniteExternalizableExpiryPolicy(expiryPlc));
  }
  /** {@inheritDoc} */
  @Override
  public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
    assert p != null;

    p.prepareMarshal(ctx);

    if (bytes == null) bytes = U.marshal(ctx.marshaller(), p);
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
    assert p != null || bytes != null;

    if (p == null) {
      p = U.unmarshal(ctx.marshaller(), bytes, U.resolveClassLoader(ldr, ctx.gridConfig()));

      p.finishUnmarshal(ctx, ldr);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)
      throws IgniteCheckedException {
    super.finishUnmarshal(ctx, ldr);

    GridCacheContext cctx = ctx.cacheContext(cacheId);

    finishUnmarshalCacheObjects(keys, cctx, ldr);

    if (op == TRANSFORM) entryProcessors = unmarshalCollection(entryProcessorsBytes, ctx, ldr);
    else finishUnmarshalCacheObjects(vals, cctx, ldr);

    if (filter != null) {
      for (CacheEntryPredicate p : filter) {
        if (p != null) p.finishUnmarshal(cctx, ldr);
      }
    }

    invokeArgs = unmarshalInvokeArguments(invokeArgsBytes, ctx, ldr);

    if (expiryPlcBytes != null) expiryPlc = ctx.marshaller().unmarshal(expiryPlcBytes, ldr);
  }
  /** {@inheritDoc} */
  @Override
  public boolean apply(GridCacheEntryEx e) {
    assert p != null;

    return p.apply(e);
  }
  /** {@inheritDoc} */
  @Override
  public void entryLocked(boolean locked) {
    assert p != null;

    p.entryLocked(locked);
  }