code: public void putSharedObject(String key, Object value)
     {
        TransactionContext ctx = contexts.get();
        if (ctx == null)
        {
           throw new IllegalStateException("There is no active transaction context");
        }
        XidContext xidCtx = ctx.getXidContext();
        if (xidCtx == null)
        {
           throw new IllegalStateException("There is no active xid context");
        }
        xidCtx.putSharedObject(key, value);
     }
docs: Registers an object to be shared within the XidContext
  @param key the key of the shared object
  @param value the shared object