Package com.google.gwt.user.server.rpc

Examples of com.google.gwt.user.server.rpc.UnexpectedException


    }

    protected SuspendInfo suspend() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm = getAtmosphereResource();
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        atm.getRequest().setAttribute(GWT_SUSPENDED, true);
        atm.suspend(-1, false);
        return new SuspendInfo(atm);
    }
View Full Code Here


    }

    protected boolean isSuspended() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm = getAtmosphereResource();
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        Boolean var = (Boolean)atm.getRequest().getAttribute(GWT_SUSPENDED);
        return Boolean.TRUE.equals(var);
    }
View Full Code Here

    private AtmosphereResource<HttpServletRequest, HttpServletResponse> getAtmosphereResource() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm =
                (AtmosphereResource<HttpServletRequest, HttpServletResponse>)
                getThreadLocalRequest().getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE);
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        return atm;
    }
View Full Code Here

            throw new NullPointerException("streamWriter");
        }

        if (serviceMethod != null
                && !RPC1524.isExpectedException(serviceMethod, cause)) {
            throw new UnexpectedException("Service method '"
                    + getSourceRepresentation(serviceMethod)
                    + "' threw an unexpected exception: "
                    + cause.toString(), cause);
        }
View Full Code Here

      throw new NullPointerException("serializationPolicy");
    }

    if (serviceMethod != null
        && !RPCServletUtils.isExpectedException(serviceMethod, cause)) {
      throw new UnexpectedException("Service method '"
          + getSourceRepresentation(serviceMethod)
          + "' threw an unexpected exception: " + cause.toString(), cause);
    }

    return encodeResponse(cause.getClass(), cause, true, flags,
View Full Code Here

      // Try to encode the caught exception
      Throwable cause = e.getCause();

      // Don't allow random RuntimeExceptions to be thrown back to the client
      if (!RPCServletUtils.isExpectedException(serviceMethod, cause)) {
        throw new UnexpectedException("Service method '"
            + getSourceRepresentation(serviceMethod)
            + "' threw an unexpected exception: " + cause.toString(), cause);
      }

      streamResponse(clientOracle, cause, sink, true);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.server.rpc.UnexpectedException

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.