Fields Summary |
---|
Method | method |
ExceptionHandler | ehandler |
boolean | hasArguments |
boolean | hasVoidResult |
boolean | needsArgumentCopy |
boolean | needsResultCopy |
ReaderWriter[] | argRWs |
ReaderWriter | resultRW |
private static ReaderWriter | booleanRW |
private static ReaderWriter | byteRW |
private static ReaderWriter | charRW |
private static ReaderWriter | shortRW |
private static ReaderWriter | intRW |
private static ReaderWriter | longRW |
private static ReaderWriter | floatRW |
private static ReaderWriter | doubleRW |
private static ReaderWriter | corbaObjectRW |
private static ReaderWriter | anyRW |
private static ReaderWriter | abstractInterfaceRW |
Methods Summary |
---|
private static boolean | allMethodsThrowRemoteException(java.lang.Class cls)
Method[] methods = cls.getMethods() ;
// Check that all methods (other than those declared in java.lang.Object)
// throw an exception that is a subclass of RemoteException.
for (int ctr=0; ctr<methods.length; ctr++) {
Method method = methods[ctr] ;
if (method.getDeclaringClass() != Object.class)
if (!throwsRemote( method ))
return false ;
}
return true ;
|
public java.lang.Object[] | copyArguments(java.lang.Object[] args, com.sun.corba.se.spi.orb.ORB orb)
if (needsArgumentCopy)
return Util.copyObjects( args, orb ) ;
else
return args ;
|
public java.lang.Object | copyResult(java.lang.Object result, com.sun.corba.se.spi.orb.ORB orb)
if (needsResultCopy)
return Util.copyObject( result, orb ) ;
else
return result ;
|
public java.lang.reflect.Method | getMethod()
return method ;
|
private static boolean | isAbstractInterface(java.lang.Class cls)
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
|
private static boolean | isAnyClass(java.lang.Class cls)
return cls.equals( Object.class ) || cls.equals( Serializable.class ) ||
cls.equals( Externalizable.class ) ;
|
public boolean | isDeclaredException(java.lang.Throwable thr)
return ehandler.isDeclaredException( thr.getClass() ) ;
|
public static com.sun.corba.se.impl.presentation.rmi.DynamicMethodMarshallerImpl$ReaderWriter | makeReaderWriter(java.lang.Class cls)
if (cls.equals( boolean.class ))
return booleanRW ;
else if (cls.equals( byte.class ))
return byteRW ;
else if (cls.equals( char.class ))
return charRW ;
else if (cls.equals( short.class ))
return shortRW ;
else if (cls.equals( int.class ))
return intRW ;
else if (cls.equals( long.class ))
return longRW ;
else if (cls.equals( float.class ))
return floatRW ;
else if (cls.equals( double.class ))
return doubleRW ;
else if (java.rmi.Remote.class.isAssignableFrom( cls ))
return new ReaderWriterBase( "remote(" + cls.getName() + ")" )
{
public Object read( InputStream is )
{
return PortableRemoteObject.narrow( is.read_Object(),
cls ) ;
}
public void write( OutputStream os, Object value )
{
Util.writeRemoteObject( os, value ) ;
}
} ;
else if (cls.equals(org.omg.CORBA.Object.class))
return corbaObjectRW ;
else if (org.omg.CORBA.Object.class.isAssignableFrom( cls ))
return new ReaderWriterBase( "org.omg.CORBA.Object(" +
cls.getName() + ")" )
{
public Object read( InputStream is )
{
return is.read_Object(cls) ;
}
public void write( OutputStream os, Object value )
{
os.write_Object( (org.omg.CORBA.Object)value ) ;
}
} ;
else if (isAnyClass(cls))
return anyRW ;
else if (isAbstractInterface(cls))
return abstractInterfaceRW ;
// For anything else, just read it as a value type.
return new ReaderWriterBase( "value(" + cls.getName() + ")" )
{
public Object read( InputStream is )
{
return is.read_value(cls) ;
}
public void write( OutputStream os, Object value )
{
os.write_value( (Serializable)value, cls ) ;
}
} ;
|
public java.lang.Object[] | readArguments(org.omg.CORBA_2_3.portable.InputStream is)
Object[] result = null ;
if (hasArguments) {
result = new Object[ argRWs.length ] ;
for (int ctr=0; ctr<argRWs.length; ctr++ )
result[ctr] = argRWs[ctr].read( is ) ;
}
return result ;
|
public java.lang.Exception | readException(org.omg.CORBA.portable.ApplicationException ae)
return ehandler.readException( ae ) ;
|
public java.lang.Object | readResult(org.omg.CORBA_2_3.portable.InputStream is)
if (hasVoidResult)
return null ;
else
return resultRW.read( is ) ;
|
private static boolean | throwsRemote(java.lang.reflect.Method method)
Class[] exceptionTypes = method.getExceptionTypes() ;
// Check that some exceptionType is a subclass of RemoteException
for (int ctr=0; ctr<exceptionTypes.length; ctr++) {
Class exceptionType = exceptionTypes[ctr] ;
if (java.rmi.RemoteException.class.isAssignableFrom( exceptionType ))
return true ;
}
return false ;
|
public void | writeArguments(org.omg.CORBA_2_3.portable.OutputStream os, java.lang.Object[] args)
if (hasArguments) {
if (args.length != argRWs.length)
throw new IllegalArgumentException( "Expected " + argRWs.length +
" arguments, but got " + args.length + " arguments." ) ;
for (int ctr=0; ctr<argRWs.length; ctr++ )
argRWs[ctr].write( os, args[ctr] ) ;
}
|
public void | writeException(org.omg.CORBA_2_3.portable.OutputStream os, java.lang.Exception ex)
ehandler.writeException( os, ex ) ;
|
public void | writeResult(org.omg.CORBA_2_3.portable.OutputStream os, java.lang.Object result)
if (!hasVoidResult)
resultRW.write( os, result ) ;
|