You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/07/08 18:02:02 UTC

svn commit: r825045 - in /websites/staging/openejb/trunk: cgi-bin/ content/ content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/ content/examples-trunk/cdi-ejbcontext-jaas/src/main/webapp/WEB-INF/

Author: buildbot
Date: Sun Jul  8 16:02:01 2012
New Revision: 825045

Log:
Staging update by buildbot for openejb

Added:
    websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/LogginServlet.java
    websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
Removed:
    websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/CdiEjb.java
    websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/CdiServlet.java
    websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/webapp/WEB-INF/beans.xml
Modified:
    websites/staging/openejb/trunk/cgi-bin/   (props changed)
    websites/staging/openejb/trunk/content/   (props changed)

Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jul  8 16:02:01 2012
@@ -1 +1 @@
-1358763
+1358766

Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jul  8 16:02:01 2012
@@ -1 +1 @@
-1358763
+1358766

Added: websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/LogginServlet.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/LogginServlet.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/LogginServlet.java Sun Jul  8 16:02:01 2012
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.ejbcontext;
+
+import javax.inject.Inject;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(urlPatterns = "/ejbcontext")
+public class LogginServlet extends HttpServlet {
+    @Inject
+    private PrinciaplEjb bean;
+
+    @Override
+    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        req.login(req.getParameter("myUser"), req.getParameter("myPass"));
+        // think to persist the information in the session if you need it later
+        resp.getWriter().write("logged user ==> " + bean.info());
+    }
+}

Added: websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java Sun Jul  8 16:02:01 2012
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.ejbcontext;
+
+import javax.annotation.Resource;
+import javax.ejb.EJBContext;
+import javax.ejb.Stateless;
+
+@Stateless
+public class PrinciaplEjb {
+    @Resource
+    private EJBContext context;
+
+    public String info() {
+        return context.getCallerPrincipal().getName();
+    }
+}