1 | package de.uka.ipd.sdq.pcm.transformations.builder.seff; |
2 | |
3 | import java.util.ArrayList; |
4 | import java.util.Collection; |
5 | |
6 | import de.uka.ipd.sdq.pcm.parameter.VariableUsage; |
7 | import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole; |
8 | import de.uka.ipd.sdq.pcm.repository.OperationSignature; |
9 | import de.uka.ipd.sdq.pcm.repository.RequiredRole; |
10 | import de.uka.ipd.sdq.pcm.repository.Signature; |
11 | import de.uka.ipd.sdq.pcm.seff.AbstractAction; |
12 | import de.uka.ipd.sdq.pcm.seff.ExternalCallAction; |
13 | import de.uka.ipd.sdq.pcm.seff.SeffFactory; |
14 | |
15 | public class ExternalCallActionDescriptor extends AbstractActionDescriptor { |
16 | |
17 | private OperationSignature signature; |
18 | private OperationRequiredRole requiredRole; |
19 | private Collection<VariableUsage> parameter; |
20 | private Collection<VariableUsage> outParameter; |
21 | |
22 | public ExternalCallActionDescriptor(OperationSignature sig, OperationRequiredRole role, Collection<VariableUsage> inParameter) { |
23 | this(sig,role,inParameter,null); |
24 | this.outParameter = new ArrayList<VariableUsage>(); |
25 | } |
26 | |
27 | public ExternalCallActionDescriptor(OperationSignature sig, OperationRequiredRole role, Collection<VariableUsage> inParameter, Collection<VariableUsage> outParameter) { |
28 | this.signature = sig; |
29 | this.requiredRole = role; |
30 | this.parameter = inParameter; |
31 | this.outParameter = outParameter; |
32 | } |
33 | |
34 | @Override |
35 | public AbstractAction createAction() { |
36 | ExternalCallAction call = SeffFactory.eINSTANCE.createExternalCallAction(); |
37 | call.setCalledService_ExternalService(this.signature); |
38 | call.setRole_ExternalService(this.requiredRole); |
39 | call.setEntityName("ExternalCall"); |
40 | call.getInputVariableUsages__CallAction().addAll(getInputParameter()); |
41 | call.getReturnVariableUsage__CallReturnAction().addAll(getOutputParameter()); |
42 | |
43 | return call; |
44 | } |
45 | |
46 | protected Collection<VariableUsage> getInputParameter(){ |
47 | return parameter; |
48 | } |
49 | |
50 | protected Collection<VariableUsage> getOutputParameter(){ |
51 | return outParameter; |
52 | } |
53 | } |