Rio Project 4.2 API Documentation
org.rioproject.bean
Class BeanHelper
java.lang.Object
org.rioproject.bean.BeanHelper
public class BeanHelper
- extends Object
A utility class that assists in invoking bean lifecycle events, either using
annotations or declared method names
- Author:
- Dennis Reedy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanHelper
public BeanHelper()
invokeLifeCycle
public static void invokeLifeCycle(Class<? extends Annotation> annClass,
String methodName,
Object bean)
throws Exception
- Invoke a lifecycle method
- Parameters:
annClass - The annotation class to usemethodName - The lifecycle method name to invoke if the annotation
is not foundbean - The bean to invoke methods on
- Throws:
Exception - of errors occur
invokeBeanMethod
public static Object invokeBeanMethod(Object bean,
Class<? extends Annotation> annClass,
String methodName,
Class[] classArgs,
Object[] objectArgs)
throws Exception
- Helper to invoke a method on the bean using reflection
- Parameters:
bean - The bean to act onannClass - The annotation class to usemethodName - The method nameclassArgs - Class argumentsobjectArgs - Object argument
- Returns:
- The result of dispatching the method
- Throws:
Exception - If errors occur
getMethodFirstParamType
public static Class getMethodFirstParamType(String methodName,
Object o)
getMethodFirstParamType
public static Class getMethodFirstParamType(Method method)
getAnnotatedMethod
public static Method getAnnotatedMethod(Object bean,
Class<? extends Annotation> annClass)
Copyright © 2006-2011 Rio Project. All Rights Reserved.