KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > presentation > rmi > DynamicMethodMarshaller


1 /*
2  * @(#)DynamicMethodMarshaller.java 1.10 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.presentation.rmi ;
9
10 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
11 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
12 import org.omg.CORBA.portable.ApplicationException JavaDoc ;
13
14 import java.lang.reflect.Method JavaDoc ;
15
16 import java.rmi.RemoteException JavaDoc ;
17
18 import com.sun.corba.se.spi.orb.ORB ;
19
20 /** Used to read and write arguments and results for a particular method.
21 *
22 */

23 public interface DynamicMethodMarshaller
24 {
25     /** Returns the method used to create this DynamicMethodMarshaller.
26      */

27     Method JavaDoc getMethod() ;
28
29     /** Copy the arguments as needed for this particular method.
30      * Can be optimized so that as little copying as possible is
31      * performed.
32      */

33     Object JavaDoc[] copyArguments( Object JavaDoc[] args, ORB orb ) throws RemoteException JavaDoc ;
34
35     /** Read the arguments for this method from the InputStream.
36      * Returns null if there are no arguments.
37      */

38     Object JavaDoc[] readArguments( InputStream JavaDoc is ) ;
39
40     /** Write arguments for this method to the OutputStream.
41      * Does nothing if there are no arguments.
42      */

43     void writeArguments( OutputStream JavaDoc os, Object JavaDoc[] args ) ;
44
45     /** Copy the result as needed for this particular method.
46      * Can be optimized so that as little copying as possible is
47      * performed.
48      */

49     Object JavaDoc copyResult( Object JavaDoc result, ORB orb ) throws RemoteException JavaDoc ;
50
51     /** Read the result from the InputStream. Returns null
52      * if the result type is null.
53      */

54     Object JavaDoc readResult( InputStream JavaDoc is ) ;
55
56     /** Write the result to the OutputStream. Does nothing if
57      * the result type is null.
58      */

59     void writeResult( OutputStream JavaDoc os, Object JavaDoc result ) ;
60
61     /** Returns true iff thr's class is a declared exception (or a subclass of
62      * a declared exception) for this DynamicMethodMarshaller's method.
63      */

64     boolean isDeclaredException( Throwable JavaDoc thr ) ;
65
66     /** Write the repository ID of the exception and the value of the
67      * exception to the OutputStream. ex should be a declared exception
68      * for this DynamicMethodMarshaller's method.
69      */

70     void writeException( OutputStream JavaDoc os, Exception JavaDoc ex ) ;
71
72     /** Reads an exception ID and the corresponding exception from
73      * the input stream. This should be an exception declared in
74      * this method.
75      */

76     Exception JavaDoc readException( ApplicationException JavaDoc ae ) ;
77 }
78
Popular Tags