org.apache.avalon.excalibur.proxy
クラス DynamicProxy

java.lang.Object
  |
  +--org.apache.avalon.excalibur.proxy.DynamicProxy
すべての実装インタフェース:
java.lang.reflect.InvocationHandler

public final class DynamicProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

This makes a dynamic proxy for an object. The object can be represented by one, some of all of it's interfaces. Amongst other things, it's an anti hackinge measure. Suitable armed code could have case an interface for a thing back to it's impl and used methods and properties that were not it's authors intention. Reflection too allows some powerful introspection things and some traversal even more things including private member vars by a serialisation trick... hence the transient.

導入されたバージョン:
4.0b5
バージョン:
CVS $Revision: 1.5 $ $Date: 2001/12/11 09:53:32 $
作成者:
Peter Donald, Paul Hammant

メソッドの概要
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Invoke the specified method on underlying object.
static java.lang.Object newInstance(java.lang.Object object)
          Create a proxy object that has all of it's underlying interfaces implemented by proxy.
static java.lang.Object newInstance(java.lang.Object object, java.lang.Class[] interfaces)
          Create a proxy object that has specified interfaces implemented by proxy.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

newInstance

public static java.lang.Object newInstance(java.lang.Object object)
Create a proxy object that has all of it's underlying interfaces implemented by proxy.
パラメータ:
object - the underling object to proxy
戻り値:
the proxied object

newInstance

public static java.lang.Object newInstance(java.lang.Object object,
                                           java.lang.Class[] interfaces)
Create a proxy object that has specified interfaces implemented by proxy.
パラメータ:
object - the underling object to proxy
戻り値:
the proxied object

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invoke the specified method on underlying object. This is called by proxy object.
定義:
インタフェース java.lang.reflect.InvocationHandler 内の invoke
パラメータ:
proxy - the proxy object
method - the method invoked on proxy object
args - the arguments supplied to method
戻り値:
the return value of method
例外:
java.lang.Throwable - if an error occurs


"Copyright ? 2001 Apache Jakarta Project. All Rights Reserved."