1 | package de.uka.ipd.sdq.pcmsolver.handler; |
2 | |
3 | import de.uka.ipd.sdq.pcm.seff.ForkAction; |
4 | import de.uka.ipd.sdq.pcm.seff.ForkedBehaviour; |
5 | import de.uka.ipd.sdq.pcm.seff.SynchronisationPoint; |
6 | import de.uka.ipd.sdq.pcmsolver.visitors.SeffVisitor; |
7 | |
8 | public class ForkActionHandler { |
9 | private SeffVisitor visitor; |
10 | |
11 | public ForkActionHandler(SeffVisitor seffVisitor) { |
12 | visitor = seffVisitor; |
13 | } |
14 | |
15 | public void handle(ForkAction fork) { |
16 | for (ForkedBehaviour behaviour : fork |
17 | .getAsynchronousForkedBehaviours_ForkAction()) { |
18 | visitor.doSwitch(behaviour); |
19 | } |
20 | SynchronisationPoint synch = fork |
21 | .getSynchronisingBehaviours_ForkAction(); |
22 | if (synch != null) { |
23 | for (ForkedBehaviour behaviour : synch |
24 | .getSynchronousForkedBehaviours_SynchronisationPoint()) { |
25 | visitor.doSwitch(behaviour); |
26 | } |
27 | } |
28 | } |
29 | } |