Hello friend,
Please go through the following example of the RMI from the java programming:
Code:
import java.rmi.Remote;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import java.rmi.RemoteException;
import org.springframework.core.io.Resource;
class rmserviceclientDM
{
public static void main(String alprgs[]) throws Exception
{
Resource res1 = new ClassPathResource("context.xml");
BeanFactory factory1 = new XmlBeanFactory(res);
RMIServer bean01 = (RMIServer) factory.getBean("RMIServer");
String r1 = bean01.getresult("asdlf");
System.out.println(r);
res1 = new ClassPathResource("context.xml");
factory = new XmlBeanFactory(res);
RMIservice bean02 = (RMIservice) factory.getBean("RMIservice");
String s1 = bean02.getresult("AAA");
System.out.println(s1);
}
}
Bookmarks