|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eaio.nativecall.NativeCall
NativeCall loads the native library and prepares the matching
Verifier
.
Before being able to use NativeCall, the init()
method must have
been called:
try { NativeCall.init(); } catch (IOException ex) { ... } catch (SecurityException ex) { ... } catch (UnsatisfiedLinkError er) { ... } catch (sun.misc.ServiceConfigurationError) { ... } catch (UnsupportedOperationException) { ... }After usage, each NativeCall object must be destroyed to release resources. This is done by calling the
destroy()
method. Failure
to call this method might result in memory leaks.
destroy()
,
init()
Constructor Summary | |
NativeCall(String function)
Constructor for NativeCall. |
|
NativeCall(String module,
String function)
Constructor for NativeCall. |
Method Summary | |
protected void |
check(Object[] params)
Checks the supplied Object array for illegal/unsupported types. |
protected void |
checkParam(Object o)
Checks one Object for illegal/unsupported types. |
void |
destroy()
Releases acquired module handles. |
boolean |
equals(Object obj)
Returns if this Object is equal to another Object. |
protected void |
finalize()
Calls destroy() . |
String |
getLastError()
Returns a formatted String containing the last error code or null if the last call did not produce an error. |
int |
getLastErrorCode()
Returns the error code that was returned during the last method call or 0 if the last method call did not produce an error. |
int |
hashCode()
Returns the hashCode of this Object. |
static void |
init()
Before NativeCall may be used, this method must be called. |
String |
toString()
Returns a String representation of this Object. |
StringBuffer |
toStringBuffer(StringBuffer in)
Appends a String representation of this Object to the given StringBuffer or creates a new one if none is given. |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NativeCall(String function) throws IllegalArgumentException, NullPointerException
function
- the name of the function to use, may not be
null
IllegalArgumentException
- if the function could not be found
NullPointerException
- if function is null
Verifier.getDefaultModule()
,
NativeCall(String, String)
public NativeCall(String module, String function) throws IllegalArgumentException, NullPointerException
module
- the name of the module the function is stored in, may be
null
function
- the name of the function to use, may not be
null
IllegalArgumentException
- if the function could not be found
NullPointerException
- if function is null
Method Detail |
public static void init() throws IOException, SecurityException, UnsatisfiedLinkError, sun.misc.ServiceConfigurationError, UnsupportedOperationException
Verifier
.
Multiple calls are ignored.
IOException
- if an IOException occured during unpacking of
the native library
SecurityException
- if accessing system properties was forbidden
by the SecurityManager
UnsatisfiedLinkError
- if the NativeCall.dll
could
not be found
sun.misc.ServiceConfigurationError
UnsupportedOperationException
- if no matching
Verifier
could be foundpublic final int getLastErrorCode()
getLastError()
public final String getLastError()
null
if the last call did not produce an error.
null
if the last error code is 0getLastErrorCode()
public void destroy()
Failure to call this method might result in memory leaks.
Updates the error code field. See getLastError()
.
protected void check(Object[] params) throws ClassCastException
During the verification, the contents of the array might be changed.
params
- the Object array, may be null
ClassCastException
- if the type of one argument is not supportedprotected void checkParam(Object o) throws ClassCastException
o
- the Object, may be null
ClassCastException
- if the type of one argument is not supportedpublic boolean equals(Object obj)
equals
in class Object
obj
- the other Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
protected void finalize() throws Throwable
destroy()
.
finalize
in class Object
Throwable
Object.finalize()
public final String toString()
toString
in class Object
null
Object.toString()
,
toStringBuffer(StringBuffer)
public StringBuffer toStringBuffer(StringBuffer in)
StringBuffer
or creates a new one if none is given.
in
- the StringBuffer to append to, may be null
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |