@Override public boolean handleMessage(Message msg) { if (msg.obj == null) return false; CustomService service = (CustomService) msg.obj; if (msg.arg1 == Protocol.Req.off()) { service.stop(); if (networkService != null) { networkService.removeListener(service); } } else if (msg.arg1 == Protocol.Req.on()) { service.start(); networkService.addListener(service); } return false; }
@GET @Path("/hello/{name}") public String sayHello(@PathParam("name") String name) { return customService.sayHello(name); }