基于java工程开发RMI服务端

ServiceRegist.java

import java.rmi.Remote;

import java.rmi.RemoteException;

public interface ServiceRegist extends Remote{

  public user login(String userName, String password) throws RemoteException;

}

ServiceRegisterImpl.java

public class ServiceRegisterImpl extends UnicastRemoteObject implements ServiceRegist{

  private UserDao userDao;

  public ServiceRegisterImpl() throws RemoteException{super();}

   public user login(String userName, String password) throws RemoteException{

    return userDao.login(userName,password);

  }

}


发布

public class RMIServer{

  public static void main(String args[]){

    ServiceRegist sr = new ServiceRegistImpl();

    LocateRegistry.createRegistry(8888);

    String url = "rmi://localhost:8888/serviceRegistry";

    Naming.bind(url,sr);

    System.out.println("服务调度器启动成功");

  }

}

基于java工程开发RMI服务端,布布扣,bubuko.com

基于java工程开发RMI服务端

上一篇:关于H5唤醒APP的功能实现


下一篇:CSS动画实例:Loading加载动画效果(二)