Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Static Private Attributes

de.axbench.transformers.aspects.Weaver Class Reference

Weaves model elements regarding their relations. More...

List of all members.

Public Member Functions

Model weave (Model theModelToWeave, String theAspectComposition)
 Weaves the given model acoording to the composition and returns the woven model.
Model weaveModel (Model theModelToWeave, AspectComposition theAspectComposition) throws AXLException
 Weaves the model according to the given aspect mapping.
 Weaver ()
 Constructor setting the operation parameters.

Static Public Attributes

static final String ID_IN_ASPECTCOMPOSITION = "aspectcomposition"
 identifier of the aspect composition
static final String ID_IN_MODEL = "axlmodel"
 identifier of the element to weave
static final String ID_OUT_MODEL = "axlwoven"
 identifier of the woven model

Protected Member Functions

Map< String, Object > executeConcreteOperation (Map< String, Object > theInputParameters)
 Weaves the model according to the given aspect mapping.

Private Member Functions

void createSystemApplicationmodel (Model theModel, Collection< AbstractArchitectureModel > cllApplicationModels) throws AXLException
 Create new applicationmodel with all elements of the applicationmodels of the composition.
void executeWeavingAlgorithm (List< AspectRelation > lstAspectRelations) throws AXLException
 Executes the weaving algorithm.
void identifyElement (IAXLangElement theSourceElement, IAXLangElement theTargetElement, IGlobalInstance theSourceInstance, IGlobalInstance theTargetInstance) throws AXLException
 Identifies an element with another.
void identifyElement (SubComponentInstance theSourceInstance, SubComponentInstance theTargetInstance) throws AXLException
 Identifies a subcomponent instance with another.
void identifyElement (PortInstance theSourceInstance, PortInstance theTargetInstance) throws AXLException
 Identifies a port instance with another.
void identifyElement (IGlobalInstance theSourceInstance, IGlobalInstance theTargetInstance) throws AXLException
 Identifies an instance with another.
void moveElement (IAXLangElement theElementToMove, IAXLangElement theTargetElement, Role theRole, IGlobalInstance theSourceInstance, IGlobalInstance theTargetInstance) throws AXLException
 Moves an element from it's current position to another position.
void weaveIdentityRelation (AspectRelationIdentity theIdentityRelation) throws AXLException
 Weaves one identity relation.

Static Private Attributes

static final String IDENTIFIER_SYSMODEL = "systemmodel"
 identifier of the new system model
static final String IDENTIFIER_TOP = "SystemModelTop"
 identifier of the new system model top component

Detailed Description

Weaves model elements regarding their relations.

This operation implements the weaving algorithm described in my dissertation.


Constructor & Destructor Documentation

de.axbench.transformers.aspects.Weaver.Weaver (  ) 

Constructor setting the operation parameters.

Element input parameters:

  • model containing the elements to weave
  • selection of a aspect mapping Element output parameters:
  • model containing the woven model
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0

Member Function Documentation

void de.axbench.transformers.aspects.Weaver.createSystemApplicationmodel ( Model  theModel,
Collection< AbstractArchitectureModel cllApplicationModels 
) throws AXLException [private]

Create new applicationmodel with all elements of the applicationmodels of the composition.

Parameters:
theModel parent model
cllApplicationModels application models
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
Map<String, Object> de.axbench.transformers.aspects.Weaver.executeConcreteOperation ( Map< String, Object >  theInputParameters  )  [protected]

Weaves the model according to the given aspect mapping.

Parameters:
theInputParameters map of the input parameters (empty map or null allowed)
Returns:
map of the output parameters (empty map allowed)
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0

Reimplemented from de.fraunhofer.isst.axbench.api.operations.AbstractAXLOperation.

void de.axbench.transformers.aspects.Weaver.executeWeavingAlgorithm ( List< AspectRelation lstAspectRelations  )  throws AXLException [private]

Executes the weaving algorithm.

Weaving order defined by order of aspect relation collection:

  1. copy relations
  2. replace relations
  3. inner relations
  4. identity relations This is achieved by sorting the aspect relations with an according sorting algorithm.
    Todo:
    implement sorting algorithm

At the moment, the order of the relations is the same as the definition order in the aXLang file.

