Package org.gatein.pc.api.invocation.response

Examples of org.gatein.pc.api.invocation.response.ErrorResponse


      String redirectURL = blockingInteractionResponse.getRedirectURL();
      UpdateResponse updateResponse = blockingInteractionResponse.getUpdateResponse();
      if (redirectURL != null && updateResponse != null)
      {
         return new ErrorResponse(new IllegalArgumentException("Producer error: response cannot both redirect and update state."));
      }

      if (redirectURL == null && updateResponse == null)
      {
         return new ErrorResponse(new IllegalArgumentException("Producer error: response must redirect or update state."));
      }

      if (redirectURL != null)
      {
         return new HTTPRedirectionResponse(redirectURL); // do we need to process URLs?
View Full Code Here


      }
      catch (Exception e)
      {
         if (!(e instanceof PortletInvokerException))
         {
            ErrorResponse errorResponse = dealWithError(e, invocation, getRuntimeContextFrom(request));
            if (errorResponse != null)
            {
               return unwrapWSRPError(errorResponse);
            }
            else
            {
               return new ErrorResponse(e);
            }
         }
         else
         {
            throw (PortletInvokerException)e;
View Full Code Here

            sessionHandler.initCookieIfNeeded(invocation);
         }
         catch (Exception e)
         {
            log.debug("Couldn't init cookie: " + e.getLocalizedMessage());
            return new ErrorResponse(e);
         }
      }
      else if (error instanceof InvalidSession)
      {
         log.debug("Session invalidated after InvalidSessionFault, will re-send session-stored information.");
         sessionHandler.handleInvalidSessionFault(invocation, runtimeContext);
      }
      else if (error instanceof InvalidRegistration)
      {
         log.debug("Invalid registration");
         consumer.handleInvalidRegistrationFault();
      }
      else if (error instanceof ModifyRegistrationRequired)
      {
         ProducerInfo producerInfo = consumer.getProducerInfo();

         log.debug("Producer " + producerInfo.getId() + " indicated that modifyRegistration should be called.");

         producerInfo.setModifyRegistrationRequired(true);
         producerInfo.setActiveAndSave(false);

         return new ErrorResponse(error);
      }
      else
      {
         // other errors cannot be dealt with: we have an error condition
         return new ErrorResponse(error);
      }
      return null;
   }
View Full Code Here

         else if (cause instanceof RemoteException)
         {
            cause = ((RemoteException)cause).detail;
         }
         log.debug("Invocation of action failed: " + cause.getMessage(), cause); // fix-me?
         return new ErrorResponse(cause);
      }
      else
      {
         log.debug("Invocation of action failed: " + errorResponse.getMessage());
         return errorResponse;
View Full Code Here

                  renderProperties.append(fragmentProperties);
               }
            }
            else if (response instanceof ErrorResponse)
            {
               ErrorResponse error = (ErrorResponse)response;
               errors.add(error);
            }
         }
         catch (PortletInvokerException e)
         {
View Full Code Here

            }

            // todo: handle the error response better than this.
            if (!(piResponse instanceof UpdateNavigationalStateResponse)) {
                if (piResponse instanceof ErrorResponse) {
                    ErrorResponse errorResponse = (ErrorResponse) piResponse;
                    throw (Exception) errorResponse.getCause();
                } else {
                    throw new Exception("Unexpected response type [" + piResponse
                            + "]. Expected a UpdateNavigationResponse or an ErrorResponse.");
                }
            }
View Full Code Here

                String contentType;
                String charset;
                Object content;
                if (!(portletResponse instanceof ContentResponse)) {
                    if (portletResponse instanceof ErrorResponse) {
                        ErrorResponse errorResponse = (ErrorResponse) portletResponse;
                        Throwable cause = errorResponse.getCause();
                        if (cause != null) {
                            log.trace("Got error response from portlet", cause);
                        } else if (errorResponse.getMessage() != null) {
                            log.trace("Got error response from portlet:" + errorResponse.getMessage());
                        } else {
                            log.trace("Got error response from portlet");
                        }
                    } else {
                        log.trace("Unexpected response type [" + portletResponse
View Full Code Here

            PortletContainerException pcException;

            //
            if (portletResponse instanceof ErrorResponse)
            {
               ErrorResponse errorResponse = (ErrorResponse)portletResponse;
               pcException = new PortletContainerException(errorResponse.getMessage(), errorResponse.getCause());
            }
            else
            {
               pcException =
                  new PortletContainerException("Unknown invocation response type [" + portletResponse.getClass()
View Full Code Here

                     PortletContainerException pcException;

                     if (response instanceof ErrorResponse)
                     {
                        ErrorResponse errorResponse = (ErrorResponse)response;
                        pcException =
                           new PortletContainerException(errorResponse.getMessage(), errorResponse.getCause());
                     }
                     else
                     {
                        pcException =
                           new PortletContainerException("Unknown invocation response type [" + response.getClass()
View Full Code Here

         // todo: handle the error response better than this.
         if (!(piResponse instanceof UpdateNavigationalStateResponse))
         {
            if (piResponse instanceof ErrorResponse)
            {
               ErrorResponse errorResponse = (ErrorResponse)piResponse;
               throw (Exception)errorResponse.getCause();
            }
            else
            {
               throw new Exception("Unexpected response type [" + piResponse
                  + "]. Expected a UpdateNavigationResponse or an ErrorResponse.");
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.invocation.response.ErrorResponse

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.