// Hate doing this, but it's the only way to deal with persistent application state...
ExoContainer container = ExoContainerContext.getCurrentContainer();
if (container instanceof PortalContainer) {
DataStorage ds = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
try {
S s = ds.load(existing, type);
String contentId = ds.getId(existing);
return new TransientApplicationState<S>(contentId, s);
} catch (Exception e) {
throw new RuntimeException("Exception copying persistent application state.", e);