Class SessionAwareMethodInterceptor<D,C>

Type Parameters:
D - Type of the actual Mongo Database.
C - Type of the actual Mongo Collection.
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor

public class SessionAwareMethodInterceptor<D,C> extends Object implements MethodInterceptor
MethodInterceptor implementation looking up and invoking an alternative target method having ClientSession as its first argument. This allows seamless integration with the existing code base.
The MethodInterceptor is aware of methods on MongoCollection that my return new instances of itself like (eg. MongoCollection.withWriteConcern(WriteConcern) and decorate them if not already proxied.
Christoph Strobl, Mark Paluch