com.thoughtworks.proxy.toys.hotswap
Class HotSwapping

java.lang.Object
  extended by com.thoughtworks.proxy.toys.hotswap.HotSwapping

public class HotSwapping
extends Object

Factory for proxy instances that allow to exchange the delegated instance. Every created proxy will implement Swappable, that is used for the hot swap operation.

Since:
0.1
Author:
Dan North
See Also:
com.thoughtworks.proxy.toys.hotswap

Method Summary
static Object object(Class[] types, ProxyFactory proxyFactory, Object delegate, boolean staticTyping)
          Deprecated. since 0.2, use object(Class[], ProxyFactory, Object, int)
static Object object(Class[] types, ProxyFactory proxyFactory, Object delegate, int delegationMode)
          Create a proxy with hot swapping capabilities for specifiy types of the delegate.
static Object object(Class[] types, ProxyFactory proxyFactory, ObjectReference objectReference, boolean staticTyping)
          Deprecated. since 0.2, use object(Class[], ProxyFactory, ObjectReference, int)
static Object object(Class[] types, ProxyFactory proxyFactory, ObjectReference objectReference, int delegationMode)
          Create a proxy with hot swapping capabilities for specifiy types of the delegate given with an ObjectReference.
static Object object(Class type, ProxyFactory proxyFactory, Object delegate)
          Create a proxy with hot swapping capability for a specific type and API compatible delegates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

object

public static Object object(Class type,
                            ProxyFactory proxyFactory,
                            Object delegate)
Create a proxy with hot swapping capability for a specific type and API compatible delegates. The delegate does not have to implement the type of the proxy unless it has signature compatible methods.

Parameters:
type - the type of the proxy
proxyFactory - the ProxyFactory to use
delegate - the delegated object
Returns:
the created proxy implementing the type and Swappable
Since:
0.1

object

public static Object object(Class[] types,
                            ProxyFactory proxyFactory,
                            Object delegate,
                            int delegationMode)
Create a proxy with hot swapping capabilities for specifiy types of the delegate. The delegate must implement the given types, if the invoker's delegation mode is Delegating.MODE_DIRECT, for Delegating.MODE_SIGNATURE it must only have signature compatible methods with same names.

Parameters:
types - the types of the proxy
proxyFactory - the ProxyFactory to use
delegate - the delegated object
delegationMode - one of the delegation modes of Delegating
Returns:
the created proxy implementing the types and Swappable
Since:
0.2

object

public static Object object(Class[] types,
                            ProxyFactory proxyFactory,
                            Object delegate,
                            boolean staticTyping)
Deprecated. since 0.2, use object(Class[], ProxyFactory, Object, int)

Create a proxy with hot swapping capabilities for specifiy types of the delegate. The delegate must implement the given types, if the invoker is in static typing mode, otherwise it must only have signature compatible methods.

Parameters:
types - the types of the proxy
proxyFactory - the ProxyFactory to use
delegate - the delegated object
staticTyping - STATIC_TYPING or DYNAMIC_TYPING
Returns:
the created proxy implementing the types and Swappable
Since:
0.1

object

public static Object object(Class[] types,
                            ProxyFactory proxyFactory,
                            ObjectReference objectReference,
                            int delegationMode)
Create a proxy with hot swapping capabilities for specifiy types of the delegate given with an ObjectReference. The delegate must implement the given types, if the invoker's delegation mode is Delegating.MODE_DIRECT, for Delegating.MODE_SIGNATURE it must only have signature compatible methods with same names.

Parameters:
types - the types of the proxy
proxyFactory - the ProxyFactory to use
objectReference - the ObjectReference with the delegate
delegationMode - one of the delegation modes of Delegating
Returns:
the created proxy implementing the types and Swappable
Since:
0.2

object

public static Object object(Class[] types,
                            ProxyFactory proxyFactory,
                            ObjectReference objectReference,
                            boolean staticTyping)
Deprecated. since 0.2, use object(Class[], ProxyFactory, ObjectReference, int)

Create a proxy with hot swapping capabilities for specifiy types of the delegate given with an ObjectReference. The delegate must implement the given types, if the invoker is in static typing mode, otherwise it must only have signature compatible methods.

Parameters:
types - the types of the proxy
proxyFactory - the ProxyFactory to use
objectReference - the ObjectReference with the delegate
staticTyping - STATIC_TYPING or DYNAMIC_TYPING
Returns:
the created proxy implementing the types and Swappable
Since:
0.1