EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.transformations.builder.resourceconsumer]

COVERAGE SUMMARY FOR SOURCE FILE [NetworkLoadingComponentBuilder.java]

nameclass, %method, %block, %line, %
NetworkLoadingComponentBuilder.java0%   (0/1)0%   (0/3)0%   (0/59)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NetworkLoadingComponentBuilder0%   (0/1)0%   (0/3)0%   (0/59)0%   (0/14)
NetworkLoadingComponentBuilder (PCMAndCompletionModelHolder, OperationInterfa... 0%   (0/1)0%   (0/26)0%   (0/7)
build (): void 0%   (0/1)0%   (0/7)0%   (0/3)
getSeffBuilder (): DelegatorComponentSeffBuilder 0%   (0/1)0%   (0/26)0%   (0/4)

1package de.uka.ipd.sdq.pcm.transformations.builder.resourceconsumer;
2 
3import org.apache.log4j.Logger;
4 
5import de.uka.ipd.sdq.pcm.repository.OperationInterface;
6import de.uka.ipd.sdq.pcm.resourceenvironment.LinkingResource;
7import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer;
8import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentFactory;
9import de.uka.ipd.sdq.pcm.resourcetype.CommunicationLinkResourceType;
10import de.uka.ipd.sdq.pcm.transformations.builder.abstractbuilder.BasicComponentBuilder;
11import de.uka.ipd.sdq.pcm.transformations.builder.seff.DelegatorComponentSeffBuilder;
12import de.uka.ipd.sdq.pcm.transformations.builder.seff.StaticInternalActionDescriptor;
13import de.uka.ipd.sdq.pcm.transformations.builder.util.PCMAndCompletionModelHolder;
14 
15/**
16 * Generates a BasicComponent which determines and loads the underlying network resource with the message's size of the message to transmit.
17 * Respects both requesting service and returning from service.
18 * Assumes that the message size is contained in the variable stream.BYTESIZE. 
19 * 
20 * @author Steffen
21 *
22 */
23public class NetworkLoadingComponentBuilder extends BasicComponentBuilder {
24 
25        private Logger logger = Logger.getLogger(NetworkLoadingComponentBuilder.class);
26        private CommunicationLinkResourceType typeOfLink;
27 
28        /**
29         * Constructor of the network load simulator component
30         * @param models Container for the PCM model instance to modify
31         * @param interf Interface of the component, used to delgate the method calls to its target
32         * @param linkingRes The linking resource on which the load is created
33         */
34        public NetworkLoadingComponentBuilder(
35                        PCMAndCompletionModelHolder models,
36                        OperationInterface interf, 
37                        LinkingResource linkingRes) {
38                super(models, interf, null, "NetworkLoadingComponent");
39                
40                typeOfLink = linkingRes.getCommunicationLinkResourceSpecifications_LinkingResource().getCommunicationLinkResourceType_CommunicationLinkResourceSpecification();
41                ResourceContainer dummyContainer = ResourceenvironmentFactory.eINSTANCE.createResourceContainer();
42                dummyContainer.setId(linkingRes.getId());
43                
44                this.container = dummyContainer;
45        }
46 
47        /**
48         * Returns a SEFF builder which adds a network demand depending on the parameters passed
49         */
50        @Override
51        protected DelegatorComponentSeffBuilder getSeffBuilder() {
52                DelegatorComponentSeffBuilder builder = new DelegatorComponentSeffBuilder(getOperationProvidedRole(),getOperationRequiredRole());
53 
54                // Network demand for the Request
55                builder.appendPreAction(new StaticInternalActionDescriptor("stream.BYTESIZE", typeOfLink));
56                
57                // Network demand for the Reply
58                builder.appendPostAction(new StaticInternalActionDescriptor("stream.BYTESIZE", typeOfLink));
59                return builder;
60        }
61 
62        @Override
63        public void build() {
64                logger.info("Creating a component to simulate network loads");
65                super.build();
66        }
67}

[all classes][de.uka.ipd.sdq.pcm.transformations.builder.resourceconsumer]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov