|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jzeno.classloader.ClassBytesLoader
public class ClassBytesLoader
Utility class to load the bytes of class files.
After instantiating it, the setupSunByteLoading()
 method can
optionally be called to let the class detect if it's possible to
interface with a private API that's specific to the Sun JVM. This interface
can improve class byte loading performance by 40%.
Constructor Summary | |
---|---|
ClassBytesLoader(java.lang.ClassLoader classLoader)
Instantiates a new bytes loader for class files. |
Method Summary | |
---|---|
byte[] |
getClassBytes(java.lang.String classFileName)
Retrieves a byte array that contains the bytecode for a specific Java class. |
byte[] |
getClassBytes(java.lang.String classFileName,
java.net.URL classResource)
Retrieves a byte array that contains the bytecode for a specific Java class. |
boolean |
isUsingSunByteLoading()
Indicates whether this class is using the private Sun JVM interface to speed up class bytes loading. |
boolean |
setupSunByteLoading()
Tries to setup an interaction with a private Sun JVM interface that can speed up class bytes loading by 40%, when available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassBytesLoader(java.lang.ClassLoader classLoader)
classLoader
- the classloader that should be used to search for the
classesMethod Detail |
---|
public boolean setupSunByteLoading()
true
 when the interaction with the private Sun JVM
interface could be setup; or
false
otherwise
public byte[] getClassBytes(java.lang.String classFileName) throws java.lang.ClassNotFoundException
classFileName
- the file name of the class whose bytes should be
loaded, note that this is not the Java FQN (com.uwyn.rife.Version
),
but the real name of the file resource (com/uwyn/rife/Version.java
)
null
 if no bytes could be loaded
FileUtilsErrorException
- if an error occurred during the loading
of the class bytes
java.lang.ClassNotFoundException
getClassBytes(String, URL)
public byte[] getClassBytes(java.lang.String classFileName, java.net.URL classResource) throws java.lang.ClassNotFoundException
classFileName
- the file name of the class whose bytes should be
loadedclassResource
- the resource that can be used to load the class
bytes from if it couldn't be obtained by using the file name, if no
resource is provided and the bytes couldn't be loaded by simply using
the class' file name, a resource will be looked up for the file name
through the class loader that was provided to the constructor
null
 if no bytes could be loaded
java.lang.ClassNotFoundException
- if an error occurred during the loading
of the class bytesgetClassBytes(String)
public boolean isUsingSunByteLoading()
true
 when this class is using the private Sun JVM
interface; or
false
if this is not the case
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |