public class ProxyFactory
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
| static <P> P | newProxy(java.lang.Class<P> type,
        P delegate)Create a new  of the given type. | 
| static <P> P | newSoftProxy(java.lang.Class<P> type,
            P delegate)Create a new  of the given type. | 
| static <P> P | newSoftProxy(java.lang.Class<P> type,
            P delegate,
            Operator runWhenNull)Create a new  of the given type. | 
| static <P> P | newSoftProxy(java.lang.Class<P> type,
            P delegate,
            java.lang.Runnable runWhenNull)Deprecated. 
 | 
| static <P> P | newWeakProxy(java.lang.Class<P> type,
            P delegate)Create a new  of the given type. | 
| static <P> P | newWeakProxy(java.lang.Class<P> type,
            P delegate,
            Operator runWhenNull)Create a new  of the given type. | 
| static <P> P | newWeakProxy(java.lang.Class<P> type,
            P delegate,
            java.lang.Runnable runWhenNull)Deprecated. 
 | 
public static <P> P newProxy(java.lang.Class<P> type,
                             P delegate)
ProxyP - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedProxypublic static <P> P newWeakProxy(java.lang.Class<P> type,
                                 P delegate)
ProxyThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedProxy@Deprecated
public static <P> P newWeakProxy(java.lang.Class<P> type,
                                             P delegate,
                                             java.lang.Runnable runWhenNull)
newWeakProxy(Class, Object, Operator)ProxyRunnableThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedrunWhenNull - will be executed when the reference to the delegate has 
 been clearedProxypublic static <P> P newWeakProxy(java.lang.Class<P> type,
                                 P delegate,
                                 Operator runWhenNull)
ProxyRunnableThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedrunWhenNull - will be invoked with the created proxy instance when 
 the reference to the delegate has been clearedProxypublic static <P> P newSoftProxy(java.lang.Class<P> type,
                                 P delegate)
ProxyThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedProxy@Deprecated
public static <P> P newSoftProxy(java.lang.Class<P> type,
                                             P delegate,
                                             java.lang.Runnable runWhenNull)
newSoftProxy(Class, Object, Operator)ProxyRunnableThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedrunWhenNull - will be executed when the reference to the delegate has 
 been clearedProxypublic static <P> P newSoftProxy(java.lang.Class<P> type,
                                 P delegate,
                                 Operator runWhenNull)
ProxyRunnableThis may be useful for providing a proxy to an event listener, so that the object to which the listener proxy is added won't hold a hard reference to the delegate itself thereby reducing potential memory issues and freeing the programmer from the job of determining the best opportunity to remove the listener.
P - the parameterized typetype - the type to be implemented by the returned proxy (must be an 
 interface type)delegate - the implementation to which method invocations will be 
 forwardedrunWhenNull - will be invoked with the created proxy instance when 
 the reference to the delegate has been clearedProxy