add rmi and unit test.