org.apache.sandesha2.context
Interface ContextManager

All Known Implementing Classes:
DummyContextManager

public interface ContextManager

This interface allows the context surrounding an invocation to be saved and restored. This is useful when we are doing inOrder processing, as the service will be dispatched by the InvokerWorker (not the original transport thread), and context may have been lost by that switch. Each ContextManager implementation should have a constructor that takes a Axis ConfigurationContext object.


Method Summary
 java.io.Serializable storeContext()
          Store the current threads execution context.
 java.lang.Runnable wrapWithContext(java.lang.Runnable work, java.io.Serializable context)
          Wrap the provided runnable with execution context that was previously stored.
 

Method Detail

storeContext

java.io.Serializable storeContext()
Store the current threads execution context. When embedded in an appserver, this provides a hook point to store classloaders, security context, JNDI, etc.


wrapWithContext

java.lang.Runnable wrapWithContext(java.lang.Runnable work,
                                   java.io.Serializable context)
Wrap the provided runnable with execution context that was previously stored. We expect the resulting runnable to be dispatched by a thread pool or other worker, and the wrapper ensures that the correct execution context will be applied.



Copyright © The Apache Software Foundation. All Rights Reserved.