Changeset 88 for trunk/EventBenchConsole
- Timestamp:
- 06/23/11 14:52:42 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/data/GlobalDataContainer.java
r1 r88 1 1 package de.ugoe.cs.eventbench.data; 2 2 3 import java.io.IOException; 4 import java.io.ObjectInputStream; 5 import java.io.ObjectOutputStream; 6 import java.io.Serializable; 3 7 import java.util.HashMap; 4 8 import java.util.Map; 5 9 6 public class GlobalDataContainer {10 public class GlobalDataContainer implements Serializable { 7 11 8 private static GlobalDataContainer theInstance= null; 12 /** 13 * Id for object serialization. 14 */ 15 private static final long serialVersionUID = 1L; 16 17 transient private static GlobalDataContainer theInstance = null; 9 18 10 19 private Map<String, Object> dataObjects; … … 14 23 theInstance = new GlobalDataContainer(); 15 24 } 25 return theInstance; 26 } 27 28 private void writeObject(ObjectOutputStream s) throws IOException { 29 s.defaultWriteObject(); 30 s.writeObject(dataObjects); 31 } 32 33 @SuppressWarnings("unchecked") 34 private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { 35 s.defaultReadObject(); 36 if( theInstance==null ) { 37 theInstance = new GlobalDataContainer(); 38 } 39 theInstance.dataObjects = (Map<String, Object>) s.readObject(); 40 } 41 42 private Object readResolve() { 16 43 return theInstance; 17 44 }
Note: See TracChangeset
for help on using the changeset viewer.