1 | package de.uka.ipd.sdq.pcm.transformations.builder.infrastructure; |
2 | |
3 | import de.uka.ipd.sdq.pcm.repository.Interface; |
4 | import de.uka.ipd.sdq.pcm.repository.OperationInterface; |
5 | import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole; |
6 | import de.uka.ipd.sdq.pcm.repository.RequiredRole; |
7 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
8 | import de.uka.ipd.sdq.pcm.transformations.builder.abstractbuilder.BasicComponentBuilder; |
9 | import de.uka.ipd.sdq.pcm.transformations.builder.seff.DelegatorComponentSeffBuilder; |
10 | import de.uka.ipd.sdq.pcm.transformations.builder.seff.MiddlewareComponentSeffBuilder; |
11 | import de.uka.ipd.sdq.pcm.transformations.builder.util.PCMAndCompletionModelHolder; |
12 | |
13 | public class BasicMiddlewareComponentBuilder extends BasicComponentBuilder |
14 | implements IMiddlewareInteractingComponentBuilder { |
15 | |
16 | protected OperationInterface middleware; |
17 | private OperationRequiredRole myRequiredMiddlewareInterface; |
18 | |
19 | |
20 | public BasicMiddlewareComponentBuilder(PCMAndCompletionModelHolder models, |
21 | OperationInterface providedIf, OperationInterface requiredIf, OperationInterface middlewareInterface, |
22 | ResourceContainer container, String componentName) { |
23 | super(models, providedIf, requiredIf, container, componentName); |
24 | |
25 | middleware = middlewareInterface; |
26 | } |
27 | |
28 | @Override |
29 | public void build() { |
30 | myRequiredMiddlewareInterface = addOperationRequiredRole(middleware,"Middleware"); |
31 | super.build(); |
32 | } |
33 | |
34 | @Override |
35 | protected DelegatorComponentSeffBuilder getSeffBuilder(){ |
36 | return new MiddlewareComponentSeffBuilder(getOperationProvidedRole(),getOperationRequiredRole(),getMiddlewareRole()); |
37 | } |
38 | |
39 | public OperationRequiredRole getMiddlewareRole() { |
40 | return myRequiredMiddlewareInterface; |
41 | } |
42 | |
43 | } |