org.openorb.orb.rmi
Class RMIObjectStreamClass

java.lang.Object
  |
  +--org.openorb.orb.rmi.RMIObjectStreamClass

public final class RMIObjectStreamClass
extends java.lang.Object

This is a default implementation for a Remote interface

Author:
Jerome Daniel, Michael Rumpf

Method Summary
 java.lang.Class forClass()
          Return the class in the local VM that this version is mapped to.
 RMIObjectStreamClass[] getAllStreamClasses()
          Return the stream classes for the parent classes.
 java.lang.Class getBaseClass()
          Return base class.
 java.lang.String getName()
          The name of the class described by this descriptor.
 java.io.ObjectStreamClass getObjectStreamClass()
          Return the object stream class.
 java.io.ObjectStreamField[] getObjectStreamFields()
          Return an array of the fields of this serializable class.
 java.lang.String getRepoID()
          Return repository ID string.
 long getRepoIDHash()
          Returns the hashed repository ID value, as specified in the corba spec 10.6.2.
 long getSerialVersionUID()
          Return the serialVersionUID for this class.
 boolean hasReadObject()
          True if the target has the writeObject method.
 boolean hasWriteObject()
          True if the target has the writeObject method.
 boolean isCustomMarshaled()
          True if the class is custom marshaled.
 boolean isExternalizable()
          True if the class is externalizable.
 boolean isIDLEntity()
          True if the class is a boxed IDL entity.
static RMIObjectStreamClass lookup(java.lang.Class clz)
          Try to get the corresponding RMIObjectStreamClass from an internal hash map.
static org.omg.CORBA.TypeCode lookupTypeCode(java.lang.Class clz)
          Create typecode from runtime class.
 java.lang.String toString()
          Return a string describing this ObjectStreamClass.
 org.omg.CORBA.TypeCode type()
          Return the typecode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

lookup

public static RMIObjectStreamClass lookup(java.lang.Class clz)
                                   throws java.io.InvalidClassException
Try to get the corresponding RMIObjectStreamClass from an internal hash map. This method also checks whether the class is serializable at all. This check fails if the class is not derived from Serializable or if it's on of the following types: org.omg.CORBA.Object, org.omg.CORBA.portable.ValueBase, or java.rmi.Remote.
Parameters:
clz - The class for which to get the corresponding RMIObjectStreamClass for.
Returns:
The RMIObjectStreamClass from the internal hash map if an entry was found or a new instance.
Throws:
java.io.InvalidClassException - When the class is neither assignable from java.io.Serializable or org.omg.CORBA.portable.ValueBase.

lookupTypeCode

public static org.omg.CORBA.TypeCode lookupTypeCode(java.lang.Class clz)
                                             throws java.io.InvalidClassException
Create typecode from runtime class. This will only successfully return typecodes for types which can be marshalled.
Parameters:
clz - The class for which to get the type code.
Returns:
the target object's typecode, or null if the target object is not serializable.
Throws:
java.io.InvalidClassException - When the method type() could not be invoked on the helper class of clz.

getRepoIDHash

public long getRepoIDHash()
Returns the hashed repository ID value, as specified in the corba spec 10.6.2.
Returns:
The repository ID hash value.

getRepoID

public java.lang.String getRepoID()
Return repository ID string.
Returns:
The repository ID.

getBaseClass

public java.lang.Class getBaseClass()
Return base class.
Returns:
The base class.

isCustomMarshaled

public boolean isCustomMarshaled()
True if the class is custom marshaled.
Returns:
True is the class is custom marshaled, false otherwise.

isExternalizable

public boolean isExternalizable()
True if the class is externalizable.
Returns:
True is the class is externalizable, false otherwise.

hasWriteObject

public boolean hasWriteObject()
True if the target has the writeObject method.
Returns:
True is the target has a writeObject() method, false otherwise.

hasReadObject

public boolean hasReadObject()
True if the target has the writeObject method.
Returns:
True is the target has a readObject() method, false otherwise.

isIDLEntity

public boolean isIDLEntity()
True if the class is a boxed IDL entity.
Returns:
True is the class is a boxed IDL entity, false otherwise.

getAllStreamClasses

public RMIObjectStreamClass[] getAllStreamClasses()
Return the stream classes for the parent classes. For externalizable and IDLEntities this will return null.
Returns:
An array of the stream classes of all parents.

forClass

public java.lang.Class forClass()
Return the class in the local VM that this version is mapped to. Null is returned if there is no corresponding local class.
Returns:
the Class instance that this descriptor represents

getName

public java.lang.String getName()
The name of the class described by this descriptor.
Returns:
a String representing the fully qualified name of the class

getSerialVersionUID

public long getSerialVersionUID()
Return the serialVersionUID for this class. The serialVersionUID defines a set of classes all with the same name that have evolved from a common root class and agree to be serialized and deserialized using a common format. NonSerializable classes have a serialVersionUID of 0L.
Returns:
the SUID of the class described by this descriptor

toString

public java.lang.String toString()
Return a string describing this ObjectStreamClass.
Overrides:
toString in class java.lang.Object
Returns:
A description of this instance.

type

public org.omg.CORBA.TypeCode type()
Return the typecode.
Returns:
The type code of this instance.

getObjectStreamClass

public java.io.ObjectStreamClass getObjectStreamClass()
Return the object stream class.
Returns:
the object stream class of this instance.

getObjectStreamFields

public java.io.ObjectStreamField[] getObjectStreamFields()
Return an array of the fields of this serializable class. returns the serialized fields for this class.