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

COVERAGE SUMMARY FOR SOURCE FILE [LoadMiddlewareConfigurationIntoBlackboardJob.java]

nameclass, %method, %block, %line, %
LoadMiddlewareConfigurationIntoBlackboardJob.java0%   (0/1)0%   (0/5)0%   (0/112)0%   (0/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LoadMiddlewareConfigurationIntoBlackboardJob0%   (0/1)0%   (0/5)0%   (0/112)0%   (0/31)
LoadMiddlewareConfigurationIntoBlackboardJob (AbstractCodeGenerationWorkflowR... 0%   (0/1)0%   (0/16)0%   (0/6)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/85)0%   (0/20)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
rollback (IProgressMonitor): void 0%   (0/1)0%   (0/5)0%   (0/2)
setBlackboard (MDSDBlackboard): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.workflow.pcm.jobs;
2 
3import org.apache.log4j.Logger;
4import org.eclipse.core.runtime.IProgressMonitor;
5 
6import de.uka.ipd.sdq.workflow.IBlackboardInteractingJob;
7import de.uka.ipd.sdq.workflow.IJob;
8import de.uka.ipd.sdq.workflow.exceptions.JobFailedException;
9import de.uka.ipd.sdq.workflow.exceptions.RollbackFailedException;
10import de.uka.ipd.sdq.workflow.exceptions.UserCanceledException;
11import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard;
12import de.uka.ipd.sdq.workflow.mdsd.blackboard.ResourceSetPartition;
13import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractCodeGenerationWorkflowRunConfiguration;
14import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractPCMWorkflowRunConfiguration;
15 
16public class LoadMiddlewareConfigurationIntoBlackboardJob 
17implements IJob, IBlackboardInteractingJob<MDSDBlackboard> {
18 
19        private Logger logger = Logger.getLogger(LoadPCMModelsIntoBlackboardJob.class);
20        
21        public static final String MIDDLEWARE_PARTITION_ID = "de.uka.ipd.sdq.pcmmodels.partition.middleware";
22        public static final String EVENT_MIDDLEWARE_PARTITION_ID = "de.uka.ipd.sdq.pcmmodels.partition.eventmiddleware";
23 
24        private MDSDBlackboard blackboard = null;
25        private AbstractPCMWorkflowRunConfiguration configuration = null;
26 
27        public LoadMiddlewareConfigurationIntoBlackboardJob(AbstractCodeGenerationWorkflowRunConfiguration config) {
28                super();
29                
30                this.configuration  = config;
31        }
32 
33        public void execute(IProgressMonitor monitor) throws JobFailedException,
34                        UserCanceledException {
35                ResourceSetPartition middlewareRepositoryPartition = null;
36                if (!this.blackboard.hasPartition(MIDDLEWARE_PARTITION_ID)) {
37                        logger.debug("Creating Middleware Repository Partition");
38                        
39                        middlewareRepositoryPartition = new ResourceSetPartition();
40                        this.blackboard.addPartition(MIDDLEWARE_PARTITION_ID, middlewareRepositoryPartition);
41                        
42                        logger.debug("Initialising Middleware EPackages");
43                        middlewareRepositoryPartition.initialiseResourceSetEPackages(AbstractPCMWorkflowRunConfiguration.PCM_EPACKAGES);
44                } else {
45                        middlewareRepositoryPartition = this.blackboard.getPartition(MIDDLEWARE_PARTITION_ID);
46                }
47                middlewareRepositoryPartition.loadModel(configuration.getMiddlewareFile());
48                
49                // load event middleware 
50                ResourceSetPartition eventMiddlewareRepositoryPartition = null;
51                if (!this.blackboard.hasPartition(EVENT_MIDDLEWARE_PARTITION_ID)) {
52                        logger.debug("Creating Event Middleware Repository Partition");
53                        
54                        eventMiddlewareRepositoryPartition = new ResourceSetPartition();
55                        this.blackboard.addPartition(EVENT_MIDDLEWARE_PARTITION_ID, eventMiddlewareRepositoryPartition);
56                        
57                        logger.debug("Initialising Event Middleware EPackages");
58                        eventMiddlewareRepositoryPartition.initialiseResourceSetEPackages(AbstractPCMWorkflowRunConfiguration.PCM_EPACKAGES);
59                } else {
60                        eventMiddlewareRepositoryPartition = this.blackboard.getPartition(EVENT_MIDDLEWARE_PARTITION_ID);
61                }
62                if (configuration.getEventMiddlewareFile() != null) {
63                        eventMiddlewareRepositoryPartition.loadModel(configuration.getEventMiddlewareFile());
64                }
65        }
66 
67        public String getName() {
68                return "Load Middleware Configuration into Blackboard";
69        }
70 
71        public void rollback(IProgressMonitor monitor)
72                        throws RollbackFailedException {
73                this.blackboard.removePartition(MIDDLEWARE_PARTITION_ID);
74        }
75 
76        public void setBlackboard(MDSDBlackboard blackboard) {
77                this.blackboard = blackboard;
78        }
79 
80}

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