Class MHU

java.lang.Object
  |
  +--MHU

public class MHU
extends java.lang.Object

Uniface Interface Class.

NOTE: To perform Uniface Call-in, this class uses the System.loadLibrary call to load the ud5 library. For this to work, you may need to update the PATH in your operating environment, or change the code to call System.load(filename) instead.

An example:
    MHU mhu = new MHU();
    mhu.LOADLIBRARY("ud5");
    int res=mhu.UACTIVATE("TEST_JAVA","CLOSING_SWING","Bye");
 

Version:
$Revision: 1.5 $
Author:
Copyright (c) 2001 by March Hare Pty Ltd, Inc. All Rights Reserved.

Constructor Summary
MHU()
           
 
Method Summary
static void LOADLIBRARY(java.lang.String lib)
          Loads the UD5 library to prepare the Java Runtime Environment to perform Uniface call-in with either the ud5 or ud5j11 library.
static void main(java.lang.String[] args)
          Test that the class and library can be loaded.
 int UACTIVATE(java.lang.String instance, java.lang.String operation)
          Activate a Uniface operation with no parameters.
 int UACTIVATE(java.lang.String instance, java.lang.String operation, int param)
          Activate a Uniface operation.
 int UACTIVATE(java.lang.String instance, java.lang.String operation, java.lang.String param)
          Activate a Uniface operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MHU

public MHU()
Method Detail

main

public static void main(java.lang.String[] args)
Test that the class and library can be loaded. Typically called from the command line to test the installation
    java MHU
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ud5 in java.library.path
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
            at java.lang.Runtime.loadLibrary0(Runtime.java:749)
            at java.lang.System.loadLibrary(System.java:820)
            at MHU.LOADLIBRARY(MHU.java:13)
            at MHU.main(MHU.java:8)
 
This error indicates that the ud5 library cannot be found, and must be corrected before Java can call Uniface operations.
Returns:
0 on success.
Throws:
Any -  

LOADLIBRARY

public static void LOADLIBRARY(java.lang.String lib)
Loads the UD5 library to prepare the Java Runtime Environment to perform Uniface call-in with either the ud5 or ud5j11 library. For this to work, you may need to update the PATH in your operating environment, or change the call to System.load(filename).
Parameters:
lib - The correct UD5 library to load.
Returns:
nothing.
Throws:
java.lang.SecurityException - if a security manager exists and its checkLink method doesn't allow loading of the specified dynamic library.
UnsatisfiedLinkError - if the file does not exist.

UACTIVATE

public int UACTIVATE(java.lang.String instance,
                     java.lang.String operation,
                     int param)
Activate a Uniface operation.
Parameters:
instance - The name of the component instance to activate.
operation - The name of the operation within that component instance to activate
param - The numeric parameter to pass to the operation.
Returns:
The return $status of the operation.

UACTIVATE

public int UACTIVATE(java.lang.String instance,
                     java.lang.String operation,
                     java.lang.String param)
Activate a Uniface operation.
Parameters:
instance - The name of the component instance to activate.
operation - The name of the operation within that component instance to activate
param - The string parameter to pass to the operation.
Returns:
The return $status of the operation.

UACTIVATE

public int UACTIVATE(java.lang.String instance,
                     java.lang.String operation)
Activate a Uniface operation with no parameters.
Parameters:
instance - The name of the component instance to activate.
operation - The name of the operation within that component instance to activate
Returns:
The return $status of the operation.