// Marshal ApplicationState
ApplicationState<Portlet> state = portletApplication.getState();
// Marshal application state
String contentId;
Portlet portlet;
// If transient we have all the information we need
if (state instanceof TransientApplicationState) {
TransientApplicationState<Portlet> transientApplicationState = (TransientApplicationState<Portlet>) state;
contentId = transientApplicationState.getContentId();
portlet = transientApplicationState.getContentState();