helloworldimpl.java

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

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

import java.rmi.RemoteException;
import java.rmi.server.RemoteServer;

import masteringrmi.hellosocket.interfaces.HelloWorld;
import masteringrmi.hellosocket.interfaces.IdentitySocket;

/**
 *   This is a remote object that implements the remote interface.
 *
 *   It extends RemoteServer, and must thus be exported by the manager
 *      
 *   @see HelloWorld
 *   @author Rickard 謆erg
 *   @version $Revision:$
 */
public class HelloWorldImpl
   extends RemoteServer
   implements HelloWorld
{
   // Constructors --------------------------------------------------
   
   // Public --------------------------------------------------------

   // HelloWorld implementation -------------------------------------
   /**
    *   Create a greeting.
    *
    * @param   name  a name
    * @return     a name including the name
    */
   public String helloWorld()
   {
      // Get the name of the client and include it in the greeting
      return "Hello " + IdentitySocket.getClient() +"!";
   }
}

⌨️ 快捷键说明

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