You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2011/03/13 21:04:01 UTC
svn commit: r1081213 [2/2] - in
/openejb/trunk/openejb3/examples/webapps/moviefun: ./ app/ app/src/
app/src/main/ app/src/main/java/ app/src/main/java/org/
app/src/main/java/org/superbiz/ app/src/main/java/org/superbiz/moviefun/
app/src/main/java/org/s...
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/moviefun.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/moviefun.jsp?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/moviefun.jsp (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/moviefun.jsp Sun Mar 13 20:03:59 2011
@@ -0,0 +1,145 @@
+<%--
+ 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.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head><title>Moviefun :: Index</title>
+<link rel="stylesheet" href="default.css" type="text/css" />
+</head>
+<body>
+<p/>
+<div id="Content">
+<<<<<<< HEAD:openejb3/examples/webapps/moviefun/app/src/main/webapp/moviefun.jsp
+<table>
+<tr>
+<td>
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr class="topBar">
+ <td align="left" width="85%">
+ <span class="topBarDiv">Mini-Movie Application</span>
+ </td>
+ <td align="right" valign="middle" width="1%" nowrap>
+ <form method="POST" action="moviefun.jsp" name="findMovie" style="padding: 1px; margin: 1px">
+ <select name="action">
+ <option value="findByTitle">Title</option>
+ <option value="findByDirector">Director</option>
+ <option value="findByGenre">Genre</option>
+ </select>
+ <input type="text" name="key" size="20"/>
+ <input type="submit" value="Search"/>
+ </form>
+ </td>
+ </tr>
+ </table>
+
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+
+ <div class="basicPanelTitle">Movies</div>
+
+ <div class="basicPanelBody">
+ <form method="POST" action="moviefun.jsp" name="listMovies" style="padding: 1px; margin: 1px">
+ <table class="tableview" width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <th>Title</th>
+ <th>Director</th>
+ <th>Genre</th>
+ <th>Rating</th>
+ <th>Year</th>
+ <th> </th>
+ </tr>
+ <%
+ int start = listIterator.nextIndex();
+ for (int i=display; i > 0 && listIterator.hasNext(); i-- ) {
+ Movie movie = (Movie) listIterator.next();
+ %>
+ <tr>
+ <td width="200"><%=movie.getTitle()%></td>
+ <td width="120"><%=movie.getDirector()%></td>
+ <td width="90"><%=movie.getGenre()%></td>
+ <td width="50"><%=movie.getRating()%></td>
+ <td width="50"><%=movie.getYear()%></td>
+ <td><input type="checkbox" name="id" value="<%=movie.getId()%>"></td>
+ </tr>
+
+ <% } %>
+ </table>
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <td>
+ <% if (start!=0&&listIterator.hasPrevious()){%><input type="submit" name="action" value="<<"/><%}%>
+
+ <%=start+1%> - <%=listIterator.nextIndex()%> of <%=movies.size()%>
+
+ <% if (listIterator.hasNext()){%><input type="submit" name="action" value=">>"/><%}%>
+ </td>
+ <td align="right">
+ <input type="submit" name="action" value="Remove"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+ <div class="basicPanelTitle">Add</div>
+ <div class="basicPanelBody">
+ <form method="POST" action="moviefun.jsp" name="addMovie" style="padding: 1px; margin: 1px">
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 0px">
+ <tr>
+ <td width="200"><input type="text" name="title" size="29"/></td>
+ <td width="120"><input type="text" name="director" size="17"/></td>
+ <td width="90"><input type="text" name="genre" size="14"/></td>
+ <td width="50"><input type="text" name="rating" size="7"/></td>
+ <td width="50"><input type="text" name="year" size="4"/></td>
+ <td><input type="submit" name="action" value="Add"/></td>
+ </tr>
+ </table>
+ </form>
+
+ </div>
+ </div>
+</td>
+</tr>
+</table>
+=======
+ <p>Please select one of the following links:</p>
+ <a href="setup.jsp">Setup</a> - Sets up the application with some sample data<br />
+ <a href="moviefun.jsp">JSP</a> - Use the JSP version of the application<br />
+ <a href="faces/index.xhtml">JSF</a> - Use the JSF 2 version of the application<br />
+>>>>>>> 5e093c1e798dab6d0459468205a037f7c0b6d78d:openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp
+
+
+ <div class="bottomshadow"></div>
+
+ <div id="poweredby" class="smalltext">
+ Powered by
+ <a href="http://tomcat.apache.org" class="smalltext">Apache Tomcat</a> and
+ <a href="http://openejb.apache.org" class="smalltext">Apache OpenEJB</a>.
+ <br/>
+ </div>
+
+
+</div>
+</body>
+</html>
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/resources/css/jsfcrud.css
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/resources/css/jsfcrud.css?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/resources/css/jsfcrud.css (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/resources/css/jsfcrud.css Sun Mar 13 20:03:59 2011
@@ -0,0 +1,99 @@
+<!--
+
+ 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.
+-->
+root {
+ display: block;
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ color: #3a4f54;
+ background-color: #dfecf1;
+ font-size: small;
+}
+
+a {
+ color: #e33b06;
+}
+
+table {
+ empty-cells: show;
+}
+
+form.jsfcrud_list_form th, td th {
+ font-size: x-small;
+ color: #4e6a71;
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+ border-top-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-right-width: 1px;
+ border-top-color: #b2d5d6;
+ border-bottom-color: #b2d5d6;
+ border-left-color: #90b4bd;
+ border-right-color: #90b4bd;
+ letter-spacing: 3px;
+ text-align: left;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+ background-color: #b2d5d6;
+}
+
+td {
+ vertical-align: top;
+ padding-bottom: 8px;
+ font-size: small;
+}
+
+form.jsfcrud_list_form td, td td {
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+ border-top-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-right-width: 1px;
+ border-top-color: #b2d5d6;
+ border-bottom-color: #b2d5d6;
+ border-left-color: #b2d5d6;
+ border-right-color: #b2d5d6;
+ vertical-align: baseline;
+ padding-bottom: 0px;
+}
+
+tr.jsfcrud_odd_row {
+ background-color: #fefeff;
+ color: #4e6a71;
+}
+
+
+tr.jsfcrud_even_row {
+ background-color: #eff5fa;
+ color: #4e6a71;
+}
+
+#busyImage {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+}
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/setup.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/setup.jsp?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/setup.jsp (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/setup.jsp Sun Mar 13 20:03:59 2011
@@ -0,0 +1,62 @@
+<%--
+ 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.
+--%>
+<%@ page import=" java.util.Iterator"%>
+<%@ page import="org.superbiz.moviefun.Movies" %>
+<%@ page import="javax.naming.InitialContext" %>
+<%@ page import="org.superbiz.moviefun.Movie" %>
+<%@ page import="java.util.List" %>
+
+<h2>Setup</h2>
+<%
+ InitialContext initialContext = new InitialContext();
+ Movies moviesBean = (Movies) initialContext.lookup("java:comp/env/movies");
+
+ moviesBean.addMovie(new Movie("Wedding Crashers", "David Dobkin", "Comedy", 7 , 2005));
+ moviesBean.addMovie(new Movie("Starsky & Hutch", "Todd Phillips", "Action", 6 , 2004));
+ moviesBean.addMovie(new Movie("Shanghai Knights", "David Dobkin", "Action", 6 , 2003));
+ moviesBean.addMovie(new Movie("I-Spy", "Betty Thomas", "Adventure", 5 , 2002));
+ moviesBean.addMovie(new Movie("The Royal Tenenbaums", "Wes Anderson", "Comedy", 8 , 2001));
+ moviesBean.addMovie(new Movie("Zoolander", "Ben Stiller", "Comedy", 6 , 2001));
+ moviesBean.addMovie(new Movie("Shanghai Noon", "Tom Dey", "Comedy", 7 , 2000));
+%>
+Done!
+
+<h2>Seeded Database with the Following movies</h2>
+<table width="500">
+<tr>
+<td><b>Title</b></td>
+<td><b>Director</b></td>
+<td><b>Genre</b></td>
+</tr>
+<%
+ List<Movie> movies = moviesBean.getMovies();
+ for (Iterator iterator = movies.iterator(); iterator.hasNext();) {
+ Movie movie = (Movie) iterator.next();
+%>
+<tr>
+<td><%=movie.getTitle()%></td>
+<td><%=movie.getDirector()%></td>
+<td><%=movie.getGenre()%></td>
+</tr>
+
+<%
+ }
+%>
+</table>
+
+<h2>Continue</h2>
+<a href="moviefun.jsp">Go to main app</a>
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/template.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/template.xhtml?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/template.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/main/webapp/template.xhtml Sun Mar 13 20:03:59 2011
@@ -0,0 +1,63 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+
+ 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.
+-->
+<<<<<<< HEAD:openejb3/examples/webapps/moviefun/app/src/main/webapp/template.xhtml
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title><ui:insert name="title">Moviefun</ui:insert></title>
+<h:outputStylesheet name="css/jsfcrud.css"/>
+ </h:head>
+
+ <h:body>
+ <h1>
+ <ui:insert name="title">Default Title</ui:insert>
+ </h1>
+ <p>
+ <ui:insert name="body">Default Body</ui:insert>
+ </p>
+ </h:body>
+
+</html>
+=======
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>ActionServlet</servlet-name>
+ <servlet-class>org.superbiz.moviefun.ActionServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
+>>>>>>> 5e093c1e798dab6d0459468205a037f7c0b6d78d:openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java Sun Mar 13 20:03:59 2011
@@ -0,0 +1,80 @@
+/**
+ * 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.moviefun;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.ejb.EJB;
+import javax.transaction.UserTransaction;
+import javax.annotation.Resource;
+import javax.persistence.PersistenceContext;
+import javax.persistence.EntityManager;
+import java.util.Properties;
+import java.util.List;
+
+import org.apache.openejb.api.LocalClient;
+
+@LocalClient
+public class MoviesTest extends TestCase {
+
+ @EJB
+ private Movies movies;
+
+ @Resource
+ private UserTransaction userTransaction;
+
+ @PersistenceContext
+ private EntityManager entityManager;
+
+ public void setUp() throws Exception {
+ Properties p = new Properties();
+ p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+ InitialContext initialContext = new InitialContext(p);
+
+ // Here's the fun part
+ initialContext.bind("inject", this);
+ }
+
+ public void test() throws Exception {
+
+ userTransaction.begin();
+
+ try {
+ entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+ entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+ entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+ List<Movie> list = movies.getMovies();
+ assertEquals("List.size()", 3, list.size());
+
+ for (Movie movie : list) {
+ movies.deleteMovie(movie);
+ }
+
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+ } finally {
+ userTransaction.commit();
+ }
+ }
+}
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/resources/META-INF/application-client.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/resources/META-INF/application-client.xml?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/resources/META-INF/application-client.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/app/src/test/resources/META-INF/application-client.xml Sun Mar 13 20:03:59 2011
@@ -0,0 +1 @@
+<application-client/>
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/pom.xml?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/pom.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/pom.xml Sun Mar 13 20:03:59 2011
@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+
+<!-- $Rev: 684173 $ $Date: 2008-08-08 20:13:24 -0700 (Fri, 08 Aug 2008) $ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.superbiz</groupId>
+ <artifactId>moviefun</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.superbiz</groupId>
+ <artifactId>moviefun-monitor</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>OpenEJB :: Web Examples :: Moviefun :: Monitor</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>6.0-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-activation_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ccpp_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_3.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_2.2_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jacc_1.4_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaspic_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-deployment_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxb_2.2_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxr_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxrpc_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxws_2.2_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jsp_2.2_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-saaj_1.3_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-stax-api_1.2_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-validation_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-api</artifactId>
+ <version>3.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core</artifactId>
+ <version>3.2-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>icu4j</artifactId>
+ <groupId>com.ibm.icu</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jasypt</artifactId>
+ <groupId>org.jasypt</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>activesoap</groupId>
+ <artifactId>jaxp-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-jmx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-remote</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-tools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-jaas</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-jacc_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-primitives</groupId>
+ <artifactId>commons-primitives</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>axion</groupId>
+ <artifactId>axion</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>regexp</groupId>
+ <artifactId>regexp</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>activemq</groupId>
+ <artifactId>jmdns</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>nlog4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptor>src/main/assembly/client.xml</descriptor>
+ <archive>
+ <manifest>
+ <mainClass>org.superbiz.moviefun.NotificationMonitor</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <!-- This section allows you to configure where to publish libraries for
+ sharing. It is not required and may be deleted. For more information see:
+ http://maven.apache.org/plugins/maven-deploy-plugin/ -->
+ <distributionManagement>
+ <repository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/repo/</url>
+ </repository>
+ <snapshotRepository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/snapshot-repo/</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
+
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/assembly/client.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/assembly/client.xml?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/assembly/client.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/assembly/client.xml Sun Mar 13 20:03:59 2011
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+-->
+
+<!-- $Rev: 779454 $ $Date: 2009-05-27 23:54:45 -0700 (Wed, 27 May 2009) $ -->
+
+<assembly>
+ <id>client</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}</directory>
+ <outputDirectory>META-INF</outputDirectory>
+ <includes>
+ <include>README.txt</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory></outputDirectory>
+ <outputFileNameMapping></outputFileNameMapping>
+
+ <unpack>true</unpack>
+ <!--<includes>-->
+ <!--<include>org.apache.openejb:javaee-api</include>-->
+ <!--<include>org.apache.xbean:xbean-finder-shaded</include>-->
+ <!--<include>org.apache.xbean:xbean-asm-shaded</include>-->
+ <!--<include>junit:junit</include>-->
+ <!--<include>org.apache.openejb:openejb-itests-beans</include>-->
+ <!--<include>org.apache.openejb:openejb-itests-servlets</include>-->
+ <!--<include>org.apache.openejb:openejb-itests-client</include>-->
+ <!--<include>org.apache.openejb:openejb-client</include>-->
+
+ <!-- ActiveMQ -->
+ <!--<include>org.apache.activemq:activemq-core</include>-->
+ <!--<include>backport-util-concurrent:backport-util-concurrent</include>-->
+ <!--<include>commons-logging:commons-logging</include>-->
+ <!--</includes>-->
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationMonitor.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationMonitor.java?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationMonitor.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationMonitor.java Sun Mar 13 20:03:59 2011
@@ -0,0 +1,60 @@
+package org.superbiz.moviefun;
+
+import java.awt.AWTException;
+import java.awt.Image;
+import java.awt.MenuItem;
+import java.awt.PopupMenu;
+import java.awt.SystemTray;
+import java.awt.Toolkit;
+import java.awt.TrayIcon;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class NotificationMonitor {
+ private static TrayIcon trayIcon;
+
+ public static void main(String[] args) throws NamingException, InterruptedException, AWTException, MalformedURLException {
+ addSystemTrayIcon();
+
+ // Boot the embedded EJB Container
+ new InitialContext();
+
+ System.out.println("Starting monitor...");
+ }
+
+ private static void addSystemTrayIcon() throws AWTException, MalformedURLException {
+ SystemTray tray = SystemTray.getSystemTray();
+
+ URL moviepng = NotificationMonitor.class.getClassLoader().getResource("movie.png");
+ Image image = Toolkit.getDefaultToolkit().getImage(moviepng);
+
+ ActionListener exitListener = new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ System.out.println("Exiting monitor...");
+ System.exit(0);
+ }
+ };
+
+ PopupMenu popup = new PopupMenu();
+ MenuItem defaultItem = new MenuItem("Exit");
+ defaultItem.addActionListener(exitListener);
+ popup.add(defaultItem);
+
+ trayIcon = new TrayIcon(image, "Notification Monitor", popup);
+ trayIcon.setImageAutoSize(true);
+ tray.add(trayIcon);
+
+
+ }
+
+ public static void showAlert(String message) {
+ synchronized (trayIcon) {
+ trayIcon.displayMessage("Alert received", message, TrayIcon.MessageType.WARNING);
+ }
+ }
+}
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationsBean.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationsBean.java?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationsBean.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/java/org/superbiz/moviefun/NotificationsBean.java Sun Mar 13 20:03:59 2011
@@ -0,0 +1,31 @@
+package org.superbiz.moviefun;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+
+@MessageDriven(activationConfig = {
+ @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "notifications")})
+public class NotificationsBean implements MessageListener {
+
+ public void onMessage(Message message) {
+ try {
+ TextMessage textMessage = (TextMessage) message;
+ String text = textMessage.getText();
+
+ System.out.println("");
+ System.out.println("====================================");
+ System.out.println("Notification received: " + text);
+ System.out.println("====================================");
+ System.out.println("");
+
+ NotificationMonitor.showAlert(text);
+ } catch (JMSException e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/META-INF/ejb-jar.xml?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/META-INF/ejb-jar.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/META-INF/ejb-jar.xml Sun Mar 13 20:03:59 2011
@@ -0,0 +1 @@
+<ejb-jar />
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/jndi.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/jndi.properties?rev=1081213&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/jndi.properties (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/monitor/src/main/resources/jndi.properties Sun Mar 13 20:03:59 2011
@@ -0,0 +1,4 @@
+java.naming.factory.initial=org.apache.openejb.client.LocalInitialContextFactory
+Default\ JMS\ Resource\ Adapter=new://Resource?type=ActiveMQResourceAdapter
+Default\ JMS\ Resource\ Adapter.BrokerXmlConfig=broker:vm://localhost
+Default\ JMS\ Resource\ Adapter.ServerUrl=tcp://localhost:61616
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml?rev=1081213&r1=1081212&r2=1081213&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml Sun Mar 13 20:03:59 2011
@@ -1,114 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<!-- 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. -->
- 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.
--->
-
-<!-- $Rev: 684173 $ $Date: 2008-08-08 20:13:24 -0700 (Fri, 08 Aug 2008) $ -->
+<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.superbiz</groupId>
- <artifactId>moviefun</artifactId>
- <packaging>war</packaging>
- <version>1.1-SNAPSHOT</version>
- <name>OpenEJB :: Web Examples :: Moviefun</name>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
- <repositories>
- <repository>
- <id>apache-m2-snapshot</id>
- <name>Apache Snapshot Repository</name>
- <url>http://repository.apache.org/snapshots</url>
- </repository>
- </repositories>
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>javaee-api</artifactId>
- <version>6.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.1.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>2.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>2.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-core</artifactId>
- <version>3.2-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>1.1.2</version>
- </dependency>
- </dependencies>
- <!--
- This section allows you to configure where to publish libraries for sharing.
- It is not required and may be deleted. For more information see:
- http://maven.apache.org/plugins/maven-deploy-plugin/
- -->
- <distributionManagement>
- <repository>
- <id>localhost</id>
- <url>file://${basedir}/target/repo/</url>
- </repository>
- <snapshotRepository>
- <id>localhost</id>
- <url>file://${basedir}/target/snapshot-repo/</url>
- </snapshotRepository>
- </distributionManagement>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.superbiz</groupId>
+ <artifactId>moviefun</artifactId>
+ <packaging>pom</packaging>
+ <version>1.1-SNAPSHOT</version>
+ <name>OpenEJB :: Web Examples :: Moviefun</name>
+
+ <modules>
+ <module>app</module>
+ <module>monitor</module>
+ </modules>
</project>
\ No newline at end of file