Agaetis
VMWare API

1.0.0.8

com.agaetis.vmware
Class VixLibrary

java.lang.Object
  extended by com.agaetis.vmware.VixLibrary

public class VixLibrary
extends Object

Class for the mapping between vix library and java using jna.

NB : If the libvix.so is used to connect to another console than VMware Server 1.0 then you have to change the libvix.so in resources/libs

NB : This class use libvixAllProducts so it has to be in the jna path.

Author:
Franck MARCHAND

Nested Class Summary
static interface VixLibrary.VixLibraryInterface
           
 
Field Summary
(package private)  URL libsURL
           
 
Constructor Summary
VixLibrary()
           
 
Method Summary
static void checkError(int err)
          Throws an exception, if there is an error.
static void checkHandle(int handle)
          This static method check if the handle given is valid.
static VixLibrary.VixLibraryInterface getInterfaceInstance()
          if the platform is linux and if the jna library path contains a vixAllProducts library then load it otherwise load the vix library.
static void releaseHandle(int handle)
          Release resources attached to the given handle.
static void setLibraryPath(String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

libsURL

URL libsURL
Constructor Detail

VixLibrary

public VixLibrary()
Method Detail

checkError

public static void checkError(int err)
                       throws VMWareRuntimeException
Throws an exception, if there is an error. The exception explains the error with a message. if there is no error then no exception will be thrown.

Parameters:
err - Error number obtained by Vix_JobWait
Throws:
VMWareRuntimeException

checkHandle

public static void checkHandle(int handle)
                        throws VMWareRuntimeException
This static method check if the handle given is valid. it means different from Vix.INVALID_HANDLE If handle is not valid it will throw an exception.

Parameters:
handle - Handle to check
Throws:
VMWareRuntimeException

releaseHandle

public static void releaseHandle(int handle)
Release resources attached to the given handle.

Parameters:
handle - Handle to release.

setLibraryPath

public static void setLibraryPath(String path)

getInterfaceInstance

public static VixLibrary.VixLibraryInterface getInterfaceInstance()
if the platform is linux and if the jna library path contains a vixAllProducts library then load it otherwise load the vix library.

Returns:
interface instance

Agaetis
VMWare API

1.0.0.8

2010 Agaetis