interface

Factory

extends CommonObject

All supertypes

All Subtypes

Creates an object which can be further configured (except Null) and referenced.

Attributes

Name Type Cardinality Description
configScript EString 0..1 Fragment of Java code to perform advanced configuration of the object. This code is invoked after declarative configuration is complete. The code shall be a body of void method with the following parameters (Object instance, FactoryConfig config)
description EString 0..1 Object description.
enabled EBoolean 0..1 If this attribute is set to false, given definition is skipped during configuration. Setting this attribute to false is like commenting out the definition.
homePage EString 0..1 URL of component's home page with additional information.
id EString 0..1 Object id to use in references. If this attribute is not blank, FactoryConfig shall provie mutable context or ConfigurationException will be thrown at instantiation time. Referenced objects shall be declared before they are first used.
service EString * Values in this attribute are names of service interfaces which this object exposes. Configuration framework registers created object in the context if the context is mutable. If the context is immutable, a configuration exception is thrown.
supportedExecutionEnvironments EString * Versions of Java supported by given factory.

Operations summary

Name Cardinality Description
compile( profilePath : EString , tokens : ETokenSource , classLoader : EClassLoader , dir : File , targetPackage : EString , targetClass : EString ) 0..1 Compiles configuration to Java source file.
create( factoryConfig : EFactoryConfig ) : EFactoryClosure 0..1 Instantiates and configures a Java object.

References

Name Target Containment Cardinality Opposite Description
source Source Yes * Object defintion can have zero or more sources.

Operations

compile

Compiles configuration to Java source file. Applies profiles, expands tokens, verifies configuration correctness. The compiled source file shall be further compiled with java compiler to produce configuration class to be used at runtime. This compiled file doesn't have dependency on EMF, XML and Janino.

Parameters

Throws


create

Instantiates and configures a Java object. Returns factory result instance which contains instantiated/configured object and an instance of Destroyable, which shall be used to destroy resources held by the instantiated object and its parts when it is no longer needed.

Parameters

Returns EFactoryClosure [0..1]

Throws