PortletStateMapping psm = getState();
String portletId = psm.getPortletID();
if (psm.getPortletID().equals(portletId))
{
PortletStateContextImpl context = new PortletStateContextImpl(getPersistentKey(), portletId, psm.getPropertiesAsPropertyMap());
context.getState().setTerminationTime(psm.getTerminationTime());
return context;
}
else
{
throw new IllegalStateException("PortletStateContext's portlet id is '" + psm.getPortletID()