computeengine.java

来自「初期JAVA学习非常有用的资料。帮助深入了解API。特别是Applet。」· Java 代码 · 共 33 行

JAVA
33
字号
package engine;import java.rmi.*;import java.rmi.server.*;import compute.*;public class ComputeEngine extends UnicastRemoteObject                           implements Compute{    public ComputeEngine() throws RemoteException {        super();    }    public Object executeTask(Task t) {        return t.execute();    }    public static void main(String[] args) {        if (System.getSecurityManager() == null) {            System.setSecurityManager(new RMISecurityManager());        }        String name = "//host/Compute";        try {            Compute engine = new ComputeEngine();            Naming.rebind(name, engine);            System.out.println("ComputeEngine bound");        } catch (Exception e) {            System.err.println("ComputeEngine exception: " + e.getMessage());            e.printStackTrace();        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?