File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes asynchronous java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "asynchronous java" Watch "asynchronous java" New topic

asynchronous java

Ryan Acc

Joined: Jan 31, 2005
Posts: 5
Is there a way of making a Java program asynchronous without using Threads and/or JMS??
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Can you define what you mean by "making a program asynchronous?" Running it in the background? Running it as a service?

[Jess in Action][AskingGoodQuestions]
Ryan Acc

Joined: Jan 31, 2005
Posts: 5
Making the program asynchronous as in when calling functions on it, we do not have to wait for it to complete. Once the call is made, we can carry on with other things.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It pretty much has to involve threads at some level. If you're calling another method within your own program and want to continue without waiting for that method to return, it will have to run on another thread. If you use some API to call outside your program, say JMS to a queueing system, the external program can do the threading.

If you are feeling a bit intimidated by threads, relax. I put off learning them for quite a while, but found some very good uses after a while. You can have a fine time with Java and never do any threads and there are some environments like EJB servers where you are forbidden to mess with your own threads. But I'd encourage you to Google for a tutorial, play with some examples and get a good level of comfort with threads. They are good clean fun, and a useful way to make programs faster or at least feel faster some times.

Feel free to jump up to the threads forum and talk through the learning process with the gang.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: asynchronous java
jQuery in Action, 3rd edition