// Note: When a session has timed out normally, then currentFrameworkAdapter will
// be null. But when a request calls session.invalidate directly, then this function
// is called within the thread of the request, and so will have a FrameworkAdapter
// in the current thread (which has been initialized with the http request object).
FrameworkAdapter currentFrameworkAdapter = FrameworkAdapter.getCurrentInstance();
try
{
// Always use a fresh FrameworkAdapter to avoid OrchestraException
// "Cannot remove current context" when a request calls session.invalidate();
// we want getRequestParameter and related functions to always return null..
FrameworkAdapter fa = new LocalFrameworkAdapter();
ConversationMessager conversationMessager = new LogConversationMessager();
fa.setConversationMessager(conversationMessager);
FrameworkAdapter.setCurrentInstance(fa);
conversationWiperThread.removeConversationManager(cm);
cm.removeAndInvalidateAllConversationContexts();
}