I have just completed an aspect dealing with asynchronous call.
So the purpose of the asynchronous aspect is to drastically simplify the
implementation of asynchronous call within a JVM .
The asynchrous aspect can be used to define ONEWAY method
BUT also REQUEST/REPLY method.
Timeout value ,exception handling, thread pooling for ONEWAY method,access to starting
time ,duration are also covered
in the first version of the asynchronous aspect.
See the following example.
POJO CLASS
========
public class BusinessModel {
public BusinessModel(long sleepTime){...}
/**
* @@asynchronous
*/
public void processBusinessModel() {...}
/**
* @@asynchronous
*/
public long processBusinessModel2(...) {...}
}
BusinessModel bm1 = new BusinessModel();
//Asynchronous call to processBusinessModel method
long value=bm1.processBusinessModel2(100);
AsynchronousFacade asynchronousFacade = (AsynchronousFacade)bm1;
//Non Blocking call
if (asynchronousFacade.isDone())
System.out.println("It's done !");
else
{
//Blocking call
AsynchronousResponse aR = asynchronousFacade.waitForResponse();
if (aR.getResponseCode()==OK)
System.out.println("Value:"+(Long)asynchronousFacade.getReturnValue());
else if (aR.getResponseCode()==TIMEOUT)
.......................
........................
}
For more example please take a look in CVS
at aspects/src/test/asynchronous/testAsynchronousAspect.java.
Comments are welcomed.
I will post more documentation on WIKI soon.
Rgds,Claude
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3828797#3828797
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3828797
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development