net.sf.crispy.proxy
Class DynamicProxy

java.lang.Object
  extended bynet.sf.crispy.proxy.Proxy
      extended bynet.sf.crispy.proxy.DynamicProxy
Direct Known Subclasses:
CommonsProxyFactory, DynamicJdkProxy

public abstract class DynamicProxy
extends Proxy

Catch all method invocation. If Executer is registered, then delegate invocation to Executer. If not, the invoke the method invokeIfExecutorIsNull.

Author:
Linke

Field Summary
 
Fields inherited from class net.sf.crispy.proxy.Proxy
log
 
Constructor Summary
protected DynamicProxy()
           
 
Method Summary
 AsynchronousCallback getAsynchronousCallback()
           
 Executor getExecutor()
           
 InterceptorHandler getInterceptorHandler()
           
 int getMaxThreads()
           
 java.lang.String getPasswd()
           
 StaticProxy getStaticProxy()
           
 java.lang.String getUser()
           
 java.lang.Object invoke(java.lang.Object pvProxy, java.lang.reflect.Method pvMethod, java.lang.Object[] pvArgs)
          Delegate invocation to the InvocationHandler.
protected  java.lang.Object invokeIfExecutorIsNull(java.lang.Object pvProxy, java.lang.reflect.Method pvMethod, java.lang.Object[] pvArgs, java.lang.Object pvElseObject)
          If not Executor is set.
 boolean isInvocationAsynchronous()
           
 boolean isMethodInFilter(java.lang.String pvMethodName)
           
 java.lang.Object newInstance(java.lang.Class pvClass)
           
 void setAsynchronousCallback(AsynchronousCallback pvAsynchronousCallback, java.lang.String[] pvMethodFilter, int pvMaxSizeOfThreads)
           
 void setExecutor(Executor pvExecutor)
           
 void setInterceptorHandler(InterceptorHandler pvInterceptorHandler)
           
 void setStaticProxy(StaticProxy pvStaticProxy)
           
 
Methods inherited from class net.sf.crispy.proxy.Proxy
createInvocationStrategy, getProperties, getProxyClass, getProxyObject, setProperties, setProxyClass, setProxyObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicProxy

protected DynamicProxy()
Method Detail

setExecutor

public void setExecutor(Executor pvExecutor)

getExecutor

public Executor getExecutor()

setInterceptorHandler

public void setInterceptorHandler(InterceptorHandler pvInterceptorHandler)

getInterceptorHandler

public InterceptorHandler getInterceptorHandler()

setStaticProxy

public void setStaticProxy(StaticProxy pvStaticProxy)

getStaticProxy

public StaticProxy getStaticProxy()

getUser

public java.lang.String getUser()

getPasswd

public java.lang.String getPasswd()

setAsynchronousCallback

public void setAsynchronousCallback(AsynchronousCallback pvAsynchronousCallback,
                                    java.lang.String[] pvMethodFilter,
                                    int pvMaxSizeOfThreads)

getAsynchronousCallback

public AsynchronousCallback getAsynchronousCallback()

getMaxThreads

public int getMaxThreads()

isInvocationAsynchronous

public boolean isInvocationAsynchronous()

newInstance

public java.lang.Object newInstance(java.lang.Class pvClass)
Specified by:
newInstance in class Proxy

isMethodInFilter

public boolean isMethodInFilter(java.lang.String pvMethodName)

invokeIfExecutorIsNull

protected java.lang.Object invokeIfExecutorIsNull(java.lang.Object pvProxy,
                                                  java.lang.reflect.Method pvMethod,
                                                  java.lang.Object[] pvArgs,
                                                  java.lang.Object pvElseObject)
                                           throws java.lang.Exception
If not Executor is set. It is the case, if StaticProxy is use in combination with DynamicProxy.

Throws:
java.lang.Exception

invoke

public java.lang.Object invoke(java.lang.Object pvProxy,
                               java.lang.reflect.Method pvMethod,
                               java.lang.Object[] pvArgs)
                        throws java.lang.Exception
Delegate invocation to the InvocationHandler.

Throws:
java.lang.Exception
See Also:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])


Copyright © 2005-2006 Crispy. All Rights Reserved.