-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.2.3.GA
Asynchronous rest method can be implemented but can't be recognized by reasteasy's proxy client
interface ---------------------------
@Path("/demoservice")
public interface DemoService {
@GET
@Path("sayHello/
@Produces("application/json")
public Person sayHello(@PathParam("name") String hello);
}
implements ------------------------
@Path("/demoservice")
public class DemoServer extends BaseEIPService implements DemoService {
public DemoServer() { System.out.println(" DemoServer start"); }
//@Override
public Person sayHello(String hello) { Person pss = new Person(); pss.setName(hello); pss.setAge(28); ArrayList<String> books = new ArrayList<String>(4); books.add("Java Book\""); books.add("J2ee Book"); pss.setBooks(books); return pss; }
@GET
@Path("sayHello/{name}
")
@Produces("application/json")
public Person sayHello(final @PathParam("name") String hello,
final @Suspend(10000) AsynchronousResponse response) {
System.out.println("asyn say hello");
Thread t = new Thread() {
@Override
public void run() {
try
catch (Exception e)
{ e.printStackTrace(); } }
};
t.start();
return null;
}
when access http://localhost:8080/aop/rest/demoservice/sayHello/test
sometimes execute Asynchronous method ,sometimes execute sayHello method (when execute Asynchronous method,print System.out.println("asyn say hello");
I tried many times and found only define two method (one is Asynchronous wrapper) then reasteasy client proxy can recognized
sayHello method
but I can't solve the random call problem , and anyone has any better solutions about this problem ?
thanks !