reentrantthreadhandler.java

来自「SRI international 发布的OAA框架软件」· Java 代码 · 共 57 行

JAVA
57
字号
/* $Id: ReentrantThreadHandler.java,v 1.1 2003/09/27 03:01:10 giuli Exp $*/
/**************************************************************************
 * Copyright 2002, 2003 SRI International. All rights reserved.
 *
 * The material contained in this file is confidential and proprietary to SRI
 * International and may not be reproduced, published, or disclosed to others
 * without authorization from SRI International.
 *
 * DISCLAIMER OF WARRANTIES
 *
 * SRI International MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
 * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SRI International SHALL NOT BE
 * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
 * OR DISTRIBUTING THIS SOFTWARE
 **************************************************************************/
package com.sri.sedc.javanetbridge;

/**
 * ReentrantThreadHandler executes methods serially as they are received from
 * a remote thread. When a remote thread is executing methods through the
 * proxy, methods are gauranteed to be executed asynchronusly for the remote
 * thread. Multiple remote threads execute asynchronously, and there is a 1:1
 * correspondence between an instance of ReentrantThreadHandler and a remote
 * thread.
 */
public interface ReentrantThreadHandler {
    /**
     * Adds a method call to the queue.
     *
     * @param methodId the id of the method to call
     * @param args the arguments for the method
     * @throws InterruptedException if the current thread is interrupted
     *  while queueing the method call request
     */
    void queueMethodCall(int methodId, Object[] args) throws InterruptedException;

    /**
     * Retrieves the remote server id of the ReentrantThreadHandler.
     *
     * @return the id for the server which this thread mirrors.
     */
    int getRemoteServerId();

    /**
     * Starts the thread handler.
     */
    void start();

    /**
     * Stops the thread handler. Once the thread is stopped, it cannot be
     * restarted.
     */
    void stop();
}

⌨️ 快捷键说明

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