Rio Project 4.2 API Documentation



org.rioproject.bean
Class BeanDelegator

java.lang.Object
  extended by org.rioproject.bean.BeanDelegator
All Implemented Interfaces:
Serializable, InvocationHandler

public class BeanDelegator
extends Object
implements InvocationHandler, Serializable

An InvocationHandler that delegates method calls between the BeanAdapter and the bean

Author:
Dennis Reedy
See Also:
Serialized Form

Method Summary
static Object getInstance(Object service, Object bean, Class[] interfaces)
          Get an instance of the BeanDelegator using the ClassLoader of the bean parameter to define the proxy class
static Object getInstance(Object service, Object bean, Class[] interfaces, ClassLoader loader)
          Get an instance of the BeanDelegator
 Object invoke(Object proxy, Method method, Object[] args)
          Perform the invocation, directing the method request to the appropriate implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Object getInstance(Object service,
                                 Object bean,
                                 Class[] interfaces)
Get an instance of the BeanDelegator using the ClassLoader of the bean parameter to define the proxy class

Parameters:
service - The service, must not be null
bean - The bean, must not be null
interfaces - The interfaces to expose, must not be null
Returns:
An object suitable for use as a proxy. A new proxy will be created each time
Throws:
NullPointerException - if any of the parameters is null
IllegalArgumentException - If the interfaces parameter has a zero length

getInstance

public static Object getInstance(Object service,
                                 Object bean,
                                 Class[] interfaces,
                                 ClassLoader loader)
Get an instance of the BeanDelegator

Parameters:
service - The service, must not be null
bean - The bean, must not be null
interfaces - The interfaces to expose, must not be null
loader - The class loader to define the proxy class
Returns:
An object suitable for use as a proxy. A new proxy will be created each time
Throws:
NullPointerException - if any of the parameters is null
IllegalArgumentException - If the interfaces parameter has a zero length

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Perform the invocation, directing the method request to the appropriate implementation

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable
See Also:
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.