}
public Set<Portlet> getPortlets() throws PortletInvokerException
{
Set<Portlet> portlets = new HashSet<Portlet>(super.getPortlets());
Registration registration = RegistrationLocal.getRegistration();
if (registration != null)
{
// add all the portlets that the current Registration knows about to the set of offered portlets
Set<PortletContext> contexts = registration.getKnownPortletContexts();
for (PortletContext context : contexts)
{
try
{
portlets.add(super.getPortlet(context));
}
catch (NoSuchPortletException e)
{
final RegistrationSPI registrationSPI = getRegistrationAsSPI();
try
{
registrationSPI.removePortletContext(context);
log.debug("Removed '" + context + "' from Registration '" + registration.getRegistrationHandle() + "' because it cannot be resolved anymore.");
}
catch (RegistrationException e1)
{
throw new PortletInvokerException(e1);
}