1 | package de.uka.ipd.sdq.pcm.transformations.builder.connectors; |
2 | |
3 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyConnector; |
4 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
5 | import de.uka.ipd.sdq.pcm.transformations.builder.IComponentBuilder; |
6 | import de.uka.ipd.sdq.pcm.transformations.builder.infrastructure.IMiddlewareInteractingComponentBuilder; |
7 | import de.uka.ipd.sdq.pcm.transformations.builder.infrastructure.MiddlewareCallingComponentBuilder; |
8 | import de.uka.ipd.sdq.pcm.transformations.builder.util.PCMAndCompletionModelHolder; |
9 | |
10 | /** |
11 | * Implementation of an InnerConnectorCompletionBuilder which calls a process service on the client side, |
12 | * forwards the message, calls deprocess on the server side, and does the same in reverse order for the |
13 | * reply |
14 | * @author Snowball |
15 | * |
16 | */ |
17 | public class PairwiseMiddlewareInteractingInnerConnectorCompletionBuilder |
18 | extends AbstractClientServerConnectorCompletionBuilder { |
19 | |
20 | private String processCallSignature; |
21 | private String unprocessCallSignature; |
22 | |
23 | public PairwiseMiddlewareInteractingInnerConnectorCompletionBuilder( |
24 | PCMAndCompletionModelHolder models, |
25 | AssemblyConnector connector, |
26 | ResourceContainer fromResourceContainer, |
27 | ResourceContainer toResourceContainer, |
28 | IComponentBuilder innerBuilder, |
29 | String processCallSignature, |
30 | String unprocessCallSignature) { |
31 | super(models, connector, fromResourceContainer, toResourceContainer, innerBuilder, |
32 | "PairwiseMiddlewareInteractingInnerConnectorCompletion"); |
33 | this.processCallSignature = processCallSignature; |
34 | this.unprocessCallSignature = unprocessCallSignature; |
35 | } |
36 | |
37 | /** |
38 | * By default, a dummy component is created which does nothing besides delegating the call. |
39 | * Override if more actions are needed |
40 | * @return |
41 | */ |
42 | @Override |
43 | protected IMiddlewareInteractingComponentBuilder createClientSideBuilder() { |
44 | MiddlewareCallingComponentBuilder builder = new MiddlewareCallingComponentBuilder( |
45 | myModels, |
46 | this.connectorToReplace.getRequiredRole_AssemblyConnector().getRequiredInterface__OperationRequiredRole(), |
47 | this.connectorToReplace.getRequiredRole_AssemblyConnector().getRequiredInterface__OperationRequiredRole(), |
48 | this.middlewareInterface, |
49 | this.fromResourceContainer, |
50 | processCallSignature, |
51 | unprocessCallSignature); |
52 | |
53 | return builder; |
54 | } |
55 | |
56 | /** |
57 | * By default, a dummy component is created which does nothing besides delegating the call. |
58 | * Override if more actions are needed |
59 | * @return |
60 | */ |
61 | @Override |
62 | protected IMiddlewareInteractingComponentBuilder createServerSideBuilder() { |
63 | MiddlewareCallingComponentBuilder builder = new MiddlewareCallingComponentBuilder( |
64 | myModels, |
65 | this.connectorToReplace.getRequiredRole_AssemblyConnector().getRequiredInterface__OperationRequiredRole(), |
66 | this.connectorToReplace.getRequiredRole_AssemblyConnector().getRequiredInterface__OperationRequiredRole(), |
67 | this.middlewareInterface, |
68 | this.toResourceContainer, |
69 | unprocessCallSignature, |
70 | processCallSignature); |
71 | |
72 | return builder; |
73 | } |
74 | } |