helloworldimpl.java

来自「最新的关于精通rmi这本书的源码」· Java 代码 · 共 54 行

JAVA
54
字号
/*
 * Copyright 1999 by dreamBean Software,
 * All rights reserved.
 */
package masteringrmi.helloapplet.server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import masteringrmi.helloapplet.interfaces.HelloWorld;

/**
 *   This is a remote object that implements the remote interface.
 *
 *   It extends UnicastRemoteObject, and is thus automatically 
 *   exported on creation.
 *   
 *      
 *   @see HelloWorld
 *   @author Rickard 謆erg
 *   @version $Revision:$
 */
public class HelloWorldImpl
   extends UnicastRemoteObject
   implements HelloWorld
{
   // Constructors --------------------------------------------------
   /**
    *   Create a remote object of this class. The default constructor
    *   of UnicastRemoteObject is automatically called, which causes
    *   this object to be exported on a default port.
    *
    * @exception   RemoteException  thrown if export failed
    */
   public HelloWorldImpl()
      throws RemoteException
   {
   }
   
   // Public --------------------------------------------------------

   // HelloWorld implementation -------------------------------------
   /**
    *   Create a greeting.
    *
    * @param   name  a name
    * @return     a name including the name
    */
   public String helloWorld(String name)
   {
      return "Hello " + name +"!";
   }
}

⌨️ 快捷键说明

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