LowRA API Documentation Annexes |  All Packages |  All Classes |  Index |  Frames
IoC context Pre processing  
 

Summary

  1. Overview
  2. ContextProcessor objects
  3. Pre processor node
  4. Pre Processor adapter
  5. Pre Processing summary

 

Overview

LowRA offers tools to apply pre processing jobs on the IoC xml context using ApplicationLoader features.
Pre processing jobs may also be defined using directly the xml context file, let's show how it work.
Welcome to dynamic pre processing system.

 

ContextProcessor objects

LowRA implements a ContextProcessor interface to define basic rules for xml context preprocessing.
Each processor you want to implement must implement this interface.
Take a look at a context processor sample :

package com.project
{
	import com.bourre.ioc.context.processor.ContextProcessor;

	public class CustomProcessor implements ContextProcessor
{ public function CustomProcessor( ...args ) { } public function process( xml : XML ) : XML { //do preprocessing on passed-in xml content here. return xml; } } }

 

 

PreProcessor node

Instead of using hard coded pre processing ( ApplicationLoader.addProcessingMethod() or ApplicationLoader.addProcessor() ), IoC context support preprocessor node definition.

A preprocessor node must be named : <preprocessor>

Preprocessor node support :

When processor objet is built, the method "process" ( from ContextProcessor interface ) is called.
Here is different preprocessor node definitions :

<beans>
<preprocessor type="com.project.CustomProcessor" />
</beans>
<beans>
<preprocessor type="com.project.CustomProcessor" url="customProcessorDLL.swf" />
</beans>
<beans>
<preprocessor type="com.project.CustomProcessor" url="customProcessorDLL.swf">
<argument value="something" /> <argument value="something else" />
</preprocessor>
</beans>

 

PreProcessor adapter

Adapter allow to use no ContextProcessor compliant processor to do preprocessing job.
So, processor doesn't need to implement the LowRA interface, but must implement a method which :

Example :

package com.project
{
	public class AdpaterProcessor
{ public function AdpaterProcessor( ...args ) { } public function run( xml : XML ) : XML { //do preprocessing on passed-in xml content here. return xml; } } }

To use adapter, just set the method attribute to define the name of the method to call on processor.

<beans>
<preprocessor type="com.project.AdpaterProcessor" url="AdpaterProcessorDLL.swf" method="run" />
</beans>

 

Pre Processing summary

LowRA offers differents tools for pre processing, here is the order of pre processing treatments :

  1. ApplicationLoader.addProcessingMethod() job
  2. ApplicationLoader.addProcessor() job
  3. Context preprocessor job

And then... IoC context is parsed.