Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class Callback

java.lang.Object
  extended by stec.jenie.Callback

public abstract class Callback
extends java.lang.Object

Represents a callback function.

Callbacks can only be passed or returned by functions and callbacks as a pointer to the callback.

Since:
1.0.0 12/05/2004

Field Summary
static int CDECL
          The caller cleans the stack.
static int CREATE_NEW_THREAD
          Create new thread to process callback.
static int DEFAULT_PROCESSING
          Default callback processing.
static int STDCALL
          The callee cleans the stack.
static int USING_ATTACHED_THREAD
          The callback is using a native thread that has been attached to a Java thread.
static int USING_DETACHED_THREAD
          The callback is using a native thread that has not been attached to a Java thread.
 
Constructor Summary
Callback()
          Constructs a new callback function.
Callback(NativeParameter[] parameters)
          Constructs a new callback function with the specified parameters.
Callback(NativeParameter[] parameters, NativeParameter return_value)
          Constructs a new callback function with the specified parameters and return value.
Callback(NativeParameter[] parameters, NativeParameter return_value, int calling_convention)
          Constructs a new callback function with the specified parameters, return value and calling convention.
 
Method Summary
abstract  void callback()
          Called when callback.
 void free()
          Used to free this callback.
 int getCallbackHandling()
          Returns how callbacks are handled.
 int getCallingConvention()
          Returns the calling convention.
 long getNativeAddress()
          Returns the native address of this callback.
 NativeParameter[] getParameters()
          Returns any parameters.
 NativeParameter getReturnValue()
          Returns any return value.
 void setCallbackHandling(int callback_handling)
          Sets how callback are handled.
 void setCallingConvention(int calling_convention)
          Used to set the calling convention.
 void setParameters(NativeParameter[] parameters)
          Used to set the parameters.
 void setReturnValue(NativeParameter return_value)
          Used to set the return value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STDCALL

public static final int STDCALL
The callee cleans the stack.

This is the default calling convention for Win32 API callbacks.

See Also:
Constant Field Values

CDECL

public static final int CDECL
The caller cleans the stack.

This is the default calling convention for C callbacks.

This enables calling callbacks with variable number or parameters.

See Also:
Constant Field Values

DEFAULT_PROCESSING

public static final int DEFAULT_PROCESSING
Default callback processing.

See Also:
Constant Field Values

CREATE_NEW_THREAD

public static final int CREATE_NEW_THREAD
Create new thread to process callback.

See Also:
Constant Field Values

USING_ATTACHED_THREAD

public static final int USING_ATTACHED_THREAD
The callback is using a native thread that has been attached to a Java thread.

See Also:
Constant Field Values

USING_DETACHED_THREAD

public static final int USING_DETACHED_THREAD
The callback is using a native thread that has not been attached to a Java thread.

See Also:
Constant Field Values
Constructor Detail

Callback

public Callback()
Constructs a new callback function.

Uses the default calling convention.


Callback

public Callback(NativeParameter[] parameters)
Constructs a new callback function with the specified parameters.

Uses the default calling convention.

Parameters:
parameters - any parameters to use. null for none.

Callback

public Callback(NativeParameter[] parameters,
                NativeParameter return_value)
Constructs a new callback function with the specified parameters and return value.

Uses the default calling convention.

Parameters:
parameters - any parameters to use. null for none.
return_value - any return code. null for none.

Callback

public Callback(NativeParameter[] parameters,
                NativeParameter return_value,
                int calling_convention)
         throws java.lang.IllegalArgumentException
Constructs a new callback function with the specified parameters, return value and calling convention.

Parameters:
parameters - any parameters to use. null for none.
return_value - any return code. null for none.
calling_convention - the calling convention. -1 for the default calling convention.
Throws:
java.lang.IllegalArgumentException - if the calling convention specified is not valid.
Method Detail

setParameters

public void setParameters(NativeParameter[] parameters)
Used to set the parameters.

Parameters:
parameters - any parameters to use. null for none.

setReturnValue

public void setReturnValue(NativeParameter return_value)
Used to set the return value.

Parameters:
return_value - any return value to use. null for none.

setCallingConvention

public void setCallingConvention(int calling_convention)
                          throws java.lang.IllegalArgumentException
Used to set the calling convention.

Parameters:
calling_convention - the calling convention. -1 for the default calling convention.
Throws:
java.lang.IllegalArgumentException - if the calling convention specified is not valid.

setCallbackHandling

public void setCallbackHandling(int callback_handling)
Sets how callback are handled.

Used when using Java 1.1.x.


getParameters

public NativeParameter[] getParameters()
Returns any parameters.

Returns:
any parameters. null for none.

getReturnValue

public NativeParameter getReturnValue()
Returns any return value.

Returns:
any return value. null for none.

getCallingConvention

public int getCallingConvention()
Returns the calling convention.

Returns:
the calling convention.

getCallbackHandling

public int getCallbackHandling()
Returns how callbacks are handled.


getNativeAddress

public long getNativeAddress()
Returns the native address of this callback.

Returns:
the native address of this callback.

callback

public abstract void callback()
Called when callback.


free

public void free()
Used to free this callback.


Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.