raccoon.api.eai
Interface IUtils

All Known Implementing Classes:
RvUtils

public interface IUtils

Contains various utility methods when handling EAI Objects.

Since:
Raccoon v1.0
Version:
$Id: IUtils.java,v 1.1 2004/08/08 20:25:56 crouvrais Exp $
Author:
Cedric ROUVRAIS

Method Summary
 java.lang.Class classFromNativeType(int pType)
          Retrieves the class corresponding to the given type.
 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.
 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.
 

Method Detail

nativeType

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

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

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

Parameters:
pObject - the class of the object to identify
Returns:
the value used by Raccoon to uniquely identify the type of object

classFromNativeType

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

Parameters:
pType - the type used by the messaging layer to uniquely identify the object.
Returns:
the class corresponding the

isNativelySupported

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

A natively supported object is refered to as:

Parameters:
pObject - that object instance for which the test is to be undertaken.
Returns:
true if the given class is supported by the transport layer.

isNativelySerializable

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

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

serializeObject

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

Parameters:
pJavaBean - the object that implements the serializable interface.
Returns:
the serialized object.
Throws:
java.io.IOException - if the serilization fails.

deserializeObject

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

Parameters:
pBytes - the serialized object
Returns:
the object that has been deserialized.
Throws:
java.io.IOException - if the deserialization fails (Class not found, ...).

isScalar

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

A scalar object is a java native object (Boolean, Date, String, ...)

Parameters:
pObject - the object to test.
Returns:
true if this is a scalar object

nativeNameForClass

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

Parameters:
pObject - the native class instance.
Returns:
the native name for this class.

nativeType

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

Parameters:
pTypeName - the type name of the object
Returns:
the native value used by the messaging layer to uniquely identify the type of object


Copyright null null. All Rights Reserved.