org.apache.tuscany.sca.core.invocation
Class ExtensibleProxyFactory

java.lang.Object
  extended by org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory
All Implemented Interfaces:
ProxyFactory

public class ExtensibleProxyFactory
extends java.lang.Object
implements ProxyFactory

An extensible proxy factory.


Constructor Summary
ExtensibleProxyFactory(ProxyFactoryExtensionPoint proxyFactories)
           
 
Method Summary
<B,R extends org.osoa.sca.CallableReference<B>>
R
cast(B target)
          Cast a proxy to a CallableReference.
<T> T
createCallbackProxy(CallbackReferenceImpl<T> callbackReference)
          Creates a Java proxy for the given callback reference
<T> T
createCallbackProxy(java.lang.Class<T> interfaze, java.util.List<RuntimeWire> wires)
          Creates a Java proxy for the service contract callback
<T> T
createProxy(org.osoa.sca.CallableReference<T> callableReference)
          Creates a Java proxy for the given CallableReference
<T> T
createProxy(java.lang.Class<T> interfaze, RuntimeWire wire)
          Creates a Java proxy for the given wire
 boolean isProxyClass(java.lang.Class<?> clazz)
          Test if a given class is a generated proxy class by this factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensibleProxyFactory

public ExtensibleProxyFactory(ProxyFactoryExtensionPoint proxyFactories)
Method Detail

cast

public <B,R extends org.osoa.sca.CallableReference<B>> R cast(B target)
                                                 throws java.lang.IllegalArgumentException
Description copied from interface: ProxyFactory
Cast a proxy to a CallableReference.

Specified by:
cast in interface ProxyFactory
Parameters:
target - a proxy generated by this implementation
Returns:
a CallableReference (or subclass) equivalent to this proxy
Throws:
java.lang.IllegalArgumentException - if the object supplied is not a proxy
See Also:
ProxyFactory.cast(java.lang.Object)

createCallbackProxy

public <T> T createCallbackProxy(java.lang.Class<T> interfaze,
                                 java.util.List<RuntimeWire> wires)
                      throws ProxyCreationException
Description copied from interface: ProxyFactory
Creates a Java proxy for the service contract callback

Specified by:
createCallbackProxy in interface ProxyFactory
Parameters:
interfaze - the interface the proxy should implement
Returns:
the proxy
Throws:
ProxyCreationException
See Also:
ProxyFactory.createCallbackProxy(java.lang.Class, java.util.List)

createProxy

public <T> T createProxy(org.osoa.sca.CallableReference<T> callableReference)
              throws ProxyCreationException
Description copied from interface: ProxyFactory
Creates a Java proxy for the given CallableReference

Specified by:
createProxy in interface ProxyFactory
Parameters:
callableReference - The CallableReference
Returns:
the proxy
Throws:
ProxyCreationException

createCallbackProxy

public <T> T createCallbackProxy(CallbackReferenceImpl<T> callbackReference)
                      throws ProxyCreationException
Description copied from interface: ProxyFactory
Creates a Java proxy for the given callback reference

Specified by:
createCallbackProxy in interface ProxyFactory
Returns:
the proxy
Throws:
ProxyCreationException

createProxy

public <T> T createProxy(java.lang.Class<T> interfaze,
                         RuntimeWire wire)
              throws ProxyCreationException
Description copied from interface: ProxyFactory
Creates a Java proxy for the given wire

Specified by:
createProxy in interface ProxyFactory
Parameters:
interfaze - the interface the proxy implements
wire - the wire to proxy
Returns:
the proxy
Throws:
ProxyCreationException
See Also:
ProxyFactory.createProxy(java.lang.Class, org.apache.tuscany.sca.runtime.RuntimeWire)

isProxyClass

public boolean isProxyClass(java.lang.Class<?> clazz)
Description copied from interface: ProxyFactory
Test if a given class is a generated proxy class by this factory

Specified by:
isProxyClass in interface ProxyFactory
Parameters:
clazz - A java class or interface
Returns:
true if the class is a generated proxy class by this factory
See Also:
ProxyFactory.isProxyClass(java.lang.Class)