org.objectweb.jonas.common
Class JNDIUtils

java.lang.Object
  extended by org.objectweb.jonas.common.JNDIUtils

public class JNDIUtils
extends java.lang.Object

JNDIUtils groups all commonly used methods for JNDI.

Author:
Guillaume Sauthier

Method Summary
static byte[] getBytesFromObject(java.lang.Object obj)
          Return an array of byte from a given object
static byte[] getBytesFromObject(java.lang.Object obj, org.objectweb.util.monolog.api.Logger logger)
          Return an array of byte from a given object
static java.lang.Object getObjectFromBytes(byte[] bytes)
          Return an object from an array of bytes.
static java.lang.Object getObjectFromBytes(byte[] bytes, org.objectweb.util.monolog.api.Logger logger)
          Return an object from an array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytesFromObject

public static byte[] getBytesFromObject(java.lang.Object obj)
Return an array of byte from a given object

Parameters:
obj - the object from which we must extract the bytes.
Returns:
the byte[] from an object

getBytesFromObject

public static byte[] getBytesFromObject(java.lang.Object obj,
                                        org.objectweb.util.monolog.api.Logger logger)
Return an array of byte from a given object

Parameters:
obj - the object from which we must extract the bytes.
logger - logger to log exceptions
Returns:
the byte[] from an object

getObjectFromBytes

public static java.lang.Object getObjectFromBytes(byte[] bytes)
Return an object from an array of bytes. Useful for BinaryRefAddr Useful for BinaryRefAddr

Parameters:
bytes - an array of bytes
Returns:
an object or null if there is an error of if it's empty

getObjectFromBytes

public static java.lang.Object getObjectFromBytes(byte[] bytes,
                                                  org.objectweb.util.monolog.api.Logger logger)
Return an object from an array of bytes. Useful for BinaryRefAddr Useful for BinaryRefAddr

Parameters:
bytes - an array of bytes
logger - logger to log exceptions
Returns:
an object or null if there is an error of if it's empty