0

Possible Duplicate:
How to make an make a web request in an async manner

I need to make a non blocking asynchronous method call from my application.

There is an http url which i need to call but in asynchronous way.

example:

URL myPage = new URL("http://www.mypage.com/");
URLConnection yc = myPage.openConnection();

but the method to be invoked in non blocking or asynchronous way, so that the thread doesn't get stuck when the server of the target url ( http://www.mypage.com) is not working.

Using Oracle Weblogic Server 10.3.2

Community
  • 1
  • 1
Pramod Kumar
  • 71
  • 1
  • 4

1 Answers1

3

You could do it manually by spawning additional thread, or you could use ready-made library that will to the job for you. Have a look at Apache HttpClient+HttpAsyncClient and these examples

Maciej
  • 578
  • 4
  • 12