PenProfile 2.x

com.sun.cldchi.jvm
Class JVM

java.lang.Object
  extended by com.sun.cldchi.jvm.JVM

public class JVM
extends Object


Field Summary
static int REMOVE_CLASSES_FROM_JAR
          If this flag is defined and the romization is successful, class files are removed from the JAR file(s) after the romization process.
static int STATUS_CANCELLED
          Returned by getAppImageProgress() to indicate that the last image creation process has was cancelled before it was completed.
static int STATUS_FAILED
          Returned by getAppImageProgress() to indicate that the last image creation process has failed before it was completed.
static int STATUS_START
          Any value returned by getAppImageProgress() that.s greater or equal to STATUS_START, but lower than STATUS_SUCCEEDED, means that the image creation is still taking place.
static int STATUS_SUCCEEDED
          Returned by getAppImageProgress() to indicate that the last image creation process has succeeded.
static int STATUS_VERIFY_FAILED
          Returned by verifyJar() to indicate JAR classes verification failed by some reason.
static int STATUS_VERIFY_NOTHING
          Returned by verifyJar() to indicate no classes verification has ever been started since VM didn't find any classes in JAR.
static int STATUS_VERIFY_SUCCEEDED
          Returned by verifyJar() to indicate all JAR classes were successfully verified.
static int STATUS_VIRGIN
          Returned by getAppImageProgress() to indicate that no image creation process has ever been started since the VM was bootstraped.
 
Constructor Summary
JVM()
           
 
Method Summary
static void cancelImageCreation()
          If an image creation process is underway, cancel it.
static void createAppImage(String jarFile, String binFile, int flags)
           
static void flushJarCaches()
          Flushes all JAR file caches.
static int getAppImageProgress()
           
static void loadLibrary(String libName)
          This method is used to load binary library into the VM.
static void unchecked_byte_arraycopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int length)
          Copy an array from the specified source array, beginning at the specified position, to the specified position of the destination array.
static void unchecked_char_arraycopy(char[] src, int srcOffset, char[] dst, int dstOffset, int length)
           
static void unchecked_int_arraycopy(int[] src, int srcOffset, int[] dst, int dstOffset, int length)
           
static void unchecked_long_arraycopy(long[] src, int srcOffset, long[] dst, int dstOffset, int length)
           
static void unchecked_obj_arraycopy(Object[] src, int srcOffset, Object[] dst, int dstOffset, int length)
           
static int verifyJar(String jar, int chunkSize)
          Verifies all classes of the given JAR package within the current VM instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOVE_CLASSES_FROM_JAR

public static final int REMOVE_CLASSES_FROM_JAR
If this flag is defined and the romization is successful, class files are removed from the JAR file(s) after the romization process. This parameter is ignored for source romization.

See Also:
Constant Field Values

STATUS_CANCELLED

public static final int STATUS_CANCELLED
Returned by getAppImageProgress() to indicate that the last image creation process has was cancelled before it was completed.

See Also:
Constant Field Values

STATUS_FAILED

public static final int STATUS_FAILED
Returned by getAppImageProgress() to indicate that the last image creation process has failed before it was completed.

See Also:
Constant Field Values

STATUS_VIRGIN

public static final int STATUS_VIRGIN
Returned by getAppImageProgress() to indicate that no image creation process has ever been started since the VM was bootstraped.

See Also:
Constant Field Values

STATUS_START

public static final int STATUS_START
Any value returned by getAppImageProgress() that.s greater or equal to STATUS_START, but lower than STATUS_SUCCEEDED, means that the image creation is still taking place.

See Also:
Constant Field Values

STATUS_SUCCEEDED

public static final int STATUS_SUCCEEDED
Returned by getAppImageProgress() to indicate that the last image creation process has succeeded.

See Also:
Constant Field Values

STATUS_VERIFY_NOTHING

public static final int STATUS_VERIFY_NOTHING
Returned by verifyJar() to indicate no classes verification has ever been started since VM didn't find any classes in JAR.

See Also:
Constant Field Values

STATUS_VERIFY_SUCCEEDED

public static final int STATUS_VERIFY_SUCCEEDED
Returned by verifyJar() to indicate all JAR classes were successfully verified.

See Also:
Constant Field Values

STATUS_VERIFY_FAILED

public static final int STATUS_VERIFY_FAILED
Returned by verifyJar() to indicate JAR classes verification failed by some reason.

See Also:
Constant Field Values
Constructor Detail

JVM

public JVM()
Method Detail

createAppImage

public static void createAppImage(String jarFile,
                                  String binFile,
                                  int flags)
                           throws Error
Throws:
Error

getAppImageProgress

public static int getAppImageProgress()

cancelImageCreation

public static void cancelImageCreation()
If an image creation process is underway, cancel it. This will force createAppImage() to delete all temporary files, as well as the output image file, and return immediately. A future call to getAppImageProgress() will return STATUS_CANCELLED. If an image creation process is not underway, this method has no effect.


loadLibrary

public static void loadLibrary(String libName)
                        throws Error
This method is used to load binary library into the VM. It allows to call native function implementations from this library.

Parameters:
libName - name of the library WITHOUT EXTENSION. It was made to make java code platform-independent.
Throws:
Error - if the VM fails to load the library with this name.

unchecked_byte_arraycopy

public static void unchecked_byte_arraycopy(byte[] src,
                                            int srcOffset,
                                            byte[] dst,
                                            int dstOffset,
                                            int length)
Copy an array from the specified source array, beginning at the specified position, to the specified position of the destination array.

Impose the following restrictions on the input arguments:

The caller is responsible that these restrictions are not violated. If any of the restrictions above is violated, the behavior is undefined.

Parameters:
src - the source array.
srcOffset - start position in the source array.
dst - the destination array.
dstOffset - start position in the destination data.
length - the number of array elements to be copied.

unchecked_char_arraycopy

public static void unchecked_char_arraycopy(char[] src,
                                            int srcOffset,
                                            char[] dst,
                                            int dstOffset,
                                            int length)

unchecked_int_arraycopy

public static void unchecked_int_arraycopy(int[] src,
                                           int srcOffset,
                                           int[] dst,
                                           int dstOffset,
                                           int length)

unchecked_long_arraycopy

public static void unchecked_long_arraycopy(long[] src,
                                            int srcOffset,
                                            long[] dst,
                                            int dstOffset,
                                            int length)

unchecked_obj_arraycopy

public static void unchecked_obj_arraycopy(Object[] src,
                                           int srcOffset,
                                           Object[] dst,
                                           int dstOffset,
                                           int length)

verifyJar

public static int verifyJar(String jar,
                            int chunkSize)
Verifies all classes of the given JAR package within the current VM instance. The JAR path should be included into classpath(s) of the VM.

Parameters:
jar - specifies the JAR file to be verified.
chunkSize - amount of bytecode to be verified with a single native call, however not less than one class will be verified with a single call.
Returns:
status of the JAR classes verification, it can be one of the following values STATUS_VERIFY_NOTHING, STATUS_VERIFY_SUCCEEDED or STATUS_VERIFY_FAILED

flushJarCaches

public static void flushJarCaches()
Flushes all JAR file caches.


PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.