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 interfaceDynamicMethodMarshallerImpl.ReaderWriter(package private) static classDynamicMethodMarshallerImpl.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 booleanallMethodsThrowRemoteException(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.ObjectcopyResult(java.lang.Object result, ORB orb)Copy the result as needed for this particular method.java.lang.reflect.MethodgetMethod()Returns the method used to create this DynamicMethodMarshaller.private static booleanisAbstractInterface(java.lang.Class cls)private static booleanisAnyClass(java.lang.Class cls)booleanisDeclaredException(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.ReaderWritermakeReaderWriter(java.lang.Class cls)java.lang.Object[]readArguments(InputStream is)Read the arguments for this method from the InputStream.java.lang.ExceptionreadException(ApplicationException ae)Reads an exception ID and the corresponding exception from the input stream.java.lang.ObjectreadResult(InputStream is)Read the result from the InputStream.private static booleanthrowsRemote(java.lang.reflect.Method method)voidwriteArguments(OutputStream os, java.lang.Object[] args)Write arguments for this method to the OutputStream.voidwriteException(OutputStream os, java.lang.Exception ex)Write the repository ID of the exception and the value of the exception to the OutputStream.voidwriteResult(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:DynamicMethodMarshallerReturns the method used to create this DynamicMethodMarshaller.- Specified by:
getMethodin interfaceDynamicMethodMarshaller- Returns:
- the method used
-
copyArguments
public java.lang.Object[] copyArguments(java.lang.Object[] args, ORB orb) throws java.rmi.RemoteExceptionDescription copied from interface:DynamicMethodMarshallerCopy the arguments as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Specified by:
copyArgumentsin 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:DynamicMethodMarshallerRead the arguments for this method from the InputStream. Returns null if there are no arguments.- Specified by:
readArgumentsin 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:DynamicMethodMarshallerWrite arguments for this method to the OutputStream. Does nothing if there are no arguments.- Specified by:
writeArgumentsin 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.RemoteExceptionDescription copied from interface:DynamicMethodMarshallerCopy the result as needed for this particular method. Can be optimized so that as little copying as possible is performed.- Specified by:
copyResultin 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:DynamicMethodMarshallerRead the result from the InputStream. Returns null if the result type is null.- Specified by:
readResultin interfaceDynamicMethodMarshaller- Parameters:
is- stream to read from- Returns:
- result
-
writeResult
public void writeResult(OutputStream os, java.lang.Object result)
Description copied from interface:DynamicMethodMarshallerWrite the result to the OutputStream. Does nothing if the result type is null.- Specified by:
writeResultin interfaceDynamicMethodMarshaller- Parameters:
os- stream to write toresult- result to write to stream
-
isDeclaredException
public boolean isDeclaredException(java.lang.Throwable thr)
Description copied from interface:DynamicMethodMarshallerReturns true iff thr's class is a declared exception (or a subclass of a declared exception) for this DynamicMethodMarshaller's method.- Specified by:
isDeclaredExceptionin 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:DynamicMethodMarshallerWrite 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:
writeExceptionin interfaceDynamicMethodMarshaller- Parameters:
os- stream to write toex- exception to write
-
readException
public java.lang.Exception readException(ApplicationException ae)
Description copied from interface:DynamicMethodMarshallerReads an exception ID and the corresponding exception from the input stream. This should be an exception declared in this method.- Specified by:
readExceptionin interfaceDynamicMethodMarshaller- Parameters:
ae- id of exception to read- Returns:
- read exception
-
-