com.objectwave.appArch.admin
Class CallbackHolder

java.lang.Object
  |
  +--com.objectwave.appArch.admin.CallbackHolder

public class CallbackHolder
extends java.lang.Object

Holder for callback objects in the Command Callback Service

Version:
3.1
Author:
Dave Hoag

Nested Class Summary
static class CallbackHolder.Test
          Unit test of the ProcessDescriptor.
 
Constructor Summary
CallbackHolder(java.lang.Object callbackObject, java.lang.String externalCallName, java.lang.String methodName, java.lang.String methodDescription, java.lang.String[] arguments, java.lang.String[] argumentDescriptions)
          Constructor that initializes the CallbackHolder.
 
Method Summary
 Command executeCommand(Command command)
          Execute the method of the callback object contained in the callbackHolder
 java.lang.String[] getArgumentDescriptions()
          Return the argument descriptions as a string array object
 java.lang.String[] getArguments()
          Gets the Arguments attribute of the CallbackHolder object
 java.lang.Object getCallbackObject()
           
 java.lang.String getExternalCallName()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.String getMethodDescription()
           
 java.lang.String getMethodName()
           
protected  DataItem[] getResultValues(java.lang.reflect.Method meth, java.lang.Object result)
          Extract the elements of a result array into the individual elements.
 void setArgumentDescriptions(java.lang.String[] someDescriptions)
          Set the argument descriptions
 void setArguments(java.lang.String[] someArguments)
          Set the unvalidated arguments
 void setCallbackObject(java.lang.Object aCallbackObject)
          Set the callback object
 void setExternalCallName(java.lang.String anExternalCallName)
          Set the name of the external call.
 void setMethod(java.lang.reflect.Method aMethod)
          Sets the Method attribute of the CallbackHolder object
 void setMethodDescription(java.lang.String aMethodDescription)
          Set the method description string.
 void setMethodName(java.lang.String aMethodName)
          Set the mthod name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackHolder

public CallbackHolder(java.lang.Object callbackObject,
                      java.lang.String externalCallName,
                      java.lang.String methodName,
                      java.lang.String methodDescription,
                      java.lang.String[] arguments,
                      java.lang.String[] argumentDescriptions)
Constructor that initializes the CallbackHolder.

Parameters:
callbackObject - The target of the reflected invocation.
externalCallName - String The unique name identifying this command.
methodName - String The name of the method to invoke.
methodDescription - String A nice description of the method.
arguments - String [] Fully qualified class names.
argumentDescriptions -
Method Detail

setArgumentDescriptions

public void setArgumentDescriptions(java.lang.String[] someDescriptions)
Set the argument descriptions

Parameters:
someDescriptions - The new ArgumentDescriptions value

setArguments

public void setArguments(java.lang.String[] someArguments)
Set the unvalidated arguments

Parameters:
someArguments - The new Arguments value

setCallbackObject

public void setCallbackObject(java.lang.Object aCallbackObject)
Set the callback object

Parameters:
aCallbackObject - The new CallbackObject value

setExternalCallName

public void setExternalCallName(java.lang.String anExternalCallName)
Set the name of the external call. This is the name of the command that the remote client knows about.

Parameters:
anExternalCallName - The new ExternalCallName value

setMethod

public void setMethod(java.lang.reflect.Method aMethod)
Sets the Method attribute of the CallbackHolder object

Parameters:
aMethod - The new Method value

setMethodDescription

public void setMethodDescription(java.lang.String aMethodDescription)
Set the method description string.

Parameters:
aMethodDescription - The new MethodDescription value

setMethodName

public void setMethodName(java.lang.String aMethodName)
Set the mthod name

Parameters:
aMethodName - The new MethodName value

getResultValues

protected DataItem[] getResultValues(java.lang.reflect.Method meth,
                                     java.lang.Object result)
Extract the elements of a result array into the individual elements. Each element in the array will have a corresponding data item. If the method has a return type of a 'String' instead of an array, return an array of size 1 containing that string.

Parameters:
meth - The method we invoked.
result - The result of the invocation
Returns:
a collection of the result values.

getArgumentDescriptions

public java.lang.String[] getArgumentDescriptions()
Return the argument descriptions as a string array object

Returns:
The ArgumentDescriptions value

getArguments

public java.lang.String[] getArguments()
Gets the Arguments attribute of the CallbackHolder object

Returns:
The Arguments value

getCallbackObject

public java.lang.Object getCallbackObject()
Returns:
The object upon which this callback will be invoked.

getExternalCallName

public java.lang.String getExternalCallName()
Returns:
String The name under which this command is registered.

getMethod

public java.lang.reflect.Method getMethod()
Returns:
the Method object that was determined from the getCallbackMethod method.
See Also:
#getCallbackMethod(CallbackHolder)

getMethodDescription

public java.lang.String getMethodDescription()
Returns:
The MethodDescription value

getMethodName

public java.lang.String getMethodName()
Returns:
The MethodName value

executeCommand

public Command executeCommand(Command command)
Execute the method of the callback object contained in the callbackHolder

Parameters:
command -
Returns: