1 | package de.uka.ipd.sdq.pcm.transformations.builder.infrastructure; |
2 | |
3 | import de.uka.ipd.sdq.pcm.repository.OperationInterface; |
4 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
5 | import de.uka.ipd.sdq.pcm.transformations.builder.seff.DelegatorComponentSeffBuilder; |
6 | import de.uka.ipd.sdq.pcm.transformations.builder.seff.StaticInternalActionDescriptor; |
7 | import de.uka.ipd.sdq.pcm.transformations.builder.util.PCMAndCompletionModelHolder; |
8 | |
9 | public class DelayMiddlewareComponentBuilder extends |
10 | BasicMiddlewareComponentBuilder { |
11 | |
12 | private String demandStoEx; |
13 | |
14 | public DelayMiddlewareComponentBuilder(PCMAndCompletionModelHolder models, |
15 | OperationInterface providedIf, OperationInterface requiredIf, |
16 | OperationInterface middlewareInterface, ResourceContainer container, |
17 | String demandStoEx) { |
18 | super(models, providedIf, requiredIf, middlewareInterface, container, "DelayMiddlewareComponent"); |
19 | if (demandStoEx == null) |
20 | throw new IllegalArgumentException("Stoex cannot be null"); |
21 | this.demandStoEx = demandStoEx; |
22 | } |
23 | |
24 | @Override |
25 | protected DelegatorComponentSeffBuilder getSeffBuilder() { |
26 | DelegatorComponentSeffBuilder builder = super.getSeffBuilder(); |
27 | builder.appendPreAction(new StaticInternalActionDescriptor(demandStoEx,findResourceType("cpu"))); |
28 | builder.appendPostAction(new StaticInternalActionDescriptor(demandStoEx,findResourceType("cpu"))); |
29 | return builder; |
30 | } |
31 | |
32 | } |