org.jboss.remoting.loading
Class ClassUtil

java.lang.Object
  extended byorg.jboss.remoting.loading.ClassUtil

public class ClassUtil
extends Object

ClassUtil is a set of generic class utlities.

Version:
$Revision: 1.3 $
Author:
Jeff Haynie, Tom Elrod

Field Summary
protected static org.jboss.logging.Logger log
           
 
Constructor Summary
ClassUtil()
           
 
Method Summary
static Object deserialize(byte[] buf)
           
static Object deserialize(byte[] buf, ClassLoader cl)
           
static Object deserialize(ClassBytes cb, ClassLoader cl)
           
static String getArrayClassPart(String className)
           
static byte[] getClassBytes(String className, ClassLoader classbyteloader)
          method is called to retrieve a byte array of a Class for a given class name
static Class[] getInterfacesFor(Class clazz)
          given a class, recurse its dependency graph and find all its implemented interfaces
static String getPackageName(Class cl)
           
static String getShortClassName(Class cl)
           
static boolean isArrayClass(String className)
           
protected static byte[] read(InputStream in)
          simple utility method for reading bytes from an input stream
static byte[] serialize(Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.jboss.logging.Logger log
Constructor Detail

ClassUtil

public ClassUtil()
Method Detail

deserialize

public static Object deserialize(ClassBytes cb,
                                 ClassLoader cl)
                          throws IOException,
                                 ClassNotFoundException
Throws:
IOException
ClassNotFoundException

deserialize

public static Object deserialize(byte[] buf)
                          throws IOException,
                                 ClassNotFoundException
Throws:
IOException
ClassNotFoundException

deserialize

public static Object deserialize(byte[] buf,
                                 ClassLoader cl)
                          throws IOException,
                                 ClassNotFoundException
Throws:
IOException
ClassNotFoundException

serialize

public static byte[] serialize(Object obj)
                        throws IOException
Throws:
IOException

isArrayClass

public static boolean isArrayClass(String className)

getArrayClassPart

public static String getArrayClassPart(String className)

getPackageName

public static String getPackageName(Class cl)

getShortClassName

public static String getShortClassName(Class cl)

getInterfacesFor

public static Class[] getInterfacesFor(Class clazz)
given a class, recurse its dependency graph and find all its implemented interfaces

Parameters:
clazz -
Returns:
array of interfaces

getClassBytes

public static byte[] getClassBytes(String className,
                                   ClassLoader classbyteloader)
method is called to retrieve a byte array of a Class for a given class name

Parameters:
className -
Returns:

read

protected static byte[] read(InputStream in)
                      throws IOException
simple utility method for reading bytes from an input stream

Parameters:
in -
Returns:
Throws:
IOException


Copyright © 2004 JBoss Inc. All Rights Reserved.