com.aurorasoftworks.signal.runtime.core.context.proxy
Interface IProxyFactory

All Known Implementing Classes:
ProxyFactory

public interface IProxyFactory

A factory for AOP proxies. Proxies can only be created for classes that implement IProxyTarget and are used in a context file that is processed by a context generator.

Author:
Marek

Method Summary
 IProxy createLazyInitProxy(IBeanDelegate reference)
          Creates a lazy init proxy for the specified bean reference.
 IProxy createProxy(IProxyTarget target, IInvocationHandler handler)
          Creates a new proxy for the specified object.
 IProxy createProxy(IProxyTarget target, IMethodInterceptor[] interceptors)
          Creates a new proxy for the specified object using the specified interceptors.
 IProxyClass getProxyClass(java.lang.Class targetClass)
          Returns an IProxyClass object for the specified class.
 

Method Detail

createProxy

IProxy createProxy(IProxyTarget target,
                   IInvocationHandler handler)
                   throws java.lang.Exception
Creates a new proxy for the specified object. All method calls are forwarded to the provided handler. Depending on how the handler is implemented calls may or may not be invoked on the target object. This method is similar to Proxy.newProxyInstance(ClassLoader, Class[], java.lang.reflect.InvocationHandler).

Parameters:
target - an object to create a proxy for
handler - an invocation handler to forward intercepted method calls to
Returns:
value to be returned by the intercepted call
Throws:
java.lang.Exception

createProxy

IProxy createProxy(IProxyTarget target,
                   IMethodInterceptor[] interceptors)
                   throws java.lang.Exception
Creates a new proxy for the specified object using the specified interceptors. This method creates a sequence of method invocation handlers that contains the specified interceptors and the target object at the end. Each handler in the chain can choose whether to forward the call to the next handler or not.

Parameters:
target - an object to create a proxy for
interceptors - an array of method interceptors
Returns:
Throws:
java.lang.Exception

createLazyInitProxy

IProxy createLazyInitProxy(IBeanDelegate reference)
                           throws java.lang.Exception
Creates a lazy init proxy for the specified bean reference. When any method is invoked on the returned proxy the bean wrapped by the reference is created by calling IBeanReference#getBean().

Parameters:
reference - a bean reference to be wrapped by a lazy init proxy
Returns:
a lazy init proxy
Throws:
java.lang.Exception

getProxyClass

IProxyClass getProxyClass(java.lang.Class targetClass)
                          throws java.lang.Exception
Returns an IProxyClass object for the specified class.

Parameters:
targetClass - a class to return a proxy class for
Returns:
proxy class
Throws:
java.lang.Exception


Copyright © 2010. All Rights Reserved.