?? helloworldimpl.java
字號:
/*
* Copyright 1999 by dreamBean Software,
* All rights reserved.
*/
package masteringrmi.helloworld.server;
import java.rmi.RemoteException;
import java.rmi.server.RemoteServer;
import java.rmi.server.UnicastRemoteObject;
import masteringrmi.helloworld.interfaces.HelloWorld;
/**
* This class implements the HelloWorld interface, and makes it possible to use
* as a remote object by explicitly exporting it on creation.
*
* @see HelloWorld
* @author Rickard 謆erg (rickard@dreambean.com)
*/
public class HelloWorldImpl
extends RemoteServer
implements HelloWorld
{
// Constructors --------------------------------------------------
public HelloWorldImpl()
throws RemoteException
{
UnicastRemoteObject.exportObject(this, 1234);
}
// HelloWorld implementation -------------------------------------
/**
* Create a greeting, including the name that is given
*
* @param name a name
* @return a greeting
*/
public String helloWorld(String name)
{
return "Hello " + name +"!";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -