Package org.jboss.errai.samples.restdemo.client.shared

Examples of org.jboss.errai.samples.restdemo.client.shared.CustomerNotFoundException


  /**
   * @see org.jboss.errai.enterprise.client.jaxrs.ClientExceptionMapper#fromResponse(com.google.gwt.http.client.Response)
   */
  @Override
  public Throwable fromResponse(Response response) {
    return new CustomerNotFoundException(17l);
  }
View Full Code Here


            Window.alert("A customer was returned?  What the what?!");
          }
        }, new RestErrorCallback() {
          @Override
          public boolean error(Request message, Throwable throwable) {
            CustomerNotFoundException cnfe = (CustomerNotFoundException) throwable;
            Window.alert("As expected, an error of type '"
                    + cnfe.getClass().getName() + "' was received for ID '"
                    + cnfe.getCustomerId() + "'.");
            return true;
          }
        }).retrieveCustomerById(17);
      }
    });
View Full Code Here

  }

  @Override
  public Customer retrieveCustomerById(long id) throws CustomerNotFoundException {
    if (!customers.containsKey(id)) {
      throw new CustomerNotFoundException(id);
    }
    return customers.get(id);
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.samples.restdemo.client.shared.CustomerNotFoundException

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.