This probably wont work in domain mode.
also don't use context.readResourceFromRoot(path) as it will clone whole resource tree from root.
it would be much better if you use: context.readResourceFromRoot(path,false)