April 2018
Intermediate to advanced
382 pages
10h 11m
English
public class User implements Serializable{ private Long id; private String name; public User(long id, String name){ this.id = id; this.name = name; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
@Stateless@Path("remoteUser")public class UserBean { @GET public Response remoteUser() { long id = new Date().getTime(); try { TimeUnit.SECONDS.sleep(5); return Response.ok(new User(id, "User " + id)) .build(); } catch (InterruptedException ex) { System.err.println(ex.getMessage()); return Response.ok(new ...Read now
Unlock full access