Class DynamicMethodMarshallerImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl
-
- All Implemented Interfaces:
DynamicMethodMarshaller
public class DynamicMethodMarshallerImpl extends java.lang.Object implements DynamicMethodMarshaller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DynamicMethodMarshallerImpl.ReaderWriter
(package private) static class
DynamicMethodMarshallerImpl.ReaderWriterBase
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DynamicMethodMarshallerImpl(java.lang.reflect.Method method)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
allMethodsThrowRemoteException(java.lang.Class cls)
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.private static boolean
isAbstractInterface(java.lang.Class cls)
private static boolean
isAnyClass(java.lang.Class cls)
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.static DynamicMethodMarshallerImpl.ReaderWriter
makeReaderWriter(java.lang.Class cls)
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.private static boolean
throwsRemote(java.lang.reflect.Method method)
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.
-
-
-
Field Detail
-
method
private java.lang.reflect.Method method
-
ehandler
private ExceptionHandler ehandler
-
hasArguments
private boolean hasArguments
-
hasVoidResult
private boolean hasVoidResult
-
needsArgumentCopy
private boolean needsArgumentCopy
-
needsResultCopy
private boolean needsResultCopy
-
argRWs
private DynamicMethodMarshallerImpl.ReaderWriter[] argRWs
-
resultRW
private DynamicMethodMarshallerImpl.ReaderWriter resultRW
-
wrapper
private static final ORBUtilSystemException wrapper
-
booleanRW
private static DynamicMethodMarshallerImpl.ReaderWriter booleanRW
-
byteRW
private static DynamicMethodMarshallerImpl.ReaderWriter byteRW
-
charRW
private static DynamicMethodMarshallerImpl.ReaderWriter charRW
-
shortRW
private static DynamicMethodMarshallerImpl.ReaderWriter shortRW
-
intRW
private static DynamicMethodMarshallerImpl.ReaderWriter intRW
-
longRW
private static DynamicMethodMarshallerImpl.ReaderWriter longRW
-
floatRW
private static DynamicMethodMarshallerImpl.ReaderWriter floatRW
-
doubleRW
private static DynamicMethodMarshallerImpl.ReaderWriter doubleRW
-
corbaObjectRW
private static DynamicMethodMarshallerImpl.ReaderWriter corbaObjectRW
-
anyRW
private static DynamicMethodMarshallerImpl.ReaderWriter anyRW
-
abstractInterfaceRW
private static DynamicMethodMarshallerImpl.ReaderWriter abstractInterfaceRW
-
-
Method Detail
-
isAnyClass
private static boolean isAnyClass(java.lang.Class cls)
-
isAbstractInterface
private static boolean isAbstractInterface(java.lang.Class cls)
-
allMethodsThrowRemoteException
private static boolean allMethodsThrowRemoteException(java.lang.Class cls)
-
throwsRemote
private static boolean throwsRemote(java.lang.reflect.Method method)
-
makeReaderWriter
public static DynamicMethodMarshallerImpl.ReaderWriter makeReaderWriter(java.lang.Class cls)
-
getMethod
public java.lang.reflect.Method getMethod()
Description copied from interface:DynamicMethodMarshaller
Returns the method used to create this DynamicMethodMarshaller.- Specified by:
getMethod
in interfaceDynamicMethodMarshaller
- Returns:
- the method used
-
copyArguments
public java.lang.Object[] copyArguments(java.lang.Object[] args, ORB orb) throws java.rmi.RemoteException
Description copied from interface:DynamicMethodMarshaller
Copy the arguments as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Specified by:
copyArguments
in interfaceDynamicMethodMarshaller
- 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
public java.lang.Object[] readArguments(InputStream is)
Description copied from interface:DynamicMethodMarshaller
Read the arguments for this method from the InputStream. Returns null if there are no arguments.- Specified by:
readArguments
in interfaceDynamicMethodMarshaller
- Parameters:
is
- stream to read arguments from- Returns:
- array of arguments
-
writeArguments
public void writeArguments(OutputStream os, java.lang.Object[] args)
Description copied from interface:DynamicMethodMarshaller
Write arguments for this method to the OutputStream. Does nothing if there are no arguments.- Specified by:
writeArguments
in interfaceDynamicMethodMarshaller
- Parameters:
os
- stream to write toargs
- arguments to write
-
copyResult
public java.lang.Object copyResult(java.lang.Object result, ORB orb) throws java.rmi.RemoteException
Description copied from interface:DynamicMethodMarshaller
Copy the result as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Specified by:
copyResult
in interfaceDynamicMethodMarshaller
- 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
public java.lang.Object readResult(InputStream is)
Description copied from interface:DynamicMethodMarshaller
Read the result from the InputStream. Returns null if the result type is null.- Specified by:
readResult
in interfaceDynamicMethodMarshaller
- Parameters:
is
- stream to read from- Returns:
- result
-
writeResult
public void writeResult(OutputStream os, java.lang.Object result)
Description copied from interface:DynamicMethodMarshaller
Write the result to the OutputStream. Does nothing if the result type is null.- Specified by:
writeResult
in interfaceDynamicMethodMarshaller
- Parameters:
os
- stream to write toresult
- result to write to stream
-
isDeclaredException
public boolean isDeclaredException(java.lang.Throwable thr)
Description copied from interface:DynamicMethodMarshaller
Returns true iff thr's class is a declared exception (or a subclass of a declared exception) for this DynamicMethodMarshaller's method.- Specified by:
isDeclaredException
in interfaceDynamicMethodMarshaller
- Parameters:
thr
- throwable to checl- Returns:
- if it is a declared (non-runtime) exception
-
writeException
public void writeException(OutputStream os, java.lang.Exception ex)
Description copied from interface:DynamicMethodMarshaller
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.- Specified by:
writeException
in interfaceDynamicMethodMarshaller
- Parameters:
os
- stream to write toex
- exception to write
-
readException
public java.lang.Exception readException(ApplicationException ae)
Description copied from interface:DynamicMethodMarshaller
Reads an exception ID and the corresponding exception from the input stream. This should be an exception declared in this method.- Specified by:
readException
in interfaceDynamicMethodMarshaller
- Parameters:
ae
- id of exception to read- Returns:
- read exception
-
-