source: trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/MFCReplayDecorator.java @ 619

Last change on this file since 619 was 581, checked in by sherbold, 12 years ago
  • some updates to the assembly configuration
  • moved MFC plugin code from quest-ui-core to quest-plugin-mfc
  • Property svn:mime-type set to text/plain
File size: 2.0 KB
RevLine 
[434]1package de.ugoe.cs.quest.plugin.mfc;
[58]2
[432]3import de.ugoe.cs.quest.IReplayDecorator;
[58]4import de.ugoe.cs.util.StringTools;
5
[171]6/**
7 * <p>
8 * {@link IReplayDecorator} for replay generated for EventBench's MFCReplay tool.
9 * </p>
10 *
11 * @author Steffen Herbold
12 * @version 1.0
13 */
[58]14public class MFCReplayDecorator implements IReplayDecorator {
15
[87]16        /**
[171]17         * <p>
[87]18         * Id for object serialization.
[171]19         * </p>
[87]20         */
21        private static final long serialVersionUID = 1L;
[171]22
23        /**
24         * <p>
25         * The instance of the {@link MFCReplayDecorator} (implemented as
26         * singleton).
27         * </p>
28         */
[87]29        transient private static MFCReplayDecorator theInstance;
[171]30
31        /**
32         * <p>
33         * Constructor. Private to guarantee that only one instance of the replay
34         * generator exists.
35         * </p>
36         */
37        private MFCReplayDecorator() {
38        };
39
40        /**
41         * <p>
42         * Returns the instance of the MFCReplayDecorator.
43         * </p>
44         *
45         * @return instance of the MFCReplayDecorator.
46         */
[58]47        public static MFCReplayDecorator getInstance() {
[171]48                if (theInstance == null) {
[58]49                        theInstance = new MFCReplayDecorator();
50                }
51                return theInstance;
52        }
[171]53
54        /*
55         * (non-Javadoc)
56         *
[432]57         * @see de.ugoe.cs.quest.IReplayDecorator#getHeader()
[171]58         */
[58]59        @Override
60        public String getHeader() {
[171]61                return "<?xml version=\"1.0\" encoding=\"UTF-16\"?>"
62                                + StringTools.ENDLINE + "<log>" + StringTools.ENDLINE;
63
[58]64        }
65
[171]66        /*
67         * (non-Javadoc)
68         *
[432]69         * @see de.ugoe.cs.quest.IReplayDecorator#getFooter()
[171]70         */
[58]71        @Override
72        public String getFooter() {
73                return "</log>" + StringTools.ENDLINE;
74        }
75
[171]76        /*
77         * (non-Javadoc)
78         *
[432]79         * @see de.ugoe.cs.quest.IReplayDecorator#getSessionHeader(int)
[171]80         */
[58]81        @Override
[98]82        public String getSessionHeader(int sessionId) {
[171]83                return " <session id=\"" + sessionId + "\">" + StringTools.ENDLINE;
[58]84        }
85
[171]86        /*
87         * (non-Javadoc)
88         *
[432]89         * @see de.ugoe.cs.quest.IReplayDecorator#getSessionFooter(int)
[171]90         */
[58]91        @Override
[98]92        public String getSessionFooter(int sessionId) {
[58]93                return " </session>" + StringTools.ENDLINE;
94        }
95
96}
Note: See TracBrowser for help on using the repository browser.