Esempio n. 1
0
        /// <summary>
        /// creates a request scope PICurrent from the ThreadScope PICurrent.
        /// </summary>
        internal PICurrentImpl CreateRequestScopeFromThreadScope()
        {
            PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated());

            result.SetSlotsFrom(GetThreadScopedCurrent());
            return(result);
        }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
 /// <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];
     }
 }
Esempio n. 4
0
 /// <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;
 }                
Esempio n. 5
0
 /// <summary>
 /// creates a request scope PICurrent from the ThreadScope PICurrent.
 /// </summary>
 internal PICurrentImpl CreateRequestScopeFromThreadScope() {
     PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated());
     result.SetSlotsFrom(GetThreadScopedCurrent());
     return result;
 }
Esempio n. 6
0
 /// <summary>
 /// copys the request-scope current to the thread-scope current.
 /// </summary>
 internal void SetFromRequestScope(PICurrentImpl requestCurrent) {
     PICurrentImpl threadScoped = GetThreadScopedCurrent();
     threadScoped.SetSlotsFrom(requestCurrent);            
 }
Esempio n. 7
0
 /// <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;
 }
Esempio n. 8
0
 /// <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];
     }
 }
Esempio n. 9
0
 /// <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;
 }        
Esempio n. 10
0
 /// <summary>creates an empty request scope PICurrent</summary>
 internal PICurrentImpl CreateEmptyRequestScope() {
     PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated());
     return result;
 }
Esempio n. 11
0
        /// <summary>
        /// copys the request-scope current to the thread-scope current.
        /// </summary>
        internal void SetFromRequestScope(PICurrentImpl requestCurrent)
        {
            PICurrentImpl threadScoped = GetThreadScopedCurrent();

            threadScoped.SetSlotsFrom(requestCurrent);
        }
Esempio n. 12
0
 /// <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;
 }
Esempio n. 13
0
        /// <summary>creates an empty request scope PICurrent</summary>
        internal PICurrentImpl CreateEmptyRequestScope()
        {
            PICurrentImpl result = new PICurrentImpl(GetNrOfSlotsAllocated());

            return(result);
        }