Parameters:
lstAspectRelations aspect relations to use
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.identifyElement ( IGlobalInstance  theSourceInstance,
IGlobalInstance  theTargetInstance 
) throws AXLException [private]

Identifies an instance with another.

  • children move: instantiated element
  • identification: instance
Parameters:
theSourceInstance source instance
theTargetInstance target instance
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.identifyElement ( IAXLangElement  theSourceElement,
IAXLangElement  theTargetElement,
IGlobalInstance  theSourceInstance,
IGlobalInstance  theTargetInstance 
) throws AXLException [private]

Identifies an element with another.

  1. move all children from source to target element
  2. identify source and target element
Parameters:
theSourceElement source element
theTargetElement target element
theSourceInstance source instance
theTargetInstance target instance
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.identifyElement ( PortInstance  theSourceInstance,
PortInstance  theTargetInstance 
) throws AXLException [private]

Identifies a port instance with another.

  • identify used data elements with target port's component's data elements (copy if not already present)
  • children move: instantiated element
  • identification: instance
Parameters:
theSourceInstance source instance
theTargetInstance target instance
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.identifyElement ( SubComponentInstance  theSourceInstance,
SubComponentInstance  theTargetInstance 
) throws AXLException [private]

Identifies a subcomponent instance with another.

  • children move: component type
  • identification: instance
Parameters:
theSourceInstance source instance
theTargetInstance target instance
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.moveElement ( IAXLangElement  theElementToMove,
IAXLangElement  theTargetElement,
Role  theRole,
IGlobalInstance  theSourceInstance,
IGlobalInstance  theTargetInstance 
) throws AXLException [private]

Moves an element from it's current position to another position.

  1. detach element from parent
  2. find new identifier if old identifier is used already
  3. add element to new parent
  4. update references (important for instances only, the other references are updated automatically because the element stays the same)
Parameters:
theElementToMove element to move
theTargetElement target element
theRole the role, the element is in (and will be)
theSourceInstance source instance
theTargetInstance target instance
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
Model de.axbench.transformers.aspects.Weaver.weave ( Model  theModelToWeave,
String  theAspectComposition 
)

Weaves the given model acoording to the composition and returns the woven model.

This method is a convenience method for using the Weaver.

Usage (create object in order to access the generated messages):

Weaver theWeaver = new Weaver();
Model theWovenModel = theWeaver.weave(axlModel, sCompositionName);
theWeaver.getAXLMessages(MessageType.ERROR);

Usage (no access to the generated messages):

Model theWovenModel = theWeaver.weave(axlModel, sCompositionName);
if (theWovenModel != null) {
	...
}
Parameters:
theModelToWeave model to weave
theAspectComposition name of the aspect composition
Returns:
woven model
Return values:
null if errors occured
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
void de.axbench.transformers.aspects.Weaver.weaveIdentityRelation ( AspectRelationIdentity  theIdentityRelation  )  throws AXLException [private]

Weaves one identity relation.

Parameters:
theIdentityRelation identity relation
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0
Model de.axbench.transformers.aspects.Weaver.weaveModel ( Model  theModelToWeave,
AspectComposition  theAspectComposition 
) throws AXLException

Weaves the model according to the given aspect mapping.

  1. create new applicationmodel with all elements of the applicationmodels of the composition
  2. collect all aspect mappings and execute weaving algorithm
  3. remove composition and used mappings
Parameters:
theModelToWeave model to weave
theAspectComposition aspect composition
Returns:
woven model
Exceptions:
AXLException if an error occurred
Author:
ekleinod
Version:
0.9.0
Since:
0.9.0

Member Data Documentation

final String de.axbench.transformers.aspects.Weaver.ID_IN_ASPECTCOMPOSITION = "aspectcomposition" [static]

identifier of the aspect composition

final String de.axbench.transformers.aspects.Weaver.ID_IN_MODEL = "axlmodel" [static]

identifier of the element to weave

final String de.axbench.transformers.aspects.Weaver.ID_OUT_MODEL = "axlwoven" [static]

identifier of the woven model

final String de.axbench.transformers.aspects.Weaver.IDENTIFIER_SYSMODEL = "systemmodel" [static, private]

identifier of the new system model

final String de.axbench.transformers.aspects.Weaver.IDENTIFIER_TOP = "SystemModelTop" [static, private]

identifier of the new system model top component