Package | jfraboni.easybake |
Interface | public interface IBatch extends jfraboni.epitome.IDestroyable |
Implementors | Batch |
Property | Defined By | ||
---|---|---|---|
behaviours : Vector.<IInterceptor> [read-only]
Returns a Clone of the Vector of IInterceptor, the collection of AOP behaviour to be applied to
all proxied-instances in the batch. | IBatch |
Method | Defined By | ||
---|---|---|---|
addBatchCompleteHandler(handler:Function):IBatch
Handler is auto removed, added once only per proxy batch being baked. | IBatch | ||
addBehaviour(interceptor:IInterceptor):IBatch
Add any object instance that implements org.as3commons.bytecode.interception.IInterceptor to define AOP
behaviour for the proxied instance. | IBatch | ||
Takes a Class to be proxied in the batch. | IBatch | ||
After adding all definitions to the batch via addType(), add an onBatchComplete handler via
addBatchCompleteHandler(), then call bake(). | IBatch | ||
createInstance(Type:Class, ... constructorArgs):*
As long as the Batch as been baked with the given Type definition, returns a generated-proxied
instance of the Type. | IBatch | ||
getBehaviour(Type:Class):IInterceptor
Returns the instance of the IInterceptor by its type. | IBatch | ||
getClassProxyInfo(Type:Class):IClassProxyInfo | IBatch |
behaviours | property |
behaviours:Vector.<IInterceptor>
[read-only] Returns a Clone of the Vector of IInterceptor, the collection of AOP behaviour to be applied to all proxied-instances in the batch.
public function get behaviours():Vector.<IInterceptor>
addBatchCompleteHandler | () | method |
public function addBatchCompleteHandler(handler:Function):IBatch
Handler is auto removed, added once only per proxy batch being baked. Handlers must implement signature: function onBatchComplete(batch:IBatch){ //...; }
Parameters
handler:Function |
IBatch |
addBehaviour | () | method |
public function addBehaviour(interceptor:IInterceptor):IBatch
Add any object instance that implements org.as3commons.bytecode.interception.IInterceptor to define AOP behaviour for the proxied instance. Example:
// ...other code in Class ... // public function intercept(invocation:IMethodInvocation):void { switch(invocation.kind){ case InvocationKind.CONSTRUCTOR: trace("{0} was instantiated", invocation.targetInstance); break; case InvocationKind.METHOD: trace("{0} was invoked with parameter {0}", invocation.targetMember, invocation.arguments[0]); break; } } } // ...other code in Class ... //
Parameters
interceptor:IInterceptor |
IBatch — fluent interface.
|
addType | () | method |
public function addType(Type:Class):IBatch
Takes a Class to be proxied in the batch. It is recommended to only include Classes of similar type in the batch, as the added behaviour will be applied to all proxied-instances in the batch created from the batch.
Parameters
Type:Class — Any Class.
|
IBatch — fluent interface.
|
bake | () | method |
public function bake():IBatch
After adding all definitions to the batch via addType(), add an onBatchComplete handler via addBatchCompleteHandler(), then call bake(). This will load the load the proxied Classes, and onBatchComplete instances of the Classes can be created by calling createInstance(MyClass).
ReturnsIBatch — fluent interface.
|
createInstance | () | method |
public function createInstance(Type:Class, ... constructorArgs):*
As long as the Batch as been baked with the given Type definition, returns a generated-proxied instance of the Type.
Parameters
Type:Class — The Class to be proxied - must have already been baked into the Batch.
| |
... constructorArgs — ...rest style constructor arguments of the Type, if required.
|
* — An instance of the proxied Type.
|
getBehaviour | () | method |
public function getBehaviour(Type:Class):IInterceptor
Returns the instance of the IInterceptor by its type.
Parameters
Type:Class — The Class of the IInterceptor
|
IInterceptor — The instance of the IInterceptor, if mapped.
|
getClassProxyInfo | () | method |
public function getClassProxyInfo(Type:Class):IClassProxyInfo
Parameters
Type:Class |
IClassProxyInfo |