ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able
Interface AbleUserDefinedFunctionRemoteManager

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
AblePlatformAgent, AbleRemoteAgent, AutotuneAgentIf, JasKnnDistributedAgentIF, JasNaiveBayesDistributedAgentIF

public interface AbleUserDefinedFunctionRemoteManager
extends java.rmi.Remote

The AbleUserDefinedFunctionRemoteManager interface defines methods to remotely add, remove, and invoke AbleUserDefinedFunction objects. An object implementing the UserDefinedFunctionManager interface maintains a list of user-defined function objects. These user-defined functions can be used by Agents and rules to access external application data. The manager provides methods for adding to and removing from a master list of user-defined functions, as well as a method for invoking any user-defined function contained in the master list. User-defined functions allow objects to call methods on other objects which are available only at run time.


Method Summary
 void addUserDefinedFunction(AbleUserDefinedFunction theUserDefinedFunction)
          Adds a specific user-defined function to the master list of user-defined functions.
 boolean containsUserDefinedFunction(java.lang.String theUserDefinedFunctionName, int theArity)
          Indicates if the master list of user-defined functions contains a user-defined function with the specified name and arity.
 AbleUserDefinedFunction getUserDefinedFunction(java.lang.String theUserDefinedFunctionName, int theArity)
          Returns the specified user-defined function
 java.util.Hashtable getUserDefinedFunctions()
          Get the complete master list of user-defined functions registered with this function manager.
 java.lang.Object invokeUserDefinedFunction(java.lang.String theUserDefinedFunctionName, java.lang.Object[] theArgs)
          Invokes the actual method that the named user-defined function represents, passing in the array of argument objects.
 void removeUserDefinedFunction(java.lang.String theUserDefinedFunctionName, int theArity)
          Removes the named user-defined function from the master list of user-defined functions.
 void setUserDefinedFunctions(java.util.Hashtable theUserDefinedFunctions)
          Sets the complete master list of user-defined functions for this function manager.
 

Method Detail

addUserDefinedFunction

public void addUserDefinedFunction(AbleUserDefinedFunction theUserDefinedFunction)
                            throws java.rmi.RemoteException
Adds a specific user-defined function to the master list of user-defined functions.
Parameters:
theUserDefinedFunction - The user-defined function to be added to the master list.
Throws:
java.rmi.RemoteException - If an error occurs.

removeUserDefinedFunction

public void removeUserDefinedFunction(java.lang.String theUserDefinedFunctionName,
                                      int theArity)
                               throws java.rmi.RemoteException
Removes the named user-defined function from the master list of user-defined functions.
Parameters:
theUserDefinedFunctionName - The name of the user-defined function to be removed from the master list.
theArity - The number of arguments expected by the named function.
Throws:
java.rmi.RemoteException - If an error occurs.

containsUserDefinedFunction

public boolean containsUserDefinedFunction(java.lang.String theUserDefinedFunctionName,
                                           int theArity)
                                    throws java.rmi.RemoteException
Indicates if the master list of user-defined functions contains a user-defined function with the specified name and arity.
Parameters:
theUserDefinedFunctionName - The name of a user-defined function that might be in the master list.
theArity - The number of arguments expected by the named function.
Returns:
true if a user-defined function with the specified name and number of arguments exists in the master list; false otherwise.
Throws:
java.rmi.RemoteException - If an error occurs.

getUserDefinedFunction

public AbleUserDefinedFunction getUserDefinedFunction(java.lang.String theUserDefinedFunctionName,
                                                      int theArity)
                                               throws java.rmi.RemoteException
Returns the specified user-defined function
Parameters:
theUserDefinedFunctionName - The name of a user-defined function that might be in the master list.

theArity - The number of arguments expected by the named function.

Returns:
The specified user defined function object; null if not found.
Throws:
java.rmi.RemoteException - If an error occurs.

invokeUserDefinedFunction

public java.lang.Object invokeUserDefinedFunction(java.lang.String theUserDefinedFunctionName,
                                                  java.lang.Object[] theArgs)
                                           throws java.rmi.RemoteException,
                                                  java.lang.NoSuchMethodException,
                                                  java.lang.reflect.InvocationTargetException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.SecurityException
Invokes the actual method that the named user-defined function represents, passing in the array of argument objects.
Parameters:
theUserDefinedFunctionName - The name of the user-defined function containing an encapsulated method.

theArgs - An array of arguments expected by the encapsulated method.

Returns:
The invoked method's return value. This may be null. If the invoked method returns a primitive, the primitive is turned into a corresponding Object; for example, a double becomes a Double.
Throws:
java.lang.NoSuchMethodException - If the method or method signature is not defined in the encapsulated source object.
java.lang.reflect.InvocationTargetException - If an exception was thrown by the invoked method.
java.lang.SecurityException - If the invoker lacks authority to invoke the method.
java.lang.IllegalAccessException - If the method is not public or otherwise accessible.
java.rmi.RemoteException - If an error occurs.

setUserDefinedFunctions

public void setUserDefinedFunctions(java.util.Hashtable theUserDefinedFunctions)
                             throws java.rmi.RemoteException
Sets the complete master list of user-defined functions for this function manager.
Parameters:
theUserDefinedFunctions - A list of AbleUserDefinedFunction objects. This list completely replaces the current list. The input list is cloned.
Throws:
java.rmi.RemoteException - If an error occurs.

getUserDefinedFunctions

public java.util.Hashtable getUserDefinedFunctions()
                                            throws java.rmi.RemoteException
Get the complete master list of user-defined functions registered with this function manager.
Returns:
A copy of the list of all registered UserDefinedFunction objects.
Throws:
java.rmi.RemoteException - If an error occurs.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003