Interface DynamicMethodMarshaller
-
- All Known Implementing Classes:
DynamicMethodMarshallerImpl
public interface DynamicMethodMarshaller
Used to read and write arguments and results for a particular method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object[]
copyArguments(java.lang.Object[] args, ORB orb)
Copy the arguments as needed for this particular method.java.lang.Object
copyResult(java.lang.Object result, ORB orb)
Copy the result as needed for this particular method.java.lang.reflect.Method
getMethod()
Returns the method used to create this DynamicMethodMarshaller.boolean
isDeclaredException(java.lang.Throwable thr)
Returns true iff thr's class is a declared exception (or a subclass of a declared exception) for this DynamicMethodMarshaller's method.java.lang.Object[]
readArguments(InputStream is)
Read the arguments for this method from the InputStream.java.lang.Exception
readException(ApplicationException ae)
Reads an exception ID and the corresponding exception from the input stream.java.lang.Object
readResult(InputStream is)
Read the result from the InputStream.void
writeArguments(OutputStream os, java.lang.Object[] args)
Write arguments for this method to the OutputStream.void
writeException(OutputStream os, java.lang.Exception ex)
Write the repository ID of the exception and the value of the exception to the OutputStream.void
writeResult(OutputStream os, java.lang.Object result)
Write the result to the OutputStream.
-
-
-
Method Detail
-
getMethod
java.lang.reflect.Method getMethod()
Returns the method used to create this DynamicMethodMarshaller.- Returns:
- the method used
-
copyArguments
java.lang.Object[] copyArguments(java.lang.Object[] args, ORB orb) throws java.rmi.RemoteException
Copy the arguments as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Parameters:
args
- arguments to copyorb
- ORB to use- Returns:
- a copy of the arguments
- Throws:
java.rmi.RemoteException
- if there is a remote error
-
readArguments
java.lang.Object[] readArguments(InputStream is)
Read the arguments for this method from the InputStream. Returns null if there are no arguments.- Parameters:
is
- stream to read arguments from- Returns:
- array of arguments
-
writeArguments
void writeArguments(OutputStream os, java.lang.Object[] args)
Write arguments for this method to the OutputStream. Does nothing if there are no arguments.- Parameters:
os
- stream to write toargs
- arguments to write
-
copyResult
java.lang.Object copyResult(java.lang.Object result, ORB orb) throws java.rmi.RemoteException
Copy the result as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Parameters:
result
- Object to copyorb
- ORB to use for copying- Returns:
- copied object
- Throws:
java.rmi.RemoteException
- if there is an error with the ORB
-
readResult
java.lang.Object readResult(InputStream is)
Read the result from the InputStream. Returns null if the result type is null.- Parameters:
is
- stream to read from- Returns:
- result
-
writeResult
void writeResult(OutputStream os, java.lang.Object result)
Write the result to the OutputStream. Does nothing if the result type is null.- Parameters:
os
- stream to write toresult
- result to write to stream
-
isDeclaredException
boolean isDeclaredException(java.lang.Throwable thr)
Returns true iff thr's class is a declared exception (or a subclass of a declared exception) for this DynamicMethodMarshaller's method.- Parameters:
thr
- throwable to checl- Returns:
- if it is a declared (non-runtime) exception
-
writeException
void writeException(OutputStream os, java.lang.Exception ex)
Write the repository ID of the exception and the value of the exception to the OutputStream. ex should be a declared exception for this DynamicMethodMarshaller's method.- Parameters:
os
- stream to write toex
- exception to write
-
readException
java.lang.Exception readException(ApplicationException ae)
Reads an exception ID and the corresponding exception from the input stream. This should be an exception declared in this method.- Parameters:
ae
- id of exception to read- Returns:
- read exception
-
-