• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RMIIncomingThread类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中gnu.java.rmi.server.RMIIncomingThread的典型用法代码示例。如果您正苦于以下问题:Java RMIIncomingThread类的具体用法?Java RMIIncomingThread怎么用?Java RMIIncomingThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RMIIncomingThread类属于gnu.java.rmi.server包,在下文中一共展示了RMIIncomingThread类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getClientHost

点赞 2

import gnu.java.rmi.server.RMIIncomingThread; //导入依赖的package包/类
/**
 * Get the host of the calling client. The current thread must be an instance
 * of the {@link RMIIncomingThread}.
 *
 * @return the client host address
 *
 * @throws ServerNotActiveException if the current thread is not an instance
 * of the RMIIncomingThread.
 */
public static String getClientHost() throws ServerNotActiveException
{
  Thread currThread = Thread.currentThread();
  if (currThread instanceof RMIIncomingThread)
    {
      RMIIncomingThread incomingThread = (RMIIncomingThread) currThread;
      return incomingThread.getClientHost();
    }
  else
    {
      throw new ServerNotActiveException(
        "Unknown client host - current thread not instance of 'RMIIncomingThread'");
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:24,
代码来源:RemoteServer.java

示例2: getClientHost

点赞 2

import gnu.java.rmi.server.RMIIncomingThread; //导入依赖的package包/类
/**
 * Get the host of the calling client. The current thread must be an instance
 * of the {@link RMIIncomingThread}.
 * 
 * @return the client host address
 * 
 * @throws ServerNotActiveException if the current thread is not an instance
 * of the RMIIncomingThread.
 */
public static String getClientHost() throws ServerNotActiveException
{
  Thread currThread = Thread.currentThread();
  if (currThread instanceof RMIIncomingThread)
    {
      RMIIncomingThread incomingThread = (RMIIncomingThread) currThread;
      return incomingThread.getClientHost();
    }
  else
    {
      throw new ServerNotActiveException(
        "Unknown client host - current thread not instance of 'RMIIncomingThread'");
    }
}
 

开发者ID:nmldiegues,
项目名称:jvm-stm,
代码行数:24,
代码来源:RemoteServer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)