本文整理汇总了C#中CacheEntry.CloneWithoutValue方法的典型用法代码示例。如果您正苦于以下问题:C# CacheEntry.CloneWithoutValue方法的具体用法?C# CacheEntry.CloneWithoutValue怎么用?C# CacheEntry.CloneWithoutValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheEntry
的用法示例。
在下文中一共展示了CacheEntry.CloneWithoutValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Clustered_Insert
/// <summary>
/// Updates or Adds the object to the cluster.
/// </summary>
/// <param name="dest"></param>
/// <param name="key">key of the entry.</param>
/// <param name="cacheEntry"></param>
/// <param name="lockId"></param>
/// <param name="accessType"></param>
/// <param name="operationContext"></param>
/// <returns>cache entry.</returns>
/// <remarks>
/// This method invokes <see cref="handleInsert"/> on the specified node.
/// </remarks>
protected CacheInsResultWithEntry Clustered_Insert(Address dest, object key, CacheEntry cacheEntry, object lockId, LockAccessType accessType, OperationContext operationContext)
{
if (ServerMonitor.MonitorActivity) ServerMonitor.LogClientActivity("PartCacheBase.Insert", "");
CacheInsResultWithEntry retVal = new CacheInsResultWithEntry();
try
{
Function func = new Function((int)OpCodes.Insert, new object[] { key, cacheEntry.CloneWithoutValue(), lockId, accessType, operationContext });
Array userPayLoad = null;
if (cacheEntry.Value is CallbackEntry)
{
CallbackEntry cbEntry = ((CallbackEntry)cacheEntry.Value);
userPayLoad = cbEntry.UserData;
}
else
{
userPayLoad = cacheEntry.UserData;
}
func.UserPayload = userPayLoad;
func.ResponseExpected = true;
object result = Cluster.SendMessage(dest, func, GroupRequest.GET_FIRST, false);
if (result == null)
{
return retVal;
}
retVal = (CacheInsResultWithEntry)((OperationResponse)result).SerializablePayload;
if (retVal.Entry != null)
retVal.Entry.Value = ((OperationResponse)result).UserPayload;
}
catch (Runtime.Exceptions.SuspectedException se)
{
throw;
}
catch (Runtime.Exceptions.TimeoutException te)
{
throw;
}
catch (CacheException e)
{
throw;
}
catch (Exception e)
{
throw new GeneralFailureException(e.Message, e);
}
return retVal;
}
示例2: Clustered_Add
/// <summary>
/// Add the object to specfied node in the cluster.
/// </summary>
/// <param name="dest"></param>
/// <param name="key">key of the entry.</param>
/// <param name="cacheEntry"></param>
/// <param name="operationContext"></param>
/// <returns>cache entry.</returns>
/// <remarks>
/// This method either invokes <see cref="handleAdd"/> on every server-node in the cluster.
/// </remarks>
protected CacheAddResult Clustered_Add(Address dest, object key, CacheEntry cacheEntry, OperationContext operationContext)
{
if (ServerMonitor.MonitorActivity) ServerMonitor.LogClientActivity("PartCacheBase.Add_1", "");
CacheAddResult retVal = CacheAddResult.Success;
try
{
Function func = new Function((int)OpCodes.Add, new object[] { key, cacheEntry.CloneWithoutValue(), operationContext });
Array userPayLoad = null;
if (cacheEntry.Value is CallbackEntry)
{
CallbackEntry cbEntry = ((CallbackEntry)cacheEntry.Value);
userPayLoad = cbEntry.UserData;
}
else
{
userPayLoad = cacheEntry.UserData;
}
func.UserPayload = userPayLoad;
object result = Cluster.SendMessage(dest, func, GroupRequest.GET_FIRST);
if (result == null)
{
return retVal;
}
if (result is CacheAddResult)
retVal = (CacheAddResult)result;
else if (result is System.Exception)
throw (Exception)result;
}
catch (Runtime.Exceptions.SuspectedException se)
{
throw;
}
catch (Runtime.Exceptions.TimeoutException te)
{
throw;
}
catch (CacheException e)
{
throw;
}
catch (Exception e)
{
throw new GeneralFailureException(e.Message, e);
}
return retVal;
}