org.onemind.commons.invoke
Interface Invocable

All Known Implementing Classes:
AbstractInvocable

public interface Invocable

An interface for a object provide information about functions that can be invoked on itself (through a key) and API for invoke the method on on itself

Version:
$Id: Invocable.java,v 1.2 2004/08/26 16:08:23 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@onemindsoft.org)

Method Summary
 boolean canInvoke(java.lang.String functionName, java.lang.Object[] args)
          whether the function can be invoke with the arguments
 InvocableFunction getFunction(java.lang.String functionName, java.lang.Object[] args)
          Get the function
 java.lang.Object invoke(java.lang.String functionName, java.lang.Object[] args)
          invoke the function with the arguments provided
 

Method Detail

canInvoke

public boolean canInvoke(java.lang.String functionName,
                         java.lang.Object[] args)
whether the function can be invoke with the arguments

Parameters:
functionName - the function name
args - the arguments
Returns:
true if can invoke

getFunction

public InvocableFunction getFunction(java.lang.String functionName,
                                     java.lang.Object[] args)
Get the function

Parameters:
functionName - the function name
args - the arguments
Returns:
the function, or null if the function cannot be found

invoke

public java.lang.Object invoke(java.lang.String functionName,
                               java.lang.Object[] args)
                        throws java.lang.Exception
invoke the function with the arguments provided

Parameters:
functionName - the function name
args - the arguments
Returns:
the object returns from the invocation
Throws:
java.lang.Exception - if there's problem invoking the function


Copyright © 2004-2005 . All Rights Reserved.