ch.ralscha.extdirectspring.util
Class ExtDirectSpringUtil

java.lang.Object
  extended by ch.ralscha.extdirectspring.util.ExtDirectSpringUtil

public class ExtDirectSpringUtil
extends java.lang.Object

Utility class

Author:
mansari, Ralph Schaer

Method Summary
static boolean equal(java.lang.Object a, java.lang.Object b)
          Checks if two objects are equal.
static MethodInfo findMethodInfo(org.springframework.context.ApplicationContext context, java.lang.String beanName, java.lang.String methodName)
          Retrieves a methodInfo from a method in a spring managed bean.
static java.lang.Object invoke(org.springframework.context.ApplicationContext context, java.lang.String beanName, MethodInfo methodInfo, java.lang.Object[] params)
          Invokes a method on a Spring managed bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equal

public static boolean equal(java.lang.Object a,
                            java.lang.Object b)
Checks if two objects are equal. Returns true if both objects are null

Parameters:
a - object one
b - object two
Returns:
true if objects are equal

findMethodInfo

public static MethodInfo findMethodInfo(org.springframework.context.ApplicationContext context,
                                        java.lang.String beanName,
                                        java.lang.String methodName)
Retrieves a methodInfo from a method in a spring managed bean. The found method will be cached in MethodInfoCache with the key beanName,methodName

Parameters:
context - Spring application context
beanName - name of the bean to find the method in
methodName - name of the method to retrieve
Returns:
the method
Throws:
java.lang.IllegalArgumentException - if the method is not annotated with a ExtDirectSpring annotation or there is no method in the bean

invoke

public static java.lang.Object invoke(org.springframework.context.ApplicationContext context,
                                      java.lang.String beanName,
                                      MethodInfo methodInfo,
                                      java.lang.Object[] params)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException
Invokes a method on a Spring managed bean.

Parameters:
context - a Spring application context
beanName - the name of the bean
methodInfo - the methodInfo object
params - the parameters
Returns:
the result of the method invokation
Throws:
java.lang.IllegalArgumentException - if there is no bean in the context
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException


Copyright © 2010-2011. All Rights Reserved.