raccoon.tibco.tibrv.utils
Class RvUtils

java.lang.Object
  extended by raccoon.tibco.tibrv.utils.RvUtils
All Implemented Interfaces:
IUtils

public class RvUtils
extends java.lang.Object
implements IUtils

The implementation of the IUtils interface for TIB/Rendezvous

Since:
Raccoon v1.0
Version:
$Id:$
Author:
Cedric ROUVRAIS

Constructor Summary
RvUtils()
          Default constructor does nothing.
 
Method Summary
 java.lang.Class classFromNativeType(int pType)
          Retrieves the class corresponding to the given type.
static java.lang.String convertTibrvException(com.tibco.tibrv.TibrvException pTibrvException)
          Converts the TIB/Rendezvous exception into a normalized error string
 java.lang.Object deserializeObject(byte[] pBytes)
          Deserializes the contents of the given byte array.
 boolean isNativelySerializable(java.lang.Class pObject)
          Checks if the given class must be serialized for this transport layer.
 boolean isNativelySupported(java.lang.Class pObject)
          Checks if this class is natively supported.
 boolean isScalar(java.lang.Class pObject)
          Checks if this class is a scalar object.
static java.lang.String knownName(int pKnownType)
          Given the known type retruns the known name.
 java.lang.String nativeNameForClass(java.lang.Class pObject)
          Given a native class instance, determines the name.
 int nativeType(java.lang.Class pObject)
          Given the class of an object returns the type associated.
 int nativeType(java.lang.String pTypeName)
          Given the type name returns the type associated.
 int raccoonType(java.lang.Class pObject)
          Given the class of an object returns the type associated.
 byte[] serializeObject(java.lang.Object pJavaBean)
          Serializes the contents of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RvUtils

public RvUtils()
Default constructor does nothing.

Method Detail

knownName

public static java.lang.String knownName(int pKnownType)
Given the known type retruns the known name.

Parameters:
pKnownType - the known type, a value of KNOWN_TYPES
Returns:
the associated string representation.

nativeType

public int nativeType(java.lang.Class pObject)
Given the class of an object returns the type associated.

Specified by:
nativeType in interface IUtils
Parameters:
pObject - the class of the object to identify
Returns:
the native value used by the messaging layer to uniquely identify the type of object

raccoonType

public int raccoonType(java.lang.Class pObject)
Given the class of an object returns the type associated.

Specified by:
raccoonType in interface IUtils
Parameters:
pObject - the class of the object to identify
Returns:
the value used by Raccoon to uniquely identify the type of object

classFromNativeType

public java.lang.Class classFromNativeType(int pType)
Retrieves the class corresponding to the given type.

Specified by:
classFromNativeType in interface IUtils
Parameters:
pType - the type used by the messaging layer to uniquely identify the object.
Returns:
the class corresponding the

isNativelySupported

public boolean isNativelySupported(java.lang.Class pObject)
Checks if this class is natively supported.

Specified by:
isNativelySupported in interface IUtils
Parameters:
pObject - the object for which the native support is desired.
Returns:
true if the given class is supported by the transport layer.

isScalar

public boolean isScalar(java.lang.Class pObject)
Checks if this class is a scalar object.

A natively supported object is refered to as:

Specified by:
isScalar in interface IUtils
Parameters:
pObject - the object for which the native support is desired.
Returns:
true if the given class is supported by the transport layer.

isNativelySerializable

public boolean isNativelySerializable(java.lang.Class pObject)
Checks if the given class must be serialized for this transport layer.

Specified by:
isNativelySerializable in interface IUtils
Parameters:
pObject - the class
Returns:
true if the java serialization must be applied.
See Also:
serializeObject(java.lang.Object), deserializeObject(byte[])

serializeObject

public byte[] serializeObject(java.lang.Object pJavaBean)
                       throws java.io.IOException
Serializes the contents of the object.

Specified by:
serializeObject in interface IUtils
Parameters:
pJavaBean - the object that implements the serializable interface.
Returns:
the serialized object.
Throws:
java.io.IOException - if the serialization fails.

deserializeObject

public java.lang.Object deserializeObject(byte[] pBytes)
                                   throws java.io.IOException
Deserializes the contents of the given byte array.

Specified by:
deserializeObject in interface IUtils
Parameters:
pBytes - the serialized object
Returns:
the object that has been deserialized.
Throws:
java.io.IOException - if the deserialization fails.

nativeNameForClass

public java.lang.String nativeNameForClass(java.lang.Class pObject)
Given a native class instance, determines the name.

Specified by:
nativeNameForClass in interface IUtils
Parameters:
pObject - the native class instance.
Returns:
the native name for this class.

nativeType

public int nativeType(java.lang.String pTypeName)
Given the type name returns the type associated.

Specified by:
nativeType in interface IUtils
Parameters:
pTypeName - the type name of the object
Returns:
the native value used by the messaging layer to uniquely identify the type of object

convertTibrvException

public static java.lang.String convertTibrvException(com.tibco.tibrv.TibrvException pTibrvException)
Converts the TIB/Rendezvous exception into a normalized error string

Parameters:
pTibrvException - the exception that TIB/Rendezvous raised
Returns:
the normalized error string


Copyright null null. All Rights Reserved.