ABLE, Version 1.1b

com.ibm.able.beans
Class AbleMethodAdaptor

java.lang.Object
  |
  +--com.ibm.able.beans.AbleAtom
        |
        +--com.ibm.able.beans.AbleMethodAdaptor
Direct Known Subclasses:
AbleEffector, AbleSensor

public class AbleMethodAdaptor
extends AbleAtom

An AbleMethodAdaptor is a named Atom that makes a method call to retrieve its value.

Version:
1.0.0; change log:
 Version   Description
 --------  -----------
 1.0.0     Initial release.

 
See Also:
AbleAtom, Serialized Form

Field Summary
protected  java.lang.Class[] argList
          argList is a list of the classes in the argument list.
protected  java.lang.reflect.Method method
          method is the method object in sourceObj.
protected  java.lang.String methodName
          methodName is a public method in sourceObj.
protected  java.lang.Object sourceObj
          sourceObj is any arbitrary object on which the method named in methodName is to be called.
 
Fields inherited from class com.ibm.able.beans.AbleAtom
name, value
 
Constructor Summary
AbleMethodAdaptor(java.lang.String aName, java.lang.Object aSource, java.lang.reflect.Method aMethod)
          Create a new method adaptor with the specified name, and encapsulate the specified method of the specified object.
AbleMethodAdaptor(java.lang.String aName, java.lang.Object aSource, java.lang.String aMethodName, java.lang.Class[] args)
          Create a new method adaptor with the specified name, and encapsulate the specified method of the specified object.
 
Method Summary
 java.lang.Object invoke(java.lang.Object[] args)
          Call the encapsulated object method.
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.able.beans.AbleAtom
getName, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceObj

protected java.lang.Object sourceObj
sourceObj is any arbitrary object on which the method named in methodName is to be called.

methodName

protected java.lang.String methodName
methodName is a public method in sourceObj.

argList

protected java.lang.Class[] argList
argList is a list of the classes in the argument list.

method

protected transient java.lang.reflect.Method method
method is the method object in sourceObj.
Constructor Detail

AbleMethodAdaptor

public AbleMethodAdaptor(java.lang.String aName,
                         java.lang.Object aSource,
                         java.lang.String aMethodName,
                         java.lang.Class[] args)
                  throws java.lang.NoSuchMethodException,
                         java.lang.SecurityException
Create a new method adaptor with the specified name, and encapsulate the specified method of the specified object.
Parameters:
aName - the name of the method adaptor which can referenced by rules
aSource - the object whose method is invoked
aMethodName - the name of the method to invoke
args - the parameter list of the method
Throws:
java.lang.NoSuchMethodException - if the method with arg list does not exist in source object class

AbleMethodAdaptor

public AbleMethodAdaptor(java.lang.String aName,
                         java.lang.Object aSource,
                         java.lang.reflect.Method aMethod)
Create a new method adaptor with the specified name, and encapsulate the specified method of the specified object.
Parameters:
aName - the name of the method adaptor which can referenced by rules
aSource - the object whose method is invoked
aMethod - the method to invoke
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object[] args)
                        throws java.lang.reflect.InvocationTargetException,
                               java.lang.IllegalAccessException,
                               java.lang.NoSuchMethodException,
                               java.lang.SecurityException
Call the encapsulated object method.
Parameters:
args - An array of objects that are passed to the invoked method.

Returns:
An object representing the outcome of the call.
Throws:
java.lang.NoSuchMethodException - the method or method signature if not defined in the source object
java.lang.reflect.InvocationTargetException - if an exception was thrown by the invoked method
java.lang.SecurityException - if the method is not public or accessible
java.lang.IllegalAccessException - if the method is not public or accessible

toString

public java.lang.String toString()
Overrides:
toString in class AbleAtom

ABLE, Version 1.1b

ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'