public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException { return safeGetNext().destroyClones(portletContexts); }
public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException { if (portletContexts == null) { throw new IllegalArgumentException("No null list accepted"); } if (portletContexts.size() == 0) { return Collections.emptyList(); } // Get the invoker and check that we address only one invoker (for now) PortletInvoker invoker = null; for (PortletContext compoundPortletContext : portletContexts) { PortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext); if (invoker == null) { invoker = federated; } else if (!invoker.equals(federated)) { throw new PortletInvokerException("Cannot destroy portlet lists that requires more than one federated invoker"); } } // return invoker.destroyClones(portletContexts); }
public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException { if (portletContexts == null) { throw new IllegalArgumentException("Null portlet id list not accepted"); } if (portletContexts.size() == 0) { return Collections.emptyList(); } // List<PortletContext> dereferencedList = new ArrayList<PortletContext>(portletContexts); for (int i = 0; i < dereferencedList.size(); i++) { PortletContext compoundPortletContext = dereferencedList.get(i); PortletContext portletContext = dereference(compoundPortletContext); dereferencedList.set(i, portletContext); } // List<DestroyCloneFailure> failures = portletInvoker.destroyClones(dereferencedList); for (int i = 0; i < failures.size(); i++) { DestroyCloneFailure failure = failures.get(i); String cloneId = failure.getPortletId(); failure = new DestroyCloneFailure(PortletContext.reference(id, PortletContext.createPortletContext(cloneId)).getId()); failures.set(i, failure); } // return failures; }