home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / RemoteCall.java < prev    next >
Text File  |  1997-05-20  |  3KB  |  96 lines

  1. /*
  2.  * @(#)RemoteCall.java    1.6 97/02/11
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21.  
  22. package java.rmi.server;
  23. import java.rmi.*;
  24. import java.io.ObjectOutput;
  25. import java.io.ObjectInput;
  26. import java.io.StreamCorruptedException;
  27. import java.io.IOException;
  28.  
  29. /**
  30.  * RemoteCall is an abstraction used solely by the implementation
  31.  * (stubs and skeletons of remote objects) to carry out a call to a
  32.  * remote object.
  33.  */
  34. public interface RemoteCall {
  35.  
  36.     /**
  37.      * Return the output stream the stub/skeleton should put arguments/results
  38.      * into.
  39.      *
  40.      * @exception java.io.IOException if an I/O error occurs.
  41.      */
  42.     ObjectOutput getOutputStream()  throws IOException;
  43.     
  44.     /**
  45.      * Release the output stream; in some transports this would release
  46.      * the stream.
  47.      *
  48.      * @exception java.io.IOException if an I/O error occurs.
  49.      */
  50.     void releaseOutputStream()  throws IOException;
  51.  
  52.     /**
  53.      * Get the InputStream that the stub/skeleton should get
  54.      * results/arguments from.
  55.      *
  56.      * @exception java.io.IOException if an I/O error occurs.
  57.      */
  58.     ObjectInput getInputStream()  throws IOException;
  59.  
  60.     
  61.     /**
  62.      * Release the input stream. This would allow some transports to release
  63.      * the channel early.
  64.      *
  65.      * @exception java.io.IOException if an I/O error occurs.
  66.      */
  67.     void releaseInputStream() throws IOException;
  68.  
  69.     /**
  70.      * Returns an output stream (may put out header information
  71.      * relating to the success of the call). Should only succeed
  72.      * once per remote call.
  73.      *
  74.      * @param success If true, indicates normal return, else indicates
  75.      * exceptional return.
  76.      * @exception java.io.IOException              if an I/O error occurs.
  77.      * @exception java.io.StreamCorruptedException If already been called.
  78.      */
  79.     ObjectOutput getResultStream(boolean success) throws IOException,
  80.     StreamCorruptedException;
  81.     
  82.     /**
  83.      * Do whatever it takes to execute the call.
  84.      *
  85.      * @exception java.lang.Exception if a general exception occurs.
  86.      */
  87.     void executeCall() throws Exception;
  88.  
  89.     /**
  90.      * Allow cleanup after the remote call has completed.
  91.      *
  92.      * @exception java.io.IOException if an I/O error occurs.
  93.      */
  94.     void done() throws IOException;
  95. }
  96.