You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by bu...@apache.org on 2012/02/19 21:55:55 UTC
svn commit: r805392 - in /websites/staging/openejb/trunk: ./
content/examples-trunk/persistence-fragment/README.html
content/examples-trunk/simple-mdb-and-cdi/README.html
content/examples-trunk/simple-webservice-without-interface/README.html
Author: buildbot
Date: Sun Feb 19 20:55:55 2012
New Revision: 805392
Log:
Staging update by buildbot for openejb
Added:
websites/staging/openejb/trunk/content/examples-trunk/persistence-fragment/README.html
websites/staging/openejb/trunk/content/examples-trunk/simple-mdb-and-cdi/README.html
websites/staging/openejb/trunk/content/examples-trunk/simple-webservice-without-interface/README.html
Modified:
websites/staging/openejb/trunk/ (props changed)
Propchange: websites/staging/openejb/trunk/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Feb 19 20:55:55 2012
@@ -1 +1 @@
-1291044
+1291058
Added: websites/staging/openejb/trunk/content/examples-trunk/persistence-fragment/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/persistence-fragment/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/persistence-fragment/README.html Sun Feb 19 20:55:55 2012
@@ -0,0 +1,293 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+
+ <meta charset="utf-8">
+ <title>Persistence Fragment</title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="./../../bootstrap.css" rel="stylesheet">
+ <link href="./../../prettify.css" rel="stylesheet">
+ <link href="./../../bootstrap-mods.css" rel="stylesheet">
+
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ .sprite {
+ display: inline-block;
+ height: 20px;
+ margin: 0 auto 4px;
+ outline: medium none;
+ text-indent: -999em;
+ width: 24px;
+ background-image: url('./../../images/sprites.png');
+ background-repeat: no-repeat;
+ overflow: hidden;
+ cursor: pointer;
+ }
+ .fb-share {
+ background-position: 0px -40px;
+ }
+ .gp-share {
+ background-position: 0px 0px;
+ }
+ .tw-share {
+ background-position: 0px -80px;
+ }
+ </style>
+ <script type="text/javascript">
+ function fbshare () {
+ window.open(
+ "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+ 'Share on Facebook',
+ 'width=640,height=426');
+ };
+ function gpshare () {
+ window.open(
+ "https://plus.google.com/share?url="+document.URL,
+ 'Share on Google+',
+ 'width=584,height=385');
+ };
+ function twshare () {
+ window.open(
+ "https://twitter.com/intent/tweet?url="+document.URL+"&text=Persistence Fragment " + document.URL,
+ 'Share on Twitter',
+ 'width=800,height=526');
+ };
+ </script>
+
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="./../../images/favicon.ico">
+ <link rel="apple-touch-icon" href="./../../images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="./../../images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="./../../images/apple-touch-icon-114x114.png">
+
+ <script src="./../../javascript/prettify.js" type="text/javascript"></script>
+ <script src="./../../javascript/jquery-latest.js"></script>
+ <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+ <script src="./../../javascript/common.js"></script>
+ <script src="./../../javascript/prettyprint.js"></script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2717626-1']);
+ _gaq.push(['_setDomainName', 'apache.org']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+
+
+ </head>
+
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="./../../index.html">Apache TomEE</a>
+ <ul class="nav">
+ <li><a href="./../../index.html">Home</a></li>
+ <li><a href="./../../downloads.html">Downloads</a></li>
+ <li><a href="./../../documentation.html">Documentation</a></li>
+ <li><a href="./../../support.html">Support</a></li>
+ </ul>
+
+ <!-- Google CSE Search Box Begins -->
+ <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+ <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+ <INPUT type="hidden" name="cof" value="FORID:0">
+ <INPUT name="q" type="text" placeholder="Search">
+ </FORM>
+ <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+ <!-- Google CSE Search Box Ends -->
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+
+
+<div class="row">
+ <div class="span8">
+ <small><a href="./../../index.html">Home</a> » <a href="./../../examples-trunk/">Examples Trunk</a> » <a href="./../../examples-trunk/persistence-fragment/">Persistence Fragment</a></small><br>
+ </div>
+ <div class="span8">
+ </div>
+</div>
+
+<div class="page-header">
+<h1>Persistence Fragment
+
+ <div style="float: right; position: relative; bottom: -10px; ">
+ <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+ <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+ <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+ </div>
+</h1>
+</div>
+
+<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/persistence-fragment">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/persistence-fragment">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+
+<h2>Movie</h2>
+
+<pre><code>package org.superbiz.injection.jpa;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+ @Id
+ @GeneratedValue
+ private long id;
+ private String director;
+ private String title;
+ private int year;
+
+ public Movie() {
+ // no-op
+ }
+
+ public Movie(String director, String title, int year) {
+ this.director = director;
+ this.title = title;
+ this.year = year;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getDirector() {
+ return director;
+ }
+
+ public void setDirector(String director) {
+ this.director = director;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+}
+</code></pre>
+
+<h2>persistence-fragment.xml</h2>
+
+<pre><code><persistence-fragment version="2.0">
+ <persistence-unit-fragment name="movie-unit">
+ <class>org.superbiz.injection.jpa.Movie</class>
+ <exclude-unlisted-classes>true</exclude-unlisted-classes>
+ </persistence-unit-fragment>
+</persistence-fragment>
+</code></pre>
+
+<h2>MoviesTest</h2>
+
+<pre><code>package org.superbiz.injection.jpa;
+
+import org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+public class MoviesTest {
+ @PersistenceUnit
+ private EntityManagerFactory emf;
+
+ @Test
+ public void test() throws Exception {
+ final Properties p = new Properties();
+ p.put("movieDatabase", "new://Resource?type=DataSource");
+ p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+ p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+ final EJBContainer container = EJBContainer.createEJBContainer(p);
+ final Context context = container.getContext();
+ context.bind("inject", this);
+
+ assertTrue(((ReloadableEntityManagerFactory) emf).getManagedClasses().contains(Movie.class.getName()));
+
+ container.close();
+ }
+}
+</code></pre>
+
+<h2>persistence.xml</h2>
+
+<pre><code><persistence version="2.0"
+ xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+ <persistence-unit name="movie-unit">
+ <jta-data-source>movieDatabase</jta-data-source>
+ <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+ </properties>
+ </persistence-unit>
+</persistence>
+</code></pre>
+
+
+<div class="page-header"> </div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html">javax.ejb.embeddable.EJBContainer</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/naming/Context.html">javax.naming.Context</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/Entity.html">javax.persistence.Entity</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html">javax.persistence.EntityManagerFactory</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/GeneratedValue.html">javax.persistence.GeneratedValue</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/Id.html">javax.persistence.Id</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/persistence/PersistenceUnit.html">javax.persistence.PersistenceUnit</a></li>
+</ul>
+
+
+
+ <footer>
+ <p>
+ Copyright © 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+ Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>
Added: websites/staging/openejb/trunk/content/examples-trunk/simple-mdb-and-cdi/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/simple-mdb-and-cdi/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/simple-mdb-and-cdi/README.html Sun Feb 19 20:55:55 2012
@@ -0,0 +1,365 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+
+ <meta charset="utf-8">
+ <title>Simple MDB and CDI</title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="./../../bootstrap.css" rel="stylesheet">
+ <link href="./../../prettify.css" rel="stylesheet">
+ <link href="./../../bootstrap-mods.css" rel="stylesheet">
+
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ .sprite {
+ display: inline-block;
+ height: 20px;
+ margin: 0 auto 4px;
+ outline: medium none;
+ text-indent: -999em;
+ width: 24px;
+ background-image: url('./../../images/sprites.png');
+ background-repeat: no-repeat;
+ overflow: hidden;
+ cursor: pointer;
+ }
+ .fb-share {
+ background-position: 0px -40px;
+ }
+ .gp-share {
+ background-position: 0px 0px;
+ }
+ .tw-share {
+ background-position: 0px -80px;
+ }
+ </style>
+ <script type="text/javascript">
+ function fbshare () {
+ window.open(
+ "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+ 'Share on Facebook',
+ 'width=640,height=426');
+ };
+ function gpshare () {
+ window.open(
+ "https://plus.google.com/share?url="+document.URL,
+ 'Share on Google+',
+ 'width=584,height=385');
+ };
+ function twshare () {
+ window.open(
+ "https://twitter.com/intent/tweet?url="+document.URL+"&text=Simple MDB and CDI " + document.URL,
+ 'Share on Twitter',
+ 'width=800,height=526');
+ };
+ </script>
+
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="./../../images/favicon.ico">
+ <link rel="apple-touch-icon" href="./../../images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="./../../images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="./../../images/apple-touch-icon-114x114.png">
+
+ <script src="./../../javascript/prettify.js" type="text/javascript"></script>
+ <script src="./../../javascript/jquery-latest.js"></script>
+ <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+ <script src="./../../javascript/common.js"></script>
+ <script src="./../../javascript/prettyprint.js"></script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2717626-1']);
+ _gaq.push(['_setDomainName', 'apache.org']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+
+
+ </head>
+
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="./../../index.html">Apache TomEE</a>
+ <ul class="nav">
+ <li><a href="./../../index.html">Home</a></li>
+ <li><a href="./../../downloads.html">Downloads</a></li>
+ <li><a href="./../../documentation.html">Documentation</a></li>
+ <li><a href="./../../support.html">Support</a></li>
+ </ul>
+
+ <!-- Google CSE Search Box Begins -->
+ <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+ <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+ <INPUT type="hidden" name="cof" value="FORID:0">
+ <INPUT name="q" type="text" placeholder="Search">
+ </FORM>
+ <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+ <!-- Google CSE Search Box Ends -->
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+
+
+<div class="row">
+ <div class="span8">
+ <small><a href="./../../index.html">Home</a> » <a href="./../../examples-trunk/">Examples Trunk</a> » <a href="./../../examples-trunk/simple-mdb-and-cdi/">Simple Mdb And Cdi</a></small><br>
+ </div>
+ <div class="span8">
+ </div>
+</div>
+
+<div class="page-header">
+<h1>Simple MDB and CDI
+
+ <div style="float: right; position: relative; bottom: -10px; ">
+ <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+ <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+ <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+ </div>
+</h1>
+</div>
+
+<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-mdb-and-cdi">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/simple-mdb-and-cdi">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+
+<h2>ChatBean</h2>
+
+<pre><code>package org.superbiz.mdb;
+
+import javax.annotation.Resource;
+import javax.ejb.MessageDriven;
+import javax.inject.Inject;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+@MessageDriven
+public class ChatBean implements MessageListener {
+
+ @Resource
+ private ConnectionFactory connectionFactory;
+
+ @Resource(name = "AnswerQueue")
+ private Queue answerQueue;
+
+ @Inject
+ private ChatRespondCreator responder;
+
+ public void onMessage(Message message) {
+ try {
+
+ final TextMessage textMessage = (TextMessage) message;
+ final String question = textMessage.getText();
+ final String response = responder.respond(question);
+
+ if (response != null) {
+ respond(response);
+ }
+ } catch (JMSException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ private void respond(String text) throws JMSException {
+
+ Connection connection = null;
+ Session session = null;
+
+ try {
+ connection = connectionFactory.createConnection();
+ connection.start();
+
+ // Create a Session
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // Create a MessageProducer from the Session to the Topic or Queue
+ MessageProducer producer = session.createProducer(answerQueue);
+ producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+ // Create a message
+ TextMessage message = session.createTextMessage(text);
+
+ // Tell the producer to send the message
+ producer.send(message);
+ } finally {
+ // Clean up
+ if (session != null) session.close();
+ if (connection != null) connection.close();
+ }
+ }
+}
+</code></pre>
+
+<h2>ChatRespondCreator</h2>
+
+<pre><code>package org.superbiz.mdb;
+
+public class ChatRespondCreator {
+ public String respond(String question) {
+ if ("Hello World!".equals(question)) {
+ return "Hello, Test Case!";
+ } else if ("How are you?".equals(question)) {
+ return "I'm doing well.";
+ } else if ("Still spinning?".equals(question)) {
+ return "Once every day, as usual.";
+ }
+ return null;
+ }
+}
+</code></pre>
+
+<h2>beans.xml</h2>
+
+<pre><code><!--
+
+ 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.
+-->
+
+<beans/>
+</code></pre>
+
+<h2>ChatBeanTest</h2>
+
+<pre><code>package org.superbiz.mdb;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.embeddable.EJBContainer;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class ChatBeanTest extends TestCase {
+
+ @Resource
+ private ConnectionFactory connectionFactory;
+
+ @Resource(name = "ChatBean")
+ private Queue questionQueue;
+
+ @Resource(name = "AnswerQueue")
+ private Queue answerQueue;
+
+ public void test() throws Exception {
+ EJBContainer.createEJBContainer().getContext().bind("inject", this);
+
+
+ final Connection connection = connectionFactory.createConnection();
+
+ connection.start();
+
+ final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ final MessageProducer questions = session.createProducer(questionQueue);
+
+ final MessageConsumer answers = session.createConsumer(answerQueue);
+
+
+ sendText("Hello World!", questions, session);
+
+ assertEquals("Hello, Test Case!", receiveText(answers));
+
+
+ sendText("How are you?", questions, session);
+
+ assertEquals("I'm doing well.", receiveText(answers));
+
+
+ sendText("Still spinning?", questions, session);
+
+ assertEquals("Once every day, as usual.", receiveText(answers));
+ }
+
+ private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
+
+ questions.send(session.createTextMessage(text));
+ }
+
+ private String receiveText(MessageConsumer answers) throws JMSException {
+
+ return ((TextMessage) answers.receive(1000)).getText();
+ }
+}
+</code></pre>
+
+
+<div class="page-header"> </div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/annotation/Resource.html">javax.annotation.Resource</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/MessageDriven.html">javax.ejb.MessageDriven</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html">javax.ejb.embeddable.EJBContainer</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/inject/Inject.html">javax.inject.Inject</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/Connection.html">javax.jms.Connection</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/ConnectionFactory.html">javax.jms.ConnectionFactory</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/DeliveryMode.html">javax.jms.DeliveryMode</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/JMSException.html">javax.jms.JMSException</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/Message.html">javax.jms.Message</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/MessageConsumer.html">javax.jms.MessageConsumer</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/MessageListener.html">javax.jms.MessageListener</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/MessageProducer.html">javax.jms.MessageProducer</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/Queue.html">javax.jms.Queue</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/Session.html">javax.jms.Session</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jms/TextMessage.html">javax.jms.TextMessage</a></li>
+</ul>
+
+
+
+ <footer>
+ <p>
+ Copyright © 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+ Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>
Added: websites/staging/openejb/trunk/content/examples-trunk/simple-webservice-without-interface/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/simple-webservice-without-interface/README.html (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/simple-webservice-without-interface/README.html Sun Feb 19 20:55:55 2012
@@ -0,0 +1,253 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+
+ <meta charset="utf-8">
+ <title>Simple Webservice Without Interface</title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="./../../bootstrap.css" rel="stylesheet">
+ <link href="./../../prettify.css" rel="stylesheet">
+ <link href="./../../bootstrap-mods.css" rel="stylesheet">
+
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ .sprite {
+ display: inline-block;
+ height: 20px;
+ margin: 0 auto 4px;
+ outline: medium none;
+ text-indent: -999em;
+ width: 24px;
+ background-image: url('./../../images/sprites.png');
+ background-repeat: no-repeat;
+ overflow: hidden;
+ cursor: pointer;
+ }
+ .fb-share {
+ background-position: 0px -40px;
+ }
+ .gp-share {
+ background-position: 0px 0px;
+ }
+ .tw-share {
+ background-position: 0px -80px;
+ }
+ </style>
+ <script type="text/javascript">
+ function fbshare () {
+ window.open(
+ "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+ 'Share on Facebook',
+ 'width=640,height=426');
+ };
+ function gpshare () {
+ window.open(
+ "https://plus.google.com/share?url="+document.URL,
+ 'Share on Google+',
+ 'width=584,height=385');
+ };
+ function twshare () {
+ window.open(
+ "https://twitter.com/intent/tweet?url="+document.URL+"&text=Simple Webservice Without Interface " + document.URL,
+ 'Share on Twitter',
+ 'width=800,height=526');
+ };
+ </script>
+
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="./../../images/favicon.ico">
+ <link rel="apple-touch-icon" href="./../../images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="./../../images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="./../../images/apple-touch-icon-114x114.png">
+
+ <script src="./../../javascript/prettify.js" type="text/javascript"></script>
+ <script src="./../../javascript/jquery-latest.js"></script>
+ <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+ <script src="./../../javascript/common.js"></script>
+ <script src="./../../javascript/prettyprint.js"></script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2717626-1']);
+ _gaq.push(['_setDomainName', 'apache.org']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+
+
+ </head>
+
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="./../../index.html">Apache TomEE</a>
+ <ul class="nav">
+ <li><a href="./../../index.html">Home</a></li>
+ <li><a href="./../../downloads.html">Downloads</a></li>
+ <li><a href="./../../documentation.html">Documentation</a></li>
+ <li><a href="./../../support.html">Support</a></li>
+ </ul>
+
+ <!-- Google CSE Search Box Begins -->
+ <FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
+ <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
+ <INPUT type="hidden" name="cof" value="FORID:0">
+ <INPUT name="q" type="text" placeholder="Search">
+ </FORM>
+ <!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
+ <!-- Google CSE Search Box Ends -->
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+
+
+<div class="row">
+ <div class="span8">
+ <small><a href="./../../index.html">Home</a> » <a href="./../../examples-trunk/">Examples Trunk</a> » <a href="./../../examples-trunk/simple-webservice-without-interface/">Simple Webservice Without Interface</a></small><br>
+ </div>
+ <div class="span8">
+ </div>
+</div>
+
+<div class="page-header">
+<h1>Simple Webservice Without Interface
+
+ <div style="float: right; position: relative; bottom: -10px; ">
+ <a onclick="javascript:gpshare()" class="gp-share sprite" title="share on Google+">share [gp]</a>
+ <a onclick="javascript:fbshare()" class="fb-share sprite" title="share on Facebook">share [fb]</a>
+ <a onclick="javascript:twshare()" class="tw-share sprite" title="share on Twitter">share [tw]</a>
+ </div>
+</h1>
+</div>
+
+<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-webservice-without-interface">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/simple-webservice-without-interface">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+
+<h2>Calculator</h2>
+
+<pre><code>package org.superbiz.calculator;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(
+ portName = "CalculatorPort",
+ serviceName = "CalculatorWsService",
+ targetNamespace = "http://superbiz.org/wsdl")
+public class Calculator {
+ public int sum(int add1, int add2) {
+ return add1 + add2;
+ }
+
+ public int multiply(int mul1, int mul2) {
+ return mul1 * mul2;
+ }
+}
+</code></pre>
+
+<h2>ejb-jar.xml</h2>
+
+<pre><code><ejb-jar/>
+</code></pre>
+
+<h2>CalculatorTest</h2>
+
+<pre><code>package org.superbiz.calculator;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+public class CalculatorTest {
+ private static EJBContainer container;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ final Properties properties = new Properties();
+ properties.setProperty("openejb.embedded.remotable", "true");
+
+ container = EJBContainer.createEJBContainer(properties);
+ }
+
+ @Before
+ public void inject() throws NamingException {
+ if (container != null) {
+ container.getContext().bind("inject", this);
+ }
+ }
+
+ @AfterClass
+ public static void close() {
+ if (container != null) {
+ container.close();
+ }
+ }
+
+ @Test
+ public void wsdlExists() throws Exception {
+ final URL url = new URL("http://127.0.0.1:4204/Calculator?wsdl");
+ assertTrue(IOUtils.readLines(url.openStream()).size() > 0);
+ assertTrue(IOUtils.readLines(url.openStream()).toString().contains("CalculatorWsService"));
+ }
+}
+</code></pre>
+
+<h2>ejb-jar.xml</h2>
+
+<pre><code><ejb-jar/>
+</code></pre>
+
+
+<div class="page-header"> </div>
+<h4>APIs Used</h4>
+<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/Stateless.html">javax.ejb.Stateless</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html">javax.ejb.embeddable.EJBContainer</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/jws/WebService.html">javax.jws.WebService</a></li>
+<li><a href="http://docs.oracle.com/javaee/6/api/javax/naming/NamingException.html">javax.naming.NamingException</a></li>
+</ul>
+
+
+
+ <footer>
+ <p>
+ Copyright © 2011 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+ Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>