com.ibm.di.fc
Class JavaClassFC

java.lang.Object
  extended by com.ibm.di.fc.Function
      extended by com.ibm.di.fc.JavaClassFC
All Implemented Interfaces:
FunctionInterface, VersionInfoInterface

public class JavaClassFC
extends Function

This is a function component that calls a generic java method.


Field Summary
 
Fields inherited from class com.ibm.di.fc.Function
logger
 
Constructor Summary
JavaClassFC()
           
 
Method Summary
 Object getInstance()
          Return the instance that is used when invoking the method.
 String[] getMethods()
          Return a list of method names in our javaClass.
 String getVersion()
          Version information.
 void initialize(Object obj)
          Called once to initialize the function
 Object perform(Object obj)
          Makes a call to the java method.
 void setInstance(Object obj)
          Sets the instance that will be used when invoking the method.
 boolean updateSchema(FunctionConfig config)
          This method modifies the schema in the provided configuration.
 
Methods inherited from class com.ibm.di.fc.Function
debug, getConfiguration, getContext, getDebug, getLog, getParam, getRSInterface, getUI, initialize, logmsg, querySchema, setConfiguration, setContext, setDebug, setLog, setParam, setRSInterface, terminate, verifyInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaClassFC

public JavaClassFC()
Method Detail

initialize

public void initialize(Object obj)
                throws Exception
Called once to initialize the function

Specified by:
initialize in interface FunctionInterface
Overrides:
initialize in class Function
Parameters:
obj - Additional information
Throws:
Exception - If the configuration is not complete, or the class or method cannot be found

setInstance

public void setInstance(Object obj)
Sets the instance that will be used when invoking the method. By default an instance created using the empty constructor will be used.

Parameters:
obj - The instance to use

getInstance

public Object getInstance()
Return the instance that is used when invoking the method.

Returns:
The instance used

perform

public Object perform(Object obj)
               throws Exception
Makes a call to the java method.

Parameters:
obj - An Entry containing the values of the parameters
Returns:
The result of calling the method
Throws:
Exception - If no method is found. If parameters are needed, and obj is not an Entry.

getVersion

public String getVersion()
Description copied from interface: VersionInfoInterface
Version information.

Returns:
version information

getMethods

public String[] getMethods()
Return a list of method names in our javaClass. Used by the Config Editor.

Returns:
a String[] containing names of all methods.

updateSchema

public boolean updateSchema(FunctionConfig config)
                     throws Exception
This method modifies the schema in the provided configuration. The intent is to allow the FC to provide a schema definition dynamically based on a given configuration. Note: changes the configuration of this component

Specified by:
updateSchema in interface FunctionInterface
Overrides:
updateSchema in class Function
Parameters:
config - - The new FunctionConfig to use
Returns:
- true if the schema was successfully updated
Throws:
Exception - : never