com.hammurapi.config
Interface Factory

All Superinterfaces:
CommonObject, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier
All Known Subinterfaces:
Collection, Map, MethodCall, Named, NamedCollection, NamedMap, NamedObjectDefinition, NamedReference, NamedScript, Null, ObjectDefinition, Reference, Script
All Known Implementing Classes:
CollectionImpl, MapImpl, MethodCallImpl, NamedCollectionImpl, NamedMapImpl, NamedObjectDefinitionImpl, NamedReferenceImpl, NamedScriptImpl, NullImpl, ObjectDefinitionImpl, ReferenceImpl, ScriptImpl

public interface Factory
extends CommonObject

A representation of the model object 'Factory'. Creates an object which can be further configured (except Null) and referenced.

The following features are supported:

See Also:
ConfigPackage.getFactory()

Method Summary
 void compile(org.eclipse.emf.common.util.EList<String> profilePath, TokenExpander.TokenSource tokens, ClassLoader classLoader, File dir, String targetPackage, String targetClass)
          Compiles configuration to Java source file.
 FactoryClosure<Object> create(FactoryConfig factoryConfig)
          Instantiates and configures a Java object.
 String getConfigScript()
          Returns the value of the 'Config Script' attribute.
 String getDescription()
          Returns the value of the 'Description' attribute.
 String getHomePage()
          Returns the value of the 'Home Page' attribute.
 String getId()
          Returns the value of the 'Id' attribute.
 org.eclipse.emf.common.util.EList<String> getService()
          Returns the value of the 'Service' attribute list.
 org.eclipse.emf.common.util.EList<Source> getSource()
          Returns the value of the 'Source' containment reference list.
 org.eclipse.emf.common.util.EList<String> getSupportedExecutionEnvironments()
          Returns the value of the 'Supported Execution Environments' attribute list.
 boolean isEnabled()
          Returns the value of the 'Enabled' attribute.
 void setConfigScript(String value)
          Sets the value of the 'Config Script' attribute.
 void setDescription(String value)
          Sets the value of the 'Description' attribute.
 void setEnabled(boolean value)
          Sets the value of the 'Enabled' attribute.
 void setHomePage(String value)
          Sets the value of the 'Home Page' attribute.
 void setId(String value)
          Sets the value of the 'Id' attribute.
 
Methods inherited from interface com.hammurapi.party.CommonObject
getRoles
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getDescription

String getDescription()
Returns the value of the 'Description' attribute. Object description.

Returns:
the value of the 'Description' attribute.
See Also:
setDescription(String), ConfigPackage.getFactory_Description()

setDescription

void setDescription(String value)
Sets the value of the 'Description' attribute.

Parameters:
value - the new value of the 'Description' attribute.
See Also:
getDescription()

getConfigScript

String getConfigScript()
Returns the value of the 'Config Script' attribute. 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)

Returns:
the value of the 'Config Script' attribute.
See Also:
setConfigScript(String), ConfigPackage.getFactory_ConfigScript()

setConfigScript

void setConfigScript(String value)
Sets the value of the 'Config Script' attribute.

Parameters:
value - the new value of the 'Config Script' attribute.
See Also:
getConfigScript()

getId

String getId()
Returns the value of the 'Id' attribute. 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.

Returns:
the value of the 'Id' attribute.
See Also:
setId(String), ConfigPackage.getFactory_Id()

setId

void setId(String value)
Sets the value of the 'Id' attribute.

Parameters:
value - the new value of the 'Id' attribute.
See Also:
getId()

getSource

org.eclipse.emf.common.util.EList<Source> getSource()
Returns the value of the 'Source' containment reference list. The list contents are of type Source. Object defintion can have zero or more sources.

Returns:
the value of the 'Source' containment reference list.
See Also:
ConfigPackage.getFactory_Source()

isEnabled

boolean isEnabled()
Returns the value of the 'Enabled' attribute. The default value is "true". If this attribute is set to false, given definition is skipped during configuration. Setting this attribute to false is like commenting out the definition.

Returns:
the value of the 'Enabled' attribute.
See Also:
setEnabled(boolean), ConfigPackage.getFactory_Enabled()

setEnabled

void setEnabled(boolean value)
Sets the value of the 'Enabled' attribute.

Parameters:
value - the new value of the 'Enabled' attribute.
See Also:
isEnabled()

getService

org.eclipse.emf.common.util.EList<String> getService()
Returns the value of the 'Service' attribute list. The list contents are of type String. 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.

Returns:
the value of the 'Service' attribute list.
See Also:
ConfigPackage.getFactory_Service()

getSupportedExecutionEnvironments

org.eclipse.emf.common.util.EList<String> getSupportedExecutionEnvironments()
Returns the value of the 'Supported Execution Environments' attribute list. The list contents are of type String. Versions of Java supported by given factory.

Returns:
the value of the 'Supported Execution Environments' attribute list.
See Also:
ConfigPackage.getFactory_SupportedExecutionEnvironments()

getHomePage

String getHomePage()
Returns the value of the 'Home Page' attribute. URL of component's home page with additional information.

Returns:
the value of the 'Home Page' attribute.
See Also:
setHomePage(String), ConfigPackage.getFactory_HomePage()

setHomePage

void setHomePage(String value)
Sets the value of the 'Home Page' attribute.

Parameters:
value - the new value of the 'Home Page' attribute.
See Also:
getHomePage()

create

FactoryClosure<Object> create(FactoryConfig factoryConfig)
                              throws ConfigurationException
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:
factoryConfig - Factory configuration.
Throws:
ConfigurationException

compile

void compile(org.eclipse.emf.common.util.EList<String> profilePath,
             TokenExpander.TokenSource tokens,
             ClassLoader classLoader,
             File dir,
             String targetPackage,
             String targetClass)
             throws ConfigurationException
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:
profilePath - Profile path for compilation.
tokens - Expansion tokens.
classLoader - Class loader from which classes being used in the configuration script will be loaded for introspection during compilation. This class loader will be used as parent classloader for classloaders defined in the configuration file.
dir - Directory where to store generated files.
targetPackage - Target package for generated files.
targetClass - Target class name for generated file.
Throws:
ConfigurationException