/// <summary> /// creates a request scope PICurrent from the ThreadScope PICurrent. /// </summary> internal PICurrentImpl CreateRequestScopeFromThreadScope() { PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated()); result.SetSlotsFrom(GetThreadScopedCurrent()); return(result); }
/// <summary> /// gets the current thread-scope PICurrent. /// </summary> /// <remarks> /// thread scope is managed inside a ThreadStatic member. /// Sadly using the .NET CallContext is not feasible, because model differs on the server side too much and /// is also not really specified in detail. /// </remarks> internal PICurrentImpl GetThreadScopedCurrent() { if (t_threadScopePICurrent == null) { t_threadScopePICurrent = new PICurrentImpl(GetNrOfSlotsAllocated()); } return(t_threadScopePICurrent); }
/// <summary>sets this picurrent data from another instance.</summary> internal void SetSlotsFrom(PICurrentImpl other) { if (other.m_slots.Length != m_slots.Length) { m_slots = new object[other.m_slots.Length]; } for (int i = 0; i < m_slots.Length; i++) { m_slots[i] = other.m_slots[i]; } }
/// <summary> /// helper method to set the picurrent inside a message. /// </summary> internal static void SetPICurrent(IMessage msg, PICurrentImpl current) { msg.Properties[SimpleGiopMsg.PI_CURRENT_SLOTS] = current; }
/// <summary> /// creates a request scope PICurrent from the ThreadScope PICurrent. /// </summary> internal PICurrentImpl CreateRequestScopeFromThreadScope() { PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated()); result.SetSlotsFrom(GetThreadScopedCurrent()); return result; }
/// <summary> /// copys the request-scope current to the thread-scope current. /// </summary> internal void SetFromRequestScope(PICurrentImpl requestCurrent) { PICurrentImpl threadScoped = GetThreadScopedCurrent(); threadScoped.SetSlotsFrom(requestCurrent); }
/// <summary> /// gets the current thread-scope PICurrent. /// </summary> /// <remarks> /// thread scope is managed inside a ThreadStatic member. /// Sadly using the .NET CallContext is not feasible, because model differs on the server side too much and /// is also not really specified in detail. /// </remarks> internal PICurrentImpl GetThreadScopedCurrent() { if (t_threadScopePICurrent == null) { t_threadScopePICurrent = new PICurrentImpl(GetNrOfSlotsAllocated()); } return t_threadScopePICurrent; }
/// <summary>clears the thread context of all slot data.</summary> /// <remarks>e.g. used on the server side to remove all context data when the request /// has been processed.</remarks> internal void ClearThreadScope() { t_threadScopePICurrent = null; }
/// <summary>creates an empty request scope PICurrent</summary> internal PICurrentImpl CreateEmptyRequestScope() { PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated()); return result; }
/// <summary>creates an empty request scope PICurrent</summary> internal PICurrentImpl CreateEmptyRequestScope() { PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated()); return(result); }