/[projects]/miscJava/Test3/src/dk/thoerup/asyncsamples/AsyncEjbServlet.java
ViewVC logotype

Contents of /miscJava/Test3/src/dk/thoerup/asyncsamples/AsyncEjbServlet.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 648 - (show annotations) (download)
Tue Apr 13 05:58:27 2010 UTC (14 years, 1 month ago) by torben
File size: 1342 byte(s)
code sync on sample EJB
1 /* AsyncEjbServlet + Async Ejb - demonstrates how to use async. execution in java EE6 */
2
3 package dk.thoerup.asyncsamples;
4
5 import java.io.IOException;
6
7 import javax.ejb.embeddable.EJBContainer;
8 import javax.naming.Context;
9 import javax.naming.NamingException;
10 import javax.servlet.ServletException;
11 import javax.servlet.annotation.WebServlet;
12 import javax.servlet.http.HttpServlet;
13 import javax.servlet.http.HttpServletRequest;
14 import javax.servlet.http.HttpServletResponse;
15
16
17
18 @WebServlet(name = "AsyncEjbServlet", urlPatterns = { "/AsyncEjbServlet" })
19 public class AsyncEjbServlet extends HttpServlet {
20 private static final long serialVersionUID = 1L;
21
22 private EJBContainer container;
23 private Context namingContext;
24 private AsyncEjb asyncBean;
25
26
27 public AsyncEjbServlet() {
28
29 }
30
31
32
33
34 @Override
35 public void init() throws ServletException {
36 super.init();
37 container = EJBContainer.createEJBContainer();
38 namingContext = container.getContext();
39 try {
40 asyncBean = (AsyncEjb) namingContext.lookup("java:global/testApp/AsyncBean");
41 } catch (NamingException ne) {
42 throw new ServletException(ne);
43 }
44 }
45
46
47 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
48 // TODO Auto-generated method stub
49 }
50 }

  ViewVC Help
Powered by ViewVC 1.1.20