Package org.gatein.pc.api

Examples of org.gatein.pc.api.PortletInvokerException


               // reset cache to be able to see new offered portlets on the next refresh
               invalidateCache();
            }
            catch (Exception e)
            {
               throw new PortletInvokerException("Couldn't modify registration with producer '" + persistentId + "'", e);
            }
         }
      }
      else
      {
View Full Code Here


               binary = binaryAsString.getBytes("UTF-8");
            }
            catch (UnsupportedEncodingException e)
            {
               // shouldn't happen since UTF-8 is always supported...
               throw new PortletInvokerException("Couldn't convert binary as String.", e);
            }
         }
      }

      return createContentResponse(mimeResponse, invocation, null, null, mimeType, binary, markup, createCacheControl(mimeResponse));
View Full Code Here

         }
         catch (Exception e)
         {
            String message = "Couldn't release sessions " + idsToRelease;
            log.debug(message, e);
            throw new PortletInvokerException(message, e);
         }
      }
   }
View Full Code Here

               }
               catch (Exception e)
               {
                  persistentRegistrationInfo.resetRegistration();
                  setActive(false);
                  throw new PortletInvokerException("Couldn't register with producer '" + persistentId + "'", e);
               }
               finally
               {
                  registry.updateProducerInfo(this);
               }
            }
            else
            {
               log.debug(result.getStatus().toString());
               setActiveAndSave(false);
               throw new PortletInvokerException("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
            }
         }
      }

      return new RefreshResult(RefreshResult.Status.BYPASSED);
View Full Code Here

               new ArrayList<Extension>());
            log.info("Consumer with id '" + persistentId + "' deregistered.");
         }
         catch (Exception e)
         {
            throw new PortletInvokerException("Couldn't deregister with producer '" + persistentId + "'", e);
         }
         finally
         {
            resetRegistration();
         }
View Full Code Here

            // reset cache to be able to see new offered portlets on the next refresh
            invalidateCache();
         }
         catch (Exception e)
         {
            throw new PortletInvokerException("Couldn't modify registration with producer '" + persistentId + "'", e);
         }
         finally
         {
            registry.updateProducerInfo(this);
         }
View Full Code Here

         }
         catch (Exception e)
         {
            String message = "Couldn't release sessions " + idsToRelease;
            log.debug(message, e);
            throw new PortletInvokerException(message, e);
         }
      }
   }
View Full Code Here

      }

      WSRPPortlet original = getWSRPPortlet(portletContext);
      if (original == null)
      {
         throw new PortletInvokerException("No portlet '" + portletContext.getId() + "' to clone!");
      }

      try
      {
         Holder<String> handle = new Holder<String>();
         Holder<byte[]> portletState = new Holder<byte[]>();
         getPortletManagementService().clonePortlet(getRegistrationContext(),
            WSRPUtils.convertToWSRPPortletContext(portletContext), UserAccess.getUserContext(), handle, portletState,
            new Holder<List<Extension>>()
         );
         return WSRPUtils.convertToPortalPortletContext(handle.value, portletState.value);
      }
      catch (Exception e)
      {
         throw new PortletInvokerException("Couldn't clone portlet '" + portletContext.getId() + "'", e);
      }
   }
View Full Code Here

         return result;
      }
      catch (Exception e)
      {
         throw new PortletInvokerException("Couldn't destroy clones.", e);
      }
   }
View Full Code Here

      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(changes, "Property changes");

      WSRPPortlet portlet = getWSRPPortlet(portletContext);
      if (portlet == null)
      {
         throw new PortletInvokerException("Cannot set properties on portlet '" + portletContext.getId()
            + "' because there is no such portlet.");
      }

      PropertyList propertyList = WSRPTypeFactory.createPropertyList();
      int changesNumber = changes.length;
      List<Property> updates = new ArrayList<Property>(changesNumber);
      List<ResetProperty> resets = new ArrayList<ResetProperty>(changesNumber);
      for (int i = 0; i < changesNumber; i++)
      {
         PropertyChange change = changes[i];
         switch (change.getType())
         {
            case PropertyChange.PREF_RESET:
               resets.add(WSRPTypeFactory.createResetProperty(change.getKey()));
               break;

            case PropertyChange.PREF_UPDATE:
               // todo: deal with language more appropriately
               updates.add(WSRPTypeFactory.createProperty(change.getKey(),
                  WSRPUtils.toString(Locale.getDefault()), change.getValue().get(0)));
               break;

            default:
               throw new IllegalArgumentException("Unexpected property change type: " + change.getType());
         }
      }
      propertyList.getProperties().addAll(updates);
      propertyList.getResetProperties().addAll(resets);

      try
      {
         Holder<String> handle = new Holder<String>();
         Holder<byte[]> portletState = new Holder<byte[]>();
         getPortletManagementService().setPortletProperties(getRegistrationContext(),
            WSRPUtils.convertToWSRPPortletContext(portletContext),
            UserAccess.getUserContext(),
            propertyList,
            handle,
            portletState,
            new Holder<List<Extension>>()
         );
         PortletContext newPortletContext = PortletContext.createPortletContext(handle.value, portletState.value);
         portlet.setPortletContext(newPortletContext);
         return newPortletContext;
      }
      catch (Exception e)
      {
         throw new PortletInvokerException("Unable to set properties for portlet '" + portletContext.getId() + "'", e);
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.PortletInvokerException

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.