This is the interface for a piece of code that will plug into the user programming model impl (e.g. JAX-WS impl) and will be invoked while on the ultimate thread of execution. It is intended to provide a mechanism to allow information to be migrated between the Axis2 contexts and thread local storage.
Note: It is up to each particular programming model impl to decide whether or not they wish to make use of the ThreadContextMigrators.
For each general MEP, here is the invocation pattern:
[one-way inbound] migrateContextToThread(req) cleanupThread(req)
[req/rsp inbound] migrateContextToThread(req) migrateThreadToContext(rsp) cleanupContext(rsp) cleanupThread(req)
[one-way outbound] migrateThreadToContext(req) cleanupContext(req)
[req/rsp outbound (both sync and async)] migrateThreadToContext(req) cleanupContext(req) migrateContextToThread(rsp) Note: there is no corresponding cleanupThread(rsp); one of the inbound cases would need to handle this
If a fault occurs during execution of one of the migrators, it will be treated like any other service fault (i.e. like what will happen if we can't deliver the message to a service or if a handler fails.
The cleanup* methods can be expected to be invoked after any exeception that occurs within the scope of the migration that would cause that scope to be left so that the thread and/or context may be cleaned up properly.