com.ail.core.factory
Class BeanShellFactory
java.lang.Object
com.ail.core.factory.AbstractFactory
com.ail.core.factory.BeanShellFactory
public class BeanShellFactory
- extends AbstractFactory
Factory to creat class instances from BeanShell scripts embedded in configuration.
The simple contract is that a type configured to use this factory must define either
a "Script" or a "Url" parameter. The factory takes this parameter's value and either
uses it to download a script from in the case of Url, of uses it as the script itself
in the case of "Script".
The object referred to by "type" will be retured by the factory.
The type may optionally define a parameter called "extends" which names another type
whose proprtyies should be merged into this type's properties. See Type.mergeDonorIntoSubject(Type, Type, Core)
for a description of the rules applied during the merge. If "extends" is defined, then
the object created by this script will be merged with the object created by core.newType([extends]).
In the following sample of configuration a base type called "OtherVersion" defines a
type by means of the CastorBuilder. The NewVersion type "extends" OtherVersion (see the
extends parameter) and then modifies the type altering the Source property.
<type name="OtherVersion" builder="CastorBuilder" key="com.ail.core.Version">
<patameter name="script"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<version serialVersion='0' lock='false' xsi:type='java:com.ail.core.Version' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
<source>Peach and mint</source>
<state>state</state>
<date>14/10/2002</date>
<author>T.S.Elliot</author>
<comment>The loganberry's are sweet</comment>
<copyright>Copyright us.</copyright>
<version>1.0</version>
</version>
]]></parameter>
</type>
<type name="NewVersion" builder="BeanShellBuilder" key="com.ail.core.Version">
<parameter name="extends">OtherVersion</parameter>
<patameter name="script"><![CDATA[
type=new com.ail.core.Version();
type.setSource("peach and lemon");
]]></parameter>
</type>
- Version:
- $Revision: 1.8 $
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanShellFactory
public BeanShellFactory()