ref_send API 2.17
defensive programming in Java

org.joe_e.reflect
Class Proxies

java.lang.Object
  extended by org.joe_e.reflect.Proxies

public final class Proxies
extends java.lang.Object

The dynamic proxy interface. This is a wrapper around Java's dynamic proxy features provided by java.lang.reflect.Proxy.


Method Summary
static java.lang.reflect.InvocationHandler getHandler(java.lang.reflect.Proxy proxy)
          Extract the InvocationHandler from a Proxy
static boolean isImplementable(java.lang.Class<?> type)
          Returns true if the argument is an interface that can be implemented by a Proxy using proxy().
static java.lang.Object proxy(java.lang.reflect.InvocationHandler handler, java.lang.Class<?>... interfaces)
          Constructs a dynamic proxy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandler

public static java.lang.reflect.InvocationHandler getHandler(java.lang.reflect.Proxy proxy)
Extract the InvocationHandler from a Proxy

Parameters:
proxy - proxy instance
Returns:
the invocation handler for the proxy

proxy

public static java.lang.Object proxy(java.lang.reflect.InvocationHandler handler,
                                     java.lang.Class<?>... interfaces)
                              throws java.lang.ClassCastException
Constructs a dynamic proxy.

Parameters:
handler - invocation handler
interfaces - each implemented interface
Returns:
dynamic proxy
Throws:
java.lang.ClassCastException - a restriction on the types is violated
java.lang.NullPointerException - an argument is null

isImplementable

public static boolean isImplementable(java.lang.Class<?> type)
Returns true if the argument is an interface that can be implemented by a Proxy using proxy().

Parameters:
type - candidate interface
Returns:
true if a Joe-E type, else false

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.