{
String portletId = portletContext.getId();
if (!portletId.startsWith(PRODUCER_CLONE_ID_PREFIX))
{
log.debug("Attempt to destroy a producer offered portlet " + portletId);
DestroyCloneFailure failure = new DestroyCloneFailure(portletId, "Cannot destroy POP");
result.add(failure);
}
else
{
try
{
persistenceManager.destroyState(portletId.substring(PRODUCER_CLONE_ID_PREFIX.length()));
}
catch (NoSuchStateException e)
{
log.debug("Attempt to destroy a non existing portlet " + portletId);
DestroyCloneFailure failure = new DestroyCloneFailure(portletId, "Not found");
result.add(failure);
}
catch (InvalidStateIdException e)
{
log.debug("Attempt to destroy a non valid portlet " + portletId);
DestroyCloneFailure failure = new DestroyCloneFailure(portletId, "Invalid portlet id");
result.add(failure);
}
}
}
}