ComponentRegistry componentRegistry = TestingUtil.extractComponentRegistry(cache);
InterceptorChain ic = componentRegistry.getComponent(InterceptorChain.class);
List<CommandInterceptor> commands = ic.getInterceptorsWhichExtend(BaseRpcInterceptor.class);
for (CommandInterceptor interceptor: commands)
{
ReplicationQueue original = (ReplicationQueue) TestingUtil.extractField(BaseRpcInterceptor.class, interceptor, "replicationQueue");
TestingUtil.replaceField(new ReplicationQueueDelegate(original),"replicationQueue", interceptor, BaseRpcInterceptor.class);
log("replaced replicationQueue in " + interceptor.getClass());
}
}