package at.gv.egovernment.moa.id.storage; import java.util.HashMap; import java.util.Map; import at.gv.egovernment.moa.id.util.Random; public class ExceptionStoreImpl implements IExceptionStore { // Just a quick implementation private static IExceptionStore store; public static IExceptionStore getStore() { if(store == null) { store = new ExceptionStoreImpl(); } return store; } private Map exceptionStore = new HashMap(); public String storeException(Throwable e) { String id = Random.nextRandom(); exceptionStore.put(id, e); return id; } public Throwable fetchException(String id) { return exceptionStore.get(id); } public void removeException(String id) { exceptionStore.remove(id); } }