8000 Adding @Asynchronous on method - works on both WildFly and GlassFish · javaee-samples/javaee7-samples@74a18b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 74a18b8

Browse files
committed
Adding @asynchronous on method - works on both WildFly and GlassFish
1 parent 1c0aaed commit 74a18b8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ejb/async-ejb/src/main/java/org/javaee7/ejb/async/MyAsyncBean.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.logging.Level;
55
import java.util.logging.Logger;
66
import javax.ejb.AsyncResult;
7+
import javax.ejb.Asynchronous;
78
import javax.ejb.Stateless;
89

910
/**
@@ -12,6 +13,7 @@
1213
@Stateless
1314
public class MyAsyncBean {
1415

16+
@Asynchronous
1517
public Future<Integer> addNumbers(int n1, int n2) {
1618
try {
1719
// simulating a long running query
@@ -21,8 +23,4 @@ public Future<Integer> addNumbers(int n1, int n2) {
2123
}
2224
return new AsyncResult(n1 + n2);
2325
}
24-
25-
public void doSomething(String what) {
26-
System.out.println("Just did " + what);
27-
}
2826
}

0 commit comments

Comments
 (0)
0