Try like this;
// goverance/config registry
Registry regInstance = synapseMsgContext.getConfiguration()
.getRegistry();
Object obj=regInstance.getResource(new Entry("gov:/test1.txt"),null);
Object obj2=regInstance.getResource(new Entry("conf:/test2.txt"),null);
Refer this post