⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloworldimpl.java

📁 《精通RMI:Java与EJB企业级应用开发》书籍的源代码. 本书是讲述RMI技术的经典著作
💻 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 + -