Package org.gatein.pc.api.state

Examples of org.gatein.pc.api.state.DestroyCloneFailure


      //
      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;
View Full Code Here


         {
            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);
               }
            }
         }
      }
View Full Code Here

      if (registration != null)
      {
         for (PortletContext portletContext : portletContexts)
         {
            // only remove the portlet context if there are no failures or it's not part of the failed clones
            if (noFailures || !cloneFailures.contains(new DestroyCloneFailure(portletContext.getId())))
            {
               try
               {
                  registration.removePortletContext(portletContext);
               }
View Full Code Here

         {
            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);
               }
            }
         }
      }
View Full Code Here

            {
               List<String> portletHandles = failure.getPortletHandles();
               String reason = failure.getReason().getValue();
               for (String portletHandle : portletHandles)
               {
                  result.add(new DestroyCloneFailure(portletHandle, reason));
                  if (log.isDebugEnabled())
                  {
                     log.debug("Couldn't destroy clone '" + portletHandles + "'");
                  }
               }
View Full Code Here

            result = new ArrayList<DestroyCloneFailure>(failures.size());
            // list all the failures and successes
            for (DestroyFailed failure : failures)
            {
               String handle = failure.getPortletHandle();
               result.add(new DestroyCloneFailure(handle, failure.getReason()));
               handles.remove(handle);
               log.debug("Couldn't destroy clone '" + handle + "'");
            }
         }
View Full Code Here

         {
            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);
               }
            }
         }
      }
View Full Code Here

         {
            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);
               }
            }
         }
      }
View Full Code Here

            {
               List<String> portletHandles = failure.getPortletHandles();
               String reason = failure.getReason().getValue();
               for (String portletHandle : portletHandles)
               {
                  result.add(new DestroyCloneFailure(portletHandle, reason));
                  if (log.isDebugEnabled())
                  {
                     log.debug("Couldn't destroy clone '" + portletHandles + "'");
                  }
               }
View Full Code Here

      if (registration != null)
      {
         for (PortletContext portletContext : portletContexts)
         {
            // only remove the portlet context if there are no failures or it's not part of the failed clones
            if (noFailures || !cloneFailures.contains(new DestroyCloneFailure(portletContext.getId())))
            {
               try
               {
                  registration.removePortletContext(portletContext);
               }
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.state.DestroyCloneFailure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.