ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "Destroying a Consumer");
WSRPConsumer consumer = getConsumer(id);
if (consumer != null)
{
ProducerInfo info = consumer.getProducerInfo();
try
{
consumer.releaseSessions();
}
catch (PortletInvokerException e)
{
log.debug("releaseSessions failed when attempting to destroy " + CONSUMER_WITH_ID + id + "'");
}
// if the consumer is registered, deregister it
if (info.isRegistered())
{
registerOrDeregisterConsumerWith(id, false);
}
deactivateConsumer(consumer);