Class org.as2lib.env.reflect.TypeProxyFactory

Implemented Interfaces

ProxyFactory

Description

TypeProxyFactory creates proxies of types, that means classes or interfaces.

If you know that you only need interface proxies you could think of using InterfaceProxyFactory because it offers better performance.

Method Index

createProxy()

Inherited from BasicClass

Method Detail

createProxy

public function createProxy(type:Function, handler:InvocationHandler)

Creates proxies for the passed-in type, that are classes and interfaces.

You can cast the returned proxy to the passed-in type.

null will be returned if the passed-in type is null or undefined.

This proxy catches method invocations by creating proxy methods for every method of the type that forward the invocations to the handler. Unknown, that means not declared or implemented methods are catched by __resolve.

Note that also methods that are not declared on the type but get invoked on the proxy, are forwarded to the passed-in handler.

Parameters

typethe type to create the proxy for
handlerthe handler to invoke on proxy method invocations

Return

the created type proxy

Specified By

createProxy() in org.as2lib.env.reflect.ProxyFactory