- J2EE 1.4 Example : Servlet accessing a protected EJB
-
-
-
- This web application is packaged as an "ear".
- When you will click to access the servlet, your web browser will open a dialog box
- asking you a user ID and a password.
-
- Use : jonas for the user ID and jonas for the
- password
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/resources/web/ow2_jonas.css b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/resources/web/ow2_jonas.css
deleted file mode 100644
index 9902f9b13e947e5818ae5e6216287363674d8cd4..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/resources/web/ow2_jonas.css
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- Context Root css. based on css from http://jonas.objectweb.org
- XHTML by Florent BENOIT
-*/
-
-
-body
-{
- top: 10px;
- margin-top:10px;
- background-color: #FFF;
- color: #000000;
- }
-
-
-img {
- margin: 5px;
- border:0;
-}
-
-
-
-div.logos {
- top: 5px;
- width: 99%;
- text-align: right;
-}
-
-
-div.links {
- font-size: 14px;
- margin-top : 40px;
- margin-left : 100px;
-}
-
-
-div.titlepage {
- margin-left: 200px;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 1.5em;
- line-height: 1.5em;
- border-bottom: 1px solid #0099cc;
- color : #ff6600;
- font-weight : bold;
-}
-
-
-div.footer {
- margin-top : 50px;
- color: #FFFFFF;
- font-size: 8pt;
- text-align: center;
-}
-
-
-/*HTML elements */
-
-
-
-ul, ol, dl
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- line-height: 16px;
- font-weight: normal;
-}
-
-li
-{
- color: black;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- font-weight: normal;
- margin: 10px 0px 5px 0px;
-
-}
-a
-{
- color: #3F3975;
- background-color: transparent;
- text-decoration: underline;
-}
-
-a:visited
-{
- color: #9898CB;
- background-color: transparent;
- text-decoration: underline;
-}
-
-a:hover
-{
- color: #E06611;
- background-color: transparent;
- text-decoration: underline;
-}
-
-
-a:active
-{
- color: #FFFFFF;
- background-color: #E06611;
- text-decoration: underline;
-}
-
-
-
-
-.h1, .h2, .h3, .h4, .h5 {
- color: #000;
- background-color: inherit;
- padding: 0;
-}
-
-.h1 {
- margin-top: 5px;
- font-size: 2em;
- line-height: 1.5em;
- margin: 30px 0 30px 0;
- border-bottom: 1px solid #0099cc;
- color : #ff6600;
- font-weight : bold;
-}
-
-.h2 {
- margin: 20px 0 15px 0;
- border-bottom: 1px solid #0099cc;
- font-weight:normal;
- font-style: normal;
- font-size: 1.6em;
- line-height: 1.4em;
- color : #0099cc
-}
-
-.h3 {
- font-weight: normal;
- font-size: 1.4em;
- line-height: 1.4em;
- margin: 20px 0 15px 0;
-}
-
-.h4 {
- font-weight:normal;
- color: #404040;
- margin: 20px 0 0 0;
- left: 0px;
- font-size: 1.4em;
- line-height: 1.4em;
-}
-.h5 {
- font-weight:normal;
- color: #404040;
- font-style: normal;
- margin: 0px;
- left: 0px;
- font-size: 1.2em;
- line-height: 1.2em;
-}
-
-td
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- font-weight: normal;
-}
-
-p
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- line-height: 16px;
- font-weight: normal;
- margin: 10px 10px 5px 0px;
-}
-
-p.error
-{
- color: red;
-}
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application-client.xml
deleted file mode 100644
index e2688908b9cd44640acf0a6ce62744381625e783..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application-client.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
- Client of the earsample
-
-
- envEntryString
- java.lang.String
-
- Test of envEntry of application-client.xml file
-
-
-
-
-
- ejb/Op
- Session
- org.ow2.jonas.earsample.beans.secusb.OpHome
- org.ow2.jonas.earsample.beans.secusb.Op
- secusb.jar#EarOp
-
-
-
-
- ejb/OpLink
- Session
- org.ow2.jonas.earsample.beans.secusb.OpHome
- org.ow2.jonas.earsample.beans.secusb.Op
- EarOp
-
-
-
- url/jonas
- java.net.URL
- Container
-
-
-
- org.ow2.jonas.security.auth.callback.LoginCallbackHandler
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application.xml
deleted file mode 100644
index f91c69d089f29c65d794cefc2a762f9f2e9e7bf8..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/application.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
- ear example secusb/servlet
- earsample secusb/servlet
-
-
- secusb.jar
-
-
-
-
- earsample.war
- j2ee-1.4
-
-
-
-
- client1.jar
-
-
- client2.jar
-
-
-
- ra-sample.rar
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client1.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client1.xml
deleted file mode 100644
index 9a596a28de219d247769e84a5f0697bd4e4c3006..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- url/jonas
- http://jonas.ow2.org
-
-
-
- jaas.config
- earsample
- jonas
- jonas
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client2.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client2.xml
deleted file mode 100644
index a1bf42917d3328a05781cc5cfd9b629e3b9b36c4..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-client2.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
- url/jonas
- http://jonas.ow2.org
-
-
-
- jaas.config
- earsample
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-secusb.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-secusb.xml
deleted file mode 100644
index ca04b169dbabb1e2aa96fb0c0cab7e7d16639f07..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-secusb.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- EarOp
- EarOpHome
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-web.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-web.xml
deleted file mode 100644
index e66d881247ae0b0c44d2d0f3aef8ddb14dbfdcb6..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/jonas-web.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
- url/URL
- http://jonas.ow2.org
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/ra.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/ra.xml
deleted file mode 100644
index 3aeee3e280adb299a6e0a6f6e42d6b5970641c05..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/ra.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
- rar sample
- rar sample
- OW2
-
- 1.0
-
- false
-
-
-
-
- org.ow2.jonas.earsample.resourceadapters.ResourceAdapterImpl
-
-
-
- JNDI name
- jndiName
-
- java.lang.String
-
-
- eisName
-
-
-
- URL for EIS instance
- EisURL
-
- java.lang.String
-
-
- EIS_URL
-
-
-
-
\ No newline at end of file
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/secusb.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/secusb.xml
deleted file mode 100644
index 53820328257fb1098ba0150c95870def2b887fc8..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/secusb.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
- secured session bean JOnAS example
-
- secusb (earsample)
-
-
-
- EarOp
- org.ow2.jonas.earsample.beans.secusb.OpHome
- org.ow2.jonas.earsample.beans.secusb.Op
- org.ow2.jonas.earsample.beans.secusb.OpLocalHome
- org.ow2.jonas.earsample.beans.secusb.OpLocal
- org.ow2.jonas.earsample.beans.secusb.OpBean
- Stateful
- Container
-
-
-
-
-
- tomcat
-
-
- jetty
-
-
-
- tomcat
-
- EarOp
- *
-
-
-
-
- jetty
-
- EarOp
- *
-
-
-
-
-
- EarOp
- *
-
- Supports
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/web.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/web.xml
deleted file mode 100644
index f9ad76e411aa4ac330cdded24441cb16ea30d3bb..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/etc/xml/web.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
- Op
-
- org.ow2.jonas.earsample.servlets.ServletOp
-
-
-
-
- Op
- /secured/Op
-
-
-
- url/URL
- java.net.URL
- Application
-
-
-
-
- Protected Area
-
- /secured/*
-
- DELETE
- GET
- POST
- PUT
-
-
-
- tomcat
- jetty
-
-
-
-
-
- BASIC
- JOnAS Realm
-
-
-
-
- tomcat
-
-
-
- jetty
-
-
-
-
- envEntryString
- java.lang.String
-
- This is a string from the env-entry
-
-
-
-
- ejb/Op
- Session
- org.ow2.jonas.earsample.beans.secusb.OpHome
- org.ow2.jonas.earsample.beans.secusb.Op
- EarOp
-
-
-
- ejb/OpLocal
- Session
-
- org.ow2.jonas.earsample.beans.secusb.OpLocalHome
-
- org.ow2.jonas.earsample.beans.secusb.OpLocal
- secusb.jar#EarOp
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/Src.iml b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/Src.iml
deleted file mode 100644
index be52174c1af3539ba3986363cad6acd26699f78a..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/Src.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/Op.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/Op.java
deleted file mode 100644
index c2b3f09e3843f02f147cd231f936526c17d0caf4..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/Op.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer(s):
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.beans.secusb;
-
-import javax.ejb.EJBObject;
-import java.rmi.RemoteException;
-
-/**
- * Remote interface for the bean Op
- * @author JOnAS team
- */
-public interface Op extends EJBObject {
-
- /**
- * Business method implementation.
- * @param shares nb of shares to be bought
- * @throws RemoteException if RMI failed.
- */
- void buy (int shares) throws RemoteException;
-
- /**
- * Business method implementation.
- * @return the nb of shares bought
- * @throws RemoteException if RMI failed.
- */
- int read () throws RemoteException;
-
-}
\ No newline at end of file
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpBean.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpBean.java
deleted file mode 100644
index 1a0a5b0708b7bcd18f0669a8d3297de4169205c1..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpBean.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer(s):
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.beans.secusb;
-
-import javax.ejb.EJBException;
-import javax.ejb.SessionBean;
-import javax.ejb.SessionContext;
-import javax.ejb.SessionSynchronization;
-
-/**
- * This is an example of Session Bean, statefull, and synchronized.
- * @author JOnAS team
- */
-public class OpBean implements SessionBean, SessionSynchronization {
-
- /**
- * Actual state of the bean
- */
- private int total = 0;
-
- /**
- * value inside Tx, not yet committed.
- */
- private int newtotal = 0;
-
- /**
- * User client
- */
- private String clientUser = null;
-
- /**
- * Session context that the container provides for a session enterprise Bean
- * instance.
- */
- private SessionContext sessionContext = null;
-
- /* ========================= ejbCreate methods ============================ */
-
- /**
- * There must be one ejbCreate() method per create() method on the Home
- * interface, and with the same signature.
- * @param user the user name
- */
- public void ejbCreate(String user) {
- total = 0;
- // in case we are outside transactions
- newtotal = total;
- clientUser = user;
- }
-
- /* =============== javax.ejb.SessionBean 2.0 implementation ============== */
-
- /**
- * The activate method is called when the instance is activated from its
- * "passive" state. The instance should acquire any resource that it has
- * released earlier in the ejbPassivate() method. This method is called with
- * no transaction context.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException This exception is defined in the method
- * signature to provide backward compatibility for enterprise beans
- * written for the EJB 1.0 specification. Enterprise beans written
- * for the EJB 1.1 specification should throw the
- * javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB2.0 and higher specifications must throw
- * the javax.ejb.EJBException instead of this exception.
- */
- public void ejbActivate() throws EJBException, java.rmi.RemoteException {
- // Nothing to do for this simple example
- }
-
- /**
- * The passivate method is called before the instance enters the "passive"
- * state. The instance should release any resources that it can re-acquire
- * later in the ejbActivate() method. After the passivate method completes,
- * the instance must be in a state that allows the container to use the Java
- * Serialization protocol to externalize and store away the instance's
- * state. This method is called with no transaction context.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException This exception is defined in the method
- * signature to provide backward compatibility for enterprise beans
- * written for the EJB 1.0 specification. Enterprise beans written
- * for the EJB 1.1 specification should throw the
- * javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB2.0 and higher specifications must throw
- * the javax.ejb.EJBException instead of this exception.
- */
- public void ejbPassivate() throws EJBException, java.rmi.RemoteException {
- // Nothing to do for this simple example
- }
-
- /**
- * A container invokes this method before it ends the life of the session
- * object. This happens as a result of a client's invoking a remove
- * operation, or when a container decides to terminate the session object
- * after a timeout. This method is called with no transaction context.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException This exception is defined in the method
- * signature to provide backward compatibility for enterprise beans
- * written for the EJB 1.0 specification. Enterprise beans written
- * for the EJB 1.1 specification should throw the
- * javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB2.0 and higher specifications must throw
- * the javax.ejb.EJBException instead of this exception.
- */
- public void ejbRemove() throws EJBException, java.rmi.RemoteException {
- // Nothing to do for this simple example
- }
-
- /**
- * Set the associated session context. The container calls this method after
- * the instance creation. The enterprise Bean instance should store the
- * reference to the context object in an instance variable. This method is
- * called with no transaction context.
- * @param sessionContext A SessionContext interface for the instance.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException This exception is defined in the method
- * signature to provide backward compatibility for applications
- * written for the EJB 1.0 specification. Enterprise beans written
- * for the EJB 1.1 specification should throw the
- * javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB2.0 and higher specifications must throw
- * the javax.ejb.EJBException instead of this exception.
- */
- public void setSessionContext(SessionContext sessionContext) throws EJBException, java.rmi.RemoteException {
- this.sessionContext = sessionContext;
- }
-
- /*
- * ============== javax.ejb.SessionSynchronization implementation
- * =============
- */
-
- /**
- * The afterBegin method notifies a session Bean instance that a new
- * transaction has started, and that the subsequent business methods on the
- * instance will be invoked in the context of the transaction. The instance
- * can use this method, for example, to read data from a database and cache
- * the data in the instance fields. This method executes in the proper
- * transaction context.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException - This exception is defined in the
- * method signature to provide backward compatibility for enterprise
- * beans written for the EJB 1.0 specification. Enterprise beans
- * written for the EJB 1.1 and higher specifications should throw
- * the javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB 2.0 and higher specifications must not
- * throw the java.rmi.RemoteException.
- */
- public void afterBegin() throws EJBException, java.rmi.RemoteException {
- newtotal = total;
- }
-
- /**
- * The beforeCompletion method notifies a session Bean instance that a
- * transaction is about to be committed. The instance can use this method,
- * for example, to write any cached data to a database. This method executes
- * in the proper transaction context. Note: The instance may still
- * cause the container to rollback the transaction by invoking the
- * setRollbackOnly() method on the instance context, or by throwing an
- * exception.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException - This exception is defined in the
- * method signature to provide backward compatibility for enterprise
- * beans written for the EJB 1.0 specification. Enterprise beans
- * written for the EJB 1.1 and higher specifications should throw
- * the javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB 2.0 and higher specifications must not
- * throw the java.rmi.RemoteException.
- */
- public void beforeCompletion() throws EJBException, java.rmi.RemoteException {
- }
-
- /**
- * The afterCompletion method notifies a session Bean instance that a
- * transaction commit protocol has completed, and tells the instance whether
- * the transaction has been committed or rolled back. This method executes
- * with no transaction context.
- * @param committed - True if the transaction has been committed, false if
- * is has been rolled back.
- * @throws EJBException Thrown by the method to indicate a failure caused by
- * a system-level error.
- * @throws java.rmi.RemoteException - This exception is defined in the
- * method signature to provide backward compatibility for enterprise
- * beans written for the EJB 1.0 specification. Enterprise beans
- * written for the EJB 1.1 and higher specifications should throw
- * the javax.ejb.EJBException instead of this exception. Enterprise
- * beans written for the EJB 2.0 and higher specifications must not
- * throw the java.rmi.RemoteException.
- */
- public void afterCompletion(boolean committed) throws EJBException, java.rmi.RemoteException {
-
- if (committed) {
- total = newtotal;
- } else {
- newtotal = total;
- }
- }
-
- /* ========================= Op implementation ============================ */
-
- /**
- * Business method implementation.
- * @param s nb of shares to be bought
- */
- public void buy(int s) {
- newtotal = newtotal + s;
- return;
- }
-
- /**
- * Business method implementation.
- * @return the nb of shares bought
- */
- public int read() {
- return newtotal;
- }
-}
\ No newline at end of file
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpHome.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpHome.java
deleted file mode 100644
index df6fe5967874bf27aafdca196dffa2f7bdd16d5e..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpHome.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer(s):
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.beans.secusb;
-
-import java.rmi.RemoteException;
-import javax.ejb.CreateException;
-import javax.ejb.EJBHome;
-
-/**
- * Home interface for the bean Op
- * @author JOnAS team
- */
-public interface OpHome extends EJBHome {
-
- /**
- * Create an instance of the Op bean.
- * @param user the user name.
- * @return the Remote interface of the bean Op.
- * @throws CreateException if the creation failed.
- * @throws RemoteException if the RMI call failed.
- */
- Op create(String user) throws CreateException, RemoteException;
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocal.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocal.java
deleted file mode 100644
index e183532035bbc49deae3830b746739482571aa3f..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocal.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer(s):
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.beans.secusb;
-
-import javax.ejb.EJBLocalObject;
-
-/**
- * Local interface for the bean Op
- * @author JOnAS team
- */
-public interface OpLocal extends EJBLocalObject {
-
- /**
- * Business method implementation.
- * @param shares nb of shares to be bought
- */
- void buy(int shares);
-
- /**
- * Business method implementation.
- * @return the nb of shares bought
- */
- int read();
-}
\ No newline at end of file
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocalHome.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocalHome.java
deleted file mode 100644
index f3a3a2d66051810864575958847a9b731f2db15e..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/beans/secusb/OpLocalHome.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer(s):
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.beans.secusb;
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBLocalHome;
-
-/**
- * Local home interface for the bean Op
- * @author JOnAS team
- */
-public interface OpLocalHome extends EJBLocalHome {
-
- /**
- * Create an instance of the Op bean.
- * @param user the user name.
- * @return the Remote interface of the bean Op.
- * @throws CreateException if the creation failed.
- */
- OpLocal create(String user) throws CreateException;
-}
\ No newline at end of file
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/clients/Client.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/clients/Client.java
deleted file mode 100644
index 82dce612be3bc110639edc048d18ad60403db192..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/clients/Client.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2004 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * Initial developer: Florent Benoit
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.clients;
-
-import java.net.URL;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.transaction.UserTransaction;
-import javax.rmi.PortableRemoteObject;
-
-import org.ow2.jonas.earsample.beans.secusb.Op;
-import org.ow2.jonas.earsample.beans.secusb.OpHome;
-
-
-/**
- * Heavy client doing some operations on a bean
- * @author jonas team
- */
-public class Client {
-
- /**
- * First amount to buy
- */
- private static final int FIRST_BUY_AMOUNT = 10;
-
- /**
- * Second amount to buy
- */
- private static final int SECOND_BUY_AMOUNT = 20;
-
- /**
- * Third amount to buy (will be rollback)
- */
- private static final int THIRD_BUY_AMOUNT = 50;
-
- /**
- * Constructor. Hide constructor as it is an utility class
- */
- private Client() {
-
- }
-
- /**
- * Main method
- * @param args arguments of the client
- */
- public static void main(String[] args) {
-
- Context initialContext = null;
- System.out.print("Building a new InitialContext...");
- try {
- initialContext = new InitialContext();
- } catch (Exception e) {
- System.err.println("Cannot get initial context for JNDI: " + e);
- System.exit(2);
- }
- System.out.println("done !");
-
- System.out.print("Looking up java:comp/UserTransaction ...");
- // We want to start transactions from client: get UserTransaction
- UserTransaction utx = null;
- try {
- utx = (UserTransaction) initialContext.lookup("java:comp/UserTransaction");
- } catch (Exception e) {
- System.err.println("Cannot lookup UserTransaction: " + e);
- System.exit(2);
- }
- System.out.println("done !");
-
- String envEntry = null;
- System.out.print("Looking up java:comp/env/envEntryString ...");
- try {
- envEntry = (String) initialContext.lookup("java:comp/env/envEntryString");
- } catch (Exception e) {
- System.err.println("Cannot get env-entry on JNDI " + e);
- System.exit(2);
- }
- System.out.println("done !");
- System.out.println("Env entry is : " + envEntry);
-
- URL url = null;
- System.out.print("Looking up java:comp/env/url/jonas ...");
- try {
- url = (URL) initialContext.lookup("java:comp/env/url/jonas");
- } catch (Exception e) {
- System.err.println("Cannot get URL on JNDI " + e);
- System.exit(2);
- }
- System.out.println("done !");
- System.out.println("Web site of jonas is at :" + url);
-
- System.out.print("Looking up java:comp/env/ejb/Op ...");
- // Connecting to OpHome thru JNDI
- OpHome home = null;
- try {
- home = (OpHome) PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/Op"), OpHome.class);
- System.out.println("done !");
- } catch (Exception e) {
- e.printStackTrace();
- System.err.println("Cannot lookup OpHome: " + e);
- System.exit(2);
- }
-
- // OpBean creation
- Op t1 = null;
- try {
- System.out.println("Create a bean");
- t1 = home.create("User1");
- } catch (Exception e) {
- System.err.println("Cannot create OpBean: " + e);
- System.exit(2);
- }
-
- // First transaction (committed)
- try {
- System.out.println("Start a first transaction");
- utx.begin();
- System.out.println("First request on the new bean");
- t1.buy(FIRST_BUY_AMOUNT);
- System.out.println("Second request on the bean");
- t1.buy(SECOND_BUY_AMOUNT);
- System.out.println("Commit the transaction");
- utx.commit();
- } catch (Exception e) {
- System.err.println("exception during 1st Tx: " + e);
- System.exit(2);
- }
- // Start another transaction (rolled back)
- try {
- System.out.println("Start a second transaction");
- utx.begin();
- t1.buy(THIRD_BUY_AMOUNT);
- System.out.println("Rollback the transaction");
- utx.rollback();
- } catch (Exception e) {
- System.err.println("exception during 2nd Tx: " + e);
- System.exit(2);
- }
-
- // Get the total bought, outside the transaction
- int val = 0;
- try {
- System.out.println("Request outside any transaction");
- val = t1.read();
- } catch (Exception e) {
- System.err.println("Cannot read value on t1 : " + e);
- System.exit(2);
- }
- if (val != FIRST_BUY_AMOUNT + SECOND_BUY_AMOUNT) {
- System.err.println("Bad value read: " + val);
- System.exit(2);
- }
-
- // Remove Session bean
- try {
- t1.remove();
- } catch (Exception e) {
- System.out.println("Exception on buy: " + e);
- System.exit(2);
- }
- System.out.println("ClientOp OK. Exiting.");
- }
-}
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/resourceadapters/ResourceAdapterImpl.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/resourceadapters/ResourceAdapterImpl.java
deleted file mode 100644
index d572e87cc2bfa352177b4e29892afe6777f40359..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/resourceadapters/ResourceAdapterImpl.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2005 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.resourceadapters;
-
-
-import java.net.MalformedURLException;
-import java.util.HashMap;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.resource.NotSupportedException;
-import javax.resource.ResourceException;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.BootstrapContext;
-import javax.resource.spi.ResourceAdapterInternalException;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.xa.XAResource;
-
-/**
- * A Resource adapter
- * @author kemlerp
- *
- */
-public class ResourceAdapterImpl implements javax.resource.spi.ResourceAdapter, java.io.Serializable {
-
-
- /**
- * serialVersionUID
- */
- private static final long serialVersionUID = 3834312812943456568L;
-
- /**
- * String should be the RA name when set, ie, EIS
- */
- private String eisurl;
-
- /**
- * The JNDI name
- */
- private String jndiName;
-
- /**
- * Initial context
- */
- private InitialContext ictx;
-
- /**
- * BootstrapContext
- */
- private BootstrapContext bootstrapCtx = null; // set in start()
-
- /**
- * EndpointFactories
- */
- private transient HashMap endpointFactories = new HashMap();
-
-
- /**
- * Start
- * @param bootstrapCtx bootstrapCtx
- * @throws ResourceAdapterInternalException if an error occurs
- */
- public void start(BootstrapContext bootstrapCtx) throws ResourceAdapterInternalException {
- this.bootstrapCtx = bootstrapCtx;
-
- try {
- ictx = new InitialContext();
- ictx.bind(jndiName, eisurl);
- } catch (NamingException e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- * Stop
- */
- public void stop() {
- try {
- ictx.unbind(jndiName);
- } catch (NamingException e) {
- e.printStackTrace();
- }
- }
-
-
- /**
- * Called by the application server when a message-driven bean
- * (MessageEndpoint) is deployed.
- * @param factory MessageEndpointFactory
- * @param spec activation spec
- * @throws NotSupportedException if an error occurs
- * @throws ResourceAdapterInternalException if an error occurs
- */
- public void endpointActivation(MessageEndpointFactory factory, ActivationSpec spec) throws NotSupportedException,
- ResourceAdapterInternalException {
- endpointFactories.put(spec, factory);
- }
-
- /**
- * Endpoint Deactivation
- * @param factory MessageEndpointFactory
- * @param spec activation spec
- */
- public void endpointDeactivation(MessageEndpointFactory factory, ActivationSpec spec) {
- endpointFactories.remove(spec);
- }
-
- /**
- * Get XAResources
- * @param specs A tab of specs
- * @throws ResourceException if an error occurs
- * @return Tab of XAResources
- */
- public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException {
- return null;
- }
-
- /**
- * Get Eis URL
- * @return Eis URL
- */
- public String getEisURL() {
- return eisurl.toString();
- }
-
- /**
- * Set Eis URL
- * @param eisURL Eis URL
- * @throws MalformedURLException if 'eisURL' is not a URL
- */
- public void setEisURL(String eisURL) throws MalformedURLException {
- // ra.xml deployment supplies value
- this.eisurl = eisURL;
- }
-
- /**
- * Get BootstrapContext
- * @return bootstrapCtx
- */
- public BootstrapContext getBootstrapCtx() {
- return bootstrapCtx;
- }
-
- /**
- * Set BootstrapContext
- * @param bootstrapCtx bootstrapContext
- */
- public void setBootstrapCtx(BootstrapContext bootstrapCtx) {
- this.bootstrapCtx = bootstrapCtx;
- }
-
- /**
- * Get used JNDI name
- * @return A string
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /**
- * Set JNDI name
- * @param jndiName a string
- */
- public void setJndiName(String jndiName) {
- this.jndiName = jndiName;
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/servlets/ServletOp.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/servlets/ServletOp.java
deleted file mode 100644
index 93f77783dc91cd0d6885ae4431d969716ee44462..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/j2ee1.4/src/java/org/ow2/jonas/earsample/servlets/ServletOp.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 1999-2005 Bull S.A.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.earsample.servlets;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URL;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.rmi.PortableRemoteObject;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.transaction.UserTransaction;
-
-import org.ow2.jonas.earsample.beans.secusb.Op;
-import org.ow2.jonas.earsample.beans.secusb.OpHome;
-import org.ow2.jonas.earsample.beans.secusb.OpLocal;
-import org.ow2.jonas.earsample.beans.secusb.OpLocalHome;
-
-
-/**
- * This servlet is an example to show how to access a EJB from a servlet
- * @author JOnAS team
- */
-public class ServletOp extends HttpServlet {
-
- /**
- * First amount to buy
- */
- private static final int FIRST_BUY_AMOUNT = 10;
-
- /**
- * Second amount to buy
- */
- private static final int SECOND_BUY_AMOUNT = 20;
-
- /**
- * Third amount to buy (will be rollback)
- */
- private static final int THIRD_BUY_AMOUNT = 50;
-
-
- /**
- * Called by the server (via the service method) to allow a servlet to
- * handle a GET request.
- * @param request an HttpServletRequest object that contains the request
- * the client has made of the servlet
- * @param response an HttpServletResponse object that contains the
- * response the servlet sends to the client
- * @throws IOException if an input or output error is detected when the
- * servlet handles the GET request
- * @throws ServletException if the request for the GET could not be handled
- */
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException {
-
- response.setContentType("text/html");
- PrintWriter out = response.getWriter();
- out.println("");
- out.println("");
- out.println("");
- out.println("");
- out.println("Ear Sample of Servlet accessing a protected EJB");
- out.println("");
- out.println("");
- out.println("
Ear sample of Servlet accessing a protected EJB");
- out.println("
");
-
-
- out.println("Sample is OK. ");
- out.println("");
- out.println("");
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/README b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/README
deleted file mode 100644
index b1005dc878dc0ad3414bb5c982863a9760eb53ef..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/README
+++ /dev/null
@@ -1,8 +0,0 @@
-- Ant tool must be launched in this directory
- --> a file named javaee5-earsample.ear is produced in $JONAS_BASE/deploy
-
-- Start JOnAS
-
-- Go on http://localhost:9000/javaee5-earsample/
-
-- Example is ready
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/build.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/build.xml
deleted file mode 100644
index 55008ce55fb8cd9123cd248d5335ca0eadb9ffd0..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/build.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/application.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/application.xml
deleted file mode 100644
index b0079c89648c76c40fda3e5d50c7ae9bbc5436ed..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/application.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
- Java EE 5.0 EAR Sample
- Java EE 5.0 EAR Sample
-
-
-
- ejb3.jar
-
-
-
-
-
- javaee5-earsample.war
- javaee5-earsample
-
-
-
-
-
-
- jms-application-client.jar
-
-
-
- not-secured-application-client.jar
-
-
-
- jaas-secured-application-client.jar
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-application-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-application-client.xml
deleted file mode 100644
index a663fd65656768a3ca5afa1980c775dcf6f6383a..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-application-client.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- OW2 JOnAS :: EAR Sample :: Secured Application Client
-
- org.ow2.jonas.security.auth.callback.LoginCallbackHandler
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-jonas-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-jonas-client.xml
deleted file mode 100644
index fd573be9c7804373514dccbde8aaf8b21b80382f..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas-secured-jonas-client.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
- jaas.config
- javaee5-earsample
- jonas
- jonas
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas.config b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas.config
deleted file mode 100644
index 517159a434442b0b0feaf2880e0f8e7092021a4e..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jaas.config
+++ /dev/null
@@ -1,37 +0,0 @@
-// ---------------------------------------------------------------------------
-// JOnAS: Java(TM) Open Application Server
-// Copyright (C) 2008 Bull S.A.S.
-// Contact: jonas-team@ow2.org
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA
-//
-// ---------------------------------------------------------------------------
-// $Id: build.properties 12246 2007-12-09 21:42:38Z benoitf $
-// ---------------------------------------------------------------------------
-
-javaee5-earsample {
- // Login Module to use for the example javaee5-earsample.
-
- // First, use a LoginModule for the authentication
- // Use the resource memrlm_1
- org.ow2.jonas.security.auth.spi.JResourceLoginModule required
- resourceName="memrlm_1"
- ;
-
- // Use the login module to propagate security to the JOnAS server
- org.ow2.jonas.security.auth.spi.ClientLoginModule required
- ;
-};
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-application-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-application-client.xml
deleted file mode 100644
index 60620aadf75e6515dd963d47b1fd8731d2d14392..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-application-client.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
- OW2 JOnAS :: EAR Sample :: JMS Application Client
-
-
-
- jms/QueueConnectionFactory
- javax.jms.QueueConnectionFactory
- Container
-
-
-
-
- jms/SampleQueue
- javax.jms.Queue
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-jonas-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-jonas-client.xml
deleted file mode 100644
index c9a5fe9d4af58dbf7ede7561bb5417672dc59f6a..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/jms-jonas-client.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
- jms/QueueConnectionFactory
- JQCF
-
-
-
- jms/SampleQueue
- SampleQueue
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-application-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-application-client.xml
deleted file mode 100644
index 38c9eca304cba73780de14c6150d4535d7fde6b0..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-application-client.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- OW2 JOnAS :: EAR Sample :: Not Secured Application Client
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-jonas-client.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-jonas-client.xml
deleted file mode 100644
index 01975d466417591ecff6f1c3a8767b0c48ebc4c4..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/not-secured-jonas-client.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/persistence.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/persistence.xml
deleted file mode 100644
index 051059f7763aeb41dbe857d79fea3bcf6c3bddd0..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/persistence.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
- jdbc_1
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web.xml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web.xml
deleted file mode 100644
index f71cc4a400238ddcc60803504f1a14bdb234eec8..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
- DisplayServlet
- org.ow2.jonas.examples.ear.web.ExampleServlet
-
-
-
- AdminServlet
- org.ow2.jonas.examples.ear.web.AdminServlet
-
-
-
- DisplayServlet
- /display
-
-
-
- AdminServlet
- /secured/*
-
-
-
-
- Protected Area
-
- /secured/*
-
- DELETE
- GET
- POST
- PUT
-
-
-
- earsample
-
-
-
-
-
- BASIC
- JOnAS Realm
-
-
-
-
- earsample
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/architecture.png b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/architecture.png
deleted file mode 100644
index 677540d697923559efa4c2095defb5917134492f..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/architecture.png and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/jetty.gif b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/jetty.gif
deleted file mode 100644
index 01f44a87f6801b200f142513d0d02b12cea0fb46..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/jetty.gif and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/logoOW2.png b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/logoOW2.png
deleted file mode 100644
index 71a185b68ed53e228e23c82c4ea0aa47b7556959..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/logoOW2.png and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/ow_jonas_logo.gif b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/ow_jonas_logo.gif
deleted file mode 100644
index 1b56943a721f82a8cb81776030567772265433f2..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/ow_jonas_logo.gif and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/tomcat.gif b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/tomcat.gif
deleted file mode 100644
index 61756736b82350f64b5ea1b2bfc31ac57e30a3d3..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/tomcat.gif and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/valid-xhtml11.png b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/valid-xhtml11.png
deleted file mode 100644
index 2c63d93f8868d574b9e69eda2727b7e7bf7fc8ec..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/valid-xhtml11.png and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/vcss.png b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/vcss.png
deleted file mode 100644
index 9b2f596e016533327216d98a0a927738fe17384f..0000000000000000000000000000000000000000
Binary files a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/img/vcss.png and /dev/null differ
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/index.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/index.html
deleted file mode 100644
index f587aeee4f96b86795abeb68473ebcade4f482f4..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/index.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
- Java EE 5.0 Example
-
-
-
-
-
-
-
-
-
-
-
- Java EE 5.0 Example : Servlets accessing EJBs 3.0
-
-
-
- This web application is packaged as an "ear".
- When you will click to access the secured servlet, your web browser will open a dialog box
- asking you a user ID and a password.
-
- Use : jonas for the user ID and jonas for the
- password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Java EE 5.0 Example : Architecture
-
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/ow2_jonas.css b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/ow2_jonas.css
deleted file mode 100644
index 4f0ee0e6b37f25e190dc37df5cf67d9ca2813e2f..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/etc/web/ow2_jonas.css
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- Context Root css. based on css from http://jonas.objectweb.org
- XHTML by Florent BENOIT
-*/
-
-
-body
-{
- top:10px;
- margin-top:10px;
- background-color: #FFF;
- color: #000000;
- }
-
-
-img {
- margin: 5px;
- border:0;
-}
-
-
-
-div.logos {
- top: 5px;
- width: 99%;
- text-align: right;
-}
-
-
-div.links {
- font-size: 14px;
- margin-top : 40px;
- margin-left : 200px;
-}
-
-
-div.titlepage {
- margin-left: 200px;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 1.5em;
- line-height: 1.5em;
- border-bottom: 1px solid #0099cc;
- color : #ff6600;
- font-weight : bold;
-}
-
-
-div.footer {
- margin-top : 50px;
- color: #FFFFFF;
- font-size: 8pt;
- text-align: center;
-}
-
-
-/*HTML elements */
-
-
-
-ul, ol, dl
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- line-height: 16px;
- font-weight: normal;
-}
-
-li
-{
- color: black;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- font-weight: normal;
- margin: 10px 0px 5px 0px;
-
-}
-a
-{
- color: #3F3975;
- background-color: transparent;
- text-decoration: underline;
-}
-
-a:visited
-{
- color: #9898CB;
- background-color: transparent;
- text-decoration: underline;
-}
-
-a:hover
-{
- color: #E06611;
- background-color: transparent;
- text-decoration: underline;
-}
-
-
-a:active
-{
- color: #FFFFFF;
- background-color: #E06611;
- text-decoration: underline;
-}
-
-
-
-
-.h1, .h2, .h3, .h4, .h5 {
- color: #000;
- background-color: inherit;
- padding: 0;
-}
-
-.h1 {
- margin-top: 5px;
- font-size: 2em;
- line-height: 1.5em;
- margin: 30px 0 30px 0;
- border-bottom: 1px solid #0099cc;
- color : #ff6600;
- font-weight : bold;
-}
-
-.h2 {
- margin: 20px 0 15px 0;
- border-bottom: 1px solid #0099cc;
- font-weight:normal;
- font-style: normal;
- font-size: 1.6em;
- line-height: 1.4em;
- color : #0099cc
-}
-
-.h3 {
- font-weight: normal;
- font-size: 1.4em;
- line-height: 1.4em;
- margin: 20px 0 15px 0;
-}
-
-.h4 {
- font-weight:normal;
- color: #404040;
- margin: 20px 0 0 0;
- left: 0px;
- font-size: 1.4em;
- line-height: 1.4em;
-}
-.h5 {
- font-weight:normal;
- color: #404040;
- font-style: normal;
- margin: 0px;
- left: 0px;
- font-size: 1.2em;
- line-height: 1.2em;
-}
-
-td
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- font-weight: normal;
-}
-
-p
-{
- color: black;
- font-family: Arial,Helvetica, sans-serif;
- font-size: 12px;
- line-height: 16px;
- font-weight: normal;
- margin: 10px 10px 5px 0px;
-}
-
-p.error
-{
- color: red;
-}
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/Src1.iml b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/Src1.iml
deleted file mode 100644
index be52174c1af3539ba3986363cad6acd26699f78a..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/Src1.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/JMSApplicationClient.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/JMSApplicationClient.java
deleted file mode 100644
index 311c016e96ec0d20dac24aaf06da28f93fd88c07..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/JMSApplicationClient.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.client;
-
-import java.io.PrintStream;
-import java.util.Collection;
-import java.util.List;
-
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.init.Initializer;
-import org.ow2.jonas.examples.ear.reader.RemoteReader;
-
-/**
- * This application-client shows usage of JMS destinations to
- * interact with the server-side application.
- * @author Guillaume Sauthier
- */
-public final class JMSApplicationClient {
-
- /**
- * Number of Books to be created.
- */
- private static final int ITERATION_NUMBER = 10;
-
- /**
- * Empty default constructor for utility class.
- */
- private JMSApplicationClient() {
-
- }
-
- /**
- * @param args Command line arguments
- * @throws Exception InitialContext creation failure / JMS Exception
- */
- public static void main(final String[] args) throws Exception {
-
- PrintStream out = System.out;
-
- // Print Header
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- out.println("OW2 JOnAS :: EAR Sample :: Messager Application Client ");
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
-
-
- // Lookup the Remote Bean interface through JNDI
- Context initialContext = new InitialContext();
-
- // Init. data if needed
- out.print("Initialization ... ");
- Initializer bean = (Initializer) initialContext.lookup("myInitializerBean");
- bean.initializeEntities();
- out.println("Done.");
-
- // Get the JMS QueueConnectionFactory
- QueueConnectionFactory factory = null;
- factory = (QueueConnectionFactory) initialContext.lookup("java:comp/env/jms/QueueConnectionFactory");
-
- // Get the JMS Queue
- Queue queue = (Queue) initialContext.lookup("java:comp/env/jms/SampleQueue");
-
- // Send Book creation Messages
- QueueConnection connection = factory.createQueueConnection();
- QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
- QueueSender sender = session.createSender(queue);
-
- for (int i = 0; i < ITERATION_NUMBER; i++) {
- String title = "Encyclopedia Universalis Vol." + i;
- Message message = session.createTextMessage(title);
- sender.send(message);
- out.println("Sended creation order for '" + title + "'");
- }
-
- // Close JMS objects
- sender.close();
- session.close();
- connection.close();
-
- // Wait for some time ...
- // Remember JMS is for asynchronous messages :)
- final long period = 2500;
- out.println("Wait for " + period + " ms...");
- Thread.sleep(period);
-
- // Get the Reader EJB to see the results
- String jndiName = "org.ow2.jonas.examples.ear.reader.ReaderBean"
- + "_" + RemoteReader.class.getName() + "@Remote";
- out.println("Get Reader Bean ... ");
- RemoteReader readerBean = (RemoteReader) initialContext.lookup(jndiName);
-
- // List Authors and Books
- List authors = readerBean.listAllAuthors();
- for (Author author : authors) {
- out.println(" * " + author.getName());
- Collection books = author.getBooks();
- for (Book book : books) {
- out.println(" -> " + book.getTitle() + " [id: " + book.getId() + "]");
- }
- }
-
- out.println("Success.");
-
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/NotSecuredApplicationClient.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/NotSecuredApplicationClient.java
deleted file mode 100644
index 879b37f14d8063d03d1a6039da48ba210bb46d04..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/NotSecuredApplicationClient.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.client;
-
-import java.io.PrintStream;
-import java.util.Collection;
-import java.util.List;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.init.Initializer;
-import org.ow2.jonas.examples.ear.mail.Mailer;
-import org.ow2.jonas.examples.ear.reader.RemoteReader;
-
-/**
- * Simple Application Client.
- * @author Guillaume Sauthier
- */
-public final class NotSecuredApplicationClient {
-
- /**
- * Empty default constructor for utility class.
- */
- private NotSecuredApplicationClient() {
-
- }
-
- /**
- * @param args Command line arguments
- * @throws NamingException InitialContext creation failure
- */
- public static void main(final String[] args) throws NamingException {
-
- PrintStream out = System.out;
-
- // Print Header
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- out.println("OW2 JOnAS :: EAR Sample :: Not Secured Application Client ");
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
-
- // Lookup the Remote Bean interface through JNDI
- Context initialContext = new InitialContext();
-
- // Init datas if needed
- out.print("Initialization ... ");
- Initializer bean = (Initializer) initialContext.lookup("myInitializerBean");
- bean.initializeEntities();
- out.println("Done.");
-
- // Get the bean
- String jndiName = "org.ow2.jonas.examples.ear.reader.ReaderBean"
- + "_" + RemoteReader.class.getName() + "@Remote";
- RemoteReader readerBean = (RemoteReader) initialContext.lookup(jndiName);
- out.println("Get the RemoteReader Bean reference: " + readerBean);
-
- // List registered authors and their books
- out.println("List of authors, and their books:");
- // retrieve again the authors list (now it has been initialized)
- List authors = readerBean.listAllAuthors();
- for (Author author : authors) {
- out.println(" * " + author.getName());
- Collection books = author.getBooks();
- for (Book book : books) {
- out.println(" -> " + book.getTitle() + " [id: " + book.getId() + "]");
- }
- }
-
- // Only list registered books
- List books = readerBean.listAllBooks();
- out.println("List of books:");
- for(Book book : books) {
- out.println(" * " + book.getTitle() + " [" + book.getAuthor().getName() + "]");
- }
-
- // Use the Mailer bean to send
- // Use the first command line argument as a mail address.
- // Fall back to a reasonable default ${user.name}@localhost
- String address = System.getProperty("user.name") + "@localhost";
- if (args.length > 0) {
- // Got an argument, use it ...
- address = args[0];
- }
-
- // Get the Mailer Bean reference
- Mailer mailerBean = (Mailer) initialContext.lookup("myMailerBean");
- out.println("Get the Mailer Bean reference: " + mailerBean);
-
- // Call the Mailer bean to send the expected e-mail.
- mailerBean.sendStatusMail(address);
-
- // OK, we're done
- out.println("Success.");
-
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/SecuredApplicationClient.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/SecuredApplicationClient.java
deleted file mode 100644
index fb3f8467dbd12c0c7a46f1be5a65115da0775a5f..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/SecuredApplicationClient.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.client;
-
-import java.io.PrintStream;
-import java.util.Collection;
-import java.util.List;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.init.Initializer;
-import org.ow2.jonas.examples.ear.reader.RemoteReader;
-import org.ow2.jonas.examples.ear.writer.RemoteWriter;
-
-/**
- * Simple Application Client.
- * @author Guillaume Sauthier
- */
-public final class SecuredApplicationClient {
-
- /**
- * Empty default constructor for utility class.
- */
- private SecuredApplicationClient() {
-
- }
-
- /**
- * @param args Command line arguments
- * @throws NamingException InitialContext creation failure
- */
- public static void main(final String[] args) throws NamingException {
-
- PrintStream out = System.out;
-
- // Print Header
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
- out.println("OW2 JOnAS :: EAR Sample :: Secured Application Client ");
- out.println("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
-
-
- // Lookup the Remote Bean interface through JNDI
- Context initialContext = new InitialContext();
-
- // Init. data if needed
- out.print("Initialization ... ");
- Initializer bean = (Initializer) initialContext.lookup("myInitializerBean");
- bean.initializeEntities();
- out.println("Done.");
-
- // Get the not secured bean
- // - - - - - - - - - - - - - - - - -
- String readerJndiName = "org.ow2.jonas.examples.ear.reader.ReaderBean"
- + "_" + RemoteReader.class.getName() + "@Remote";
- RemoteReader readerBean = (RemoteReader) initialContext.lookup(readerJndiName);
- out.println("Get the RemoteReader Bean reference: " + readerBean);
-
- // List registered authors and their books
- out.println("List of authors, and their books:");
- // retrieve again the authors list (now it has been initialized)
- List authors = readerBean.listAllAuthors();
- for (Author author : authors) {
- out.println(" * " + author.getName());
- Collection books = author.getBooks();
- for (Book book : books) {
- out.println(" -> " + book.getTitle() + " [id: " + book.getId() + "]");
- }
- }
-
- // Use the secured Bean (RemoteWriter)
- // ======================================
-
- // Get the bean
- String writerJndiName = "org.ow2.jonas.examples.ear.writer.WriterBean"
- + "_" + RemoteWriter.class.getName() + "@Remote";
- RemoteWriter writerBean = (RemoteWriter) initialContext.lookup(writerJndiName);
- out.println("Get the RemoteWriter Bean reference: " + writerBean);
-
- // Add another author, and some books
- Author zola = new Author("Emile Zola");
- Book germinal = new Book("Germinal", zola);
- Book beteHumaine = new Book("La Bete Humaine", zola);
- zola.getBooks().add(germinal);
- zola.getBooks().add(beteHumaine);
-
- // Display Author before storage
- out.println("Created a new Author: ");
- out.println(zola.toString());
-
- // Persists
- writerBean.addAuthor(zola);
-
- // See the new content
- out.println("Updated authors' list:");
- authors = readerBean.listAllAuthors();
- for (Author author : authors) {
- out.println(" * " + author.getName());
- Collection books = author.getBooks();
- for (Book book : books) {
- out.println(" -> " + book.getTitle() + " [id: " + book.getId() + "]");
- }
- }
-
- // Remove Zola (and its books), so that next time the client
- // is executed, we can add them again.
- writerBean.removeAuthor(zola);
- out.println("Cleaned added Author.");
-
- out.println("Success.");
-
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/package.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/package.html
deleted file mode 100644
index ebf29edebc591d3821a7a22226ecba37602dacf0..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/client/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Java EE 5.0 EAR Sample
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Author.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Author.java
deleted file mode 100644
index b5691c8e6a867f4997103598d215962fa174fabe..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Author.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2007 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.entity;
-
-import static org.ow2.jonas.examples.ear.entity.Author.QN.ALL_AUTHORS;
-import static org.ow2.jonas.examples.ear.entity.Author.QN.FIND_AUTHOR;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
-
-/**
- * Author of a book.
- * @author Florent Benoit
- */
-@Entity
-@NamedQueries({@NamedQuery(name=ALL_AUTHORS, query="select o FROM Author o"),
- @NamedQuery(name=FIND_AUTHOR, query="select o FROM Author o WHERE name = :name")})
-public class Author implements Serializable {
- /**
- * Store Query names.
- */
- public static interface QN {
- /**
- * Search all authors.
- */
- String ALL_AUTHORS = "Author.allAuthors";
-
- /**
- * Search a named author.
- */
- String FIND_AUTHOR = "Author.findAuthor";
- }
-
- /**
- * Serial Version UID.
- */
- private static final long serialVersionUID = 0L;
-
- /**
- * Primary key (will be auto generated).
- */
- private long id;
-
- /**
- * Name of the author.
- */
- private String name = null;
-
- /**
- * List of books written by the author.
- */
- private Collection books;
-
- /**
- * Default constructor.
- */
- public Author() {
- books = new ArrayList();
- }
-
- /**
- * Constructor with a given author name.
- * @param name - the name of the author
- */
- public Author(final String name) {
- this();
- setName(name);
- }
-
- /**
- * Relation ship (do not using lazy mode).
- * @return books written by this author
- */
- @OneToMany(mappedBy="author", fetch=FetchType.EAGER, cascade=CascadeType.ALL)
- public Collection getBooks() {
- return books;
- }
-
- /**
- * Add a book with a given title.
- * @param title - the title of the book
- */
- public void addBook(final String title) {
- Book livre = new Book();
- livre.setTitle(title);
- livre.setAuthor(this);
- getBooks().add(livre);
- }
-
- /**
- * Sets the collection of books written by this author.
- * @param books the list of the books
- */
- public void setBooks(final Collection books) {
- this.books = books;
- }
-
- /**
- * @return name of the author
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name of the author.
- * @param name - the name of this author
- */
- public void setName(final String name) {
- this.name = name;
- }
-
- /**
- * @return an id for this object (incremented automatically)
- */
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- public long getId() {
- return this.id;
- }
-
- /**
- * Sets the id of this author object.
- * @param id the given id of this author
- */
- public void setId(final long id) {
- this.id = id;
- }
-
-
- /**
- * @return String representation of this entity object.
- */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(this.getClass().getName());
- sb.append("[id=");
- sb.append(getId());
- sb.append(", name=");
- sb.append(getName());
- sb.append("]");
- return sb.toString();
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Book.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Book.java
deleted file mode 100644
index fa4ca2b64b9d21c896aa89fe6d11b4ebc4c4d87b..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/Book.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2007 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.entity;
-
-import java.io.Serializable;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-
-/**
- * Define a book.
- * @author Florent Benoit
- */
-@Entity
-@NamedQueries({@NamedQuery(name=Book.QN.ALL_BOOKS, query="select o FROM Book o"),
- @NamedQuery(name=Book.QN.FIND_BOOK, query="select o FROM Book o WHERE name = :name")
-})
-public class Book implements Serializable {
-
- /**
- * Defines Query names.
- */
- public static interface QN {
- /**
- * Search all books.
- */
- String ALL_BOOKS = "Book.allBooks";
-
- /**
- * Search a book.
- */
- String FIND_BOOK = "Book.findBook";
- }
-
- /**
- * Serial Version UID.
- */
- private static final long serialVersionUID = 0L;
-
- /**
- * Primary key.
- */
- private long id;
-
- /**
- * Author's book.
- */
- private Author author;
-
- /**
- * title of the book.
- */
- private String title;
-
- /**
- * Default constructor.
- */
- public Book() {
-
- }
-
- /**
- * Constructor. Build a new Book with the given title and written by the
- * given author.
- * @param title the given title
- * @param author the given author.
- */
- public Book(final String title, final Author author) {
- setTitle(title);
- setAuthor(author);
- }
-
- /**
- * @return the Author of this Book.
- */
- @ManyToOne
- @JoinColumn(name="Author_id")
- public Author getAuthor() {
- return author;
- }
-
- /**
- * Sets the author of this book.
- * @param author the given author.
- */
- public void setAuthor(final Author author) {
- this.author = author;
- }
-
- /**
- * @return the title of this book.
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Set the title of the book.
- * @param title - the title of the book
- */
- public void setTitle(final String title) {
- this.title = title;
- }
-
- /**
- * @return an id for this object (incremented automatically)
- */
- @Id
- @GeneratedValue(strategy=GenerationType.AUTO)
- public long getId() {
- return this.id;
- }
-
- /**
- * Sets the id of this author object.
- * @param id the given id of this author
- */
- public void setId(final long id) {
- this.id = id;
- }
-
- /**
- * @return String representation of this entity object.
- */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(this.getClass().getName());
- sb.append("[id=");
- sb.append(getId());
- sb.append(", title=");
- sb.append(getTitle());
- sb.append("]");
- return sb.toString();
- }
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/package.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/package.html
deleted file mode 100644
index b8e550a90da86a1f2c25b4e5a57c1f89d3d119d6..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/entity/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Java EE 5.0 EAR Sample
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/Mailer.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/Mailer.java
deleted file mode 100644
index 7b3a3e1878e147a96fdef6840916b6ef8ef95ff5..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/Mailer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.mail;
-
-/**
- * The {@link Mailer} business interface is used to send a status
- * mail, with all the {@link org.ow2.jonas.examples.ear.entity.Author}s
- * and {@link org.ow2.jonas.examples.ear.entity.Book}s in the library.
- * @author Guillaume Sauthier
- */
-public interface Mailer {
-
- /**
- * Send a mail to the given mail address.
- * @param address target mail address (must be of the form: xyz@abc.z)
- */
- void sendStatusMail(final String address);
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/MailerBean.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/MailerBean.java
deleted file mode 100644
index cbb50e7603d085b8a24873c6fbe656e7f8414522..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/MailerBean.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.mail;
-
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import javax.mail.Address;
-import javax.mail.Message;
-import javax.mail.MessageContext;
-import javax.mail.MessagingException;
-import javax.mail.NoSuchProviderException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimePartDataSource;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.reader.LocalReader;
-
-/**
- * @author Guillaume Sauthier
- */
-@Stateless(mappedName="myMailerBean")
-@Remote(Mailer.class)
-public class MailerBean implements Mailer {
-
- /**
- * Mail Session used to send the Mail.
- */
- @Resource(mappedName="mailSession_1")
- private Session mailSession;
-
- /**
- * Template for the message's content.
- */
- @Resource(mappedName="mailMimePartDS_1")
- private MimePartDataSource mimePartDatasource;
-
- /**
- * {@link LocalReader} EJB (Local interface).
- */
- @EJB
- private LocalReader reader;
-
- /**
- * Send a mail to the given mail address.
- * @param address target mail address (must be of the form: xyz@abc.z)
- * @see org.ow2.jonas.examples.ear.mail.Mailer#sendStatusMail(java.lang.String)
- */
- public void sendStatusMail(final String address) {
-
- Address mailAddress = null;
- try {
- mailAddress = new InternetAddress(address);
- } catch (AddressException e) {
- System.err.println("Invalid mail address: " + e.getMessage());
- e.printStackTrace();
- return;
- }
-
- MessageContext context = mimePartDatasource.getMessageContext();
- Message message = context.getMessage();
- try {
- message.setContent(getContent(), "text/plain");
- } catch (MessagingException e) {
- System.err.println("Cannot set message content:" + e.getMessage());
- e.printStackTrace(System.err);
- return;
- }
-
- Transport transport = null;
- try {
- transport = mailSession.getTransport(mailAddress);
- } catch (NoSuchProviderException e) {
- System.err.println("No provider found for @:" + address);
- e.printStackTrace(System.err);
- return;
- }
- try {
- transport.connect();
- transport.sendMessage(message, new Address[] {mailAddress});
- transport.close();
- } catch (MessagingException e) {
- System.err.println("Cannot send message:" + e.getMessage());
- e.printStackTrace(System.err);
- return;
- }
-
- System.out.println("Mail successfully sent to: " + address);
- }
-
- /**
- * Generate the mail's content.
- * @return the mail message content.
- */
- private String getContent() {
-
- StringBuilder sb = new StringBuilder();
-
- // Print Header
- sb.append("---------------------------------------------------\n");
- sb.append(" OW2 JOnAS EAR Sample Mailer Bean.\n");
- sb.append("---------------------------------------------------\n");
- sb.append("Generated the " + new Date() + "\n");
- sb.append("\n");
-
- // Print the Authors
- List authors = reader.listAllAuthors();
- sb.append("List of all registered Authors (" + authors.size() + ") and their Books:\n");
- for (Author author : authors) {
- sb.append(" * " + author.getName() + " [" + author.getId() + "]\n");
- Collection books = author.getBooks();
- for (Book book : books) {
- sb.append(" - " + book.getTitle() + "[" + book.getId() + "]\n");
- }
- }
-
- // Print the Books
- sb.append("\n");
- sb.append("List of all registered Books:\n");
- List books = reader.listAllBooks();
- for (Book book : books) {
- sb.append(" * " + book.getTitle() + "[" + book.getAuthor().getName() + "]\n");
- }
-
- // Print the footer
- sb.append("\n");
- sb.append("Enjoy your new JOnAS !\n");
- sb.append("\n");
- sb.append(" -- JOnAS Team\n");
-
- return sb.toString();
- }
-
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/package.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/package.html
deleted file mode 100644
index 43ff24fdaa61f718f4b802f64701e5ccfc2f16d7..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mail/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Java EE 5.0 EAR Sample
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/JMSMessageBean.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/JMSMessageBean.java
deleted file mode 100644
index 5e87a4d8940c4e9caa3d02437aa64a53b7ff6afd..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/JMSMessageBean.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.mdb;
-
-import javax.annotation.security.RunAs;
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJB;
-import javax.ejb.MessageDriven;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.reader.LocalReader;
-import org.ow2.jonas.examples.ear.writer.LocalWriter;
-
-/**
- * The {@link JMSMessageBean} is a message driven bean activated when a JMS
- * {@link Message} comes to a given Destination.
- * For each new {@link Message}, this bean will create and persists a new
- * {@link Book} instance.
- * This MDB is annotated with {@link RunAs} because it uses a secured
- * business interface.
- * @author Guillaume Sauthier
- */
-@MessageDriven(activationConfig={
- @ActivationConfigProperty(propertyName="destination",
- propertyValue="SampleQueue"),
- @ActivationConfigProperty(propertyName="destinationType",
- propertyValue="javax.jms.Queue")
- })
-@RunAs("earsample")
-public class JMSMessageBean implements MessageListener {
-
- /**
- * Secured business interface.
- */
- @EJB
- private LocalWriter writer;
-
- /**
- * Unsecured {@link LocalReader} business interface.
- */
- @EJB
- private LocalReader reader;
-
- /**
- * Called when a new JMS {@link Message} is received on the destination.
- * This method will use the {@link LocalWriter} Bean interface to add
- * Books to a given Author.
- * @param message {@link Message} containing {@link Book} title.
- * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
- */
- public void onMessage(final Message message) {
-
- // TODO to be removed
- System.out.println("Received JMS Message: " + message);
-
- // Extract Message's text value
- String text = null;
- if (message instanceof TextMessage) {
- TextMessage textMessage = (TextMessage) message;
- try {
- text = textMessage.getText();
- } catch (JMSException e) {
- System.err.println("Unexpected Exception: " + e.getMessage());
- e.printStackTrace(System.err);
- return;
- }
- } else {
- // not a TextMessage, I don't know what to do with it
- return;
- }
-
- Author edition = reader.findAuthor("Editions XY");
- if (edition == null) {
- edition = new Author("Editions XY");
- writer.addAuthor(edition);
- }
-
- // Persists a new Book
- Book book = new Book(text, edition);
- writer.addBook(book);
-
- }
-
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/package.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/package.html
deleted file mode 100644
index a381f34e332673e691112cf91cecb2917c944a93..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/mdb/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Java EE 5.0 EAR Sample
-
-
-
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/LocalReader.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/LocalReader.java
deleted file mode 100644
index a9b9de6fb36509bd65fb4ff381799053a49a1542..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/LocalReader.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.reader;
-
-/**
- * {@link javax.ejb.Local} interface.
- * @author Guillaume Sauthier
- */
-public interface LocalReader extends Reader {
-
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/Reader.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/Reader.java
deleted file mode 100644
index a00d93c3291d50dfc2596c32a3ba246b29e6401b..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/Reader.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.reader;
-
-import java.util.List;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-
-/**
- * The {@link Reader} business interface is an un-restricted
- * read only view on the entities.
- * @author Guillaume Sauthier
- */
-public interface Reader {
-
- /**
- * @return the list of all the persisted {@link Author}s.
- */
- List listAllAuthors();
-
- /**
- * @return the list of all the persisted {@link Book}s.
- */
- List listAllBooks();
-
- /**
- * Find a given {@link Author} using it's name as a key.
- * @param name {@link Author}'s name.
- * @return the first {@link Author} that matches the given name.
- */
- Author findAuthor(final String name);
-
- /**
- * Find a given {@link Book} using it's name as a key.
- * @param name {@link Book}'s name.
- * @return the first {@link Book} that matches the given name.
- */
- Book findBook(final String name);
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/ReaderBean.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/ReaderBean.java
deleted file mode 100644
index 2e6d40ed491543a7cfb05b9020eb0bee98bd5e7b..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/ReaderBean.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.reader;
-
-import static org.ow2.jonas.examples.ear.entity.Author.QN.ALL_AUTHORS;
-import static org.ow2.jonas.examples.ear.entity.Author.QN.FIND_AUTHOR;
-import static org.ow2.jonas.examples.ear.entity.Book.QN.ALL_BOOKS;
-import static org.ow2.jonas.examples.ear.entity.Book.QN.FIND_BOOK;
-
-import java.util.List;
-
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-
-/**
- *The {@link ReaderBean} EJB is an unrestricted, read-only, Stateless Bean.
- * @author Guillaume Sauthier
- */
-@Stateless
-@Local(LocalReader.class)
-@Remote(RemoteReader.class)
-public class ReaderBean implements LocalReader, RemoteReader {
-
- /**
- * Entity manager used by this bean.
- */
- @PersistenceContext
- private EntityManager entityManager = null;
-
- /**
- * Find a given {@link Author} using it's name as a key.
- * @param name {@link Author}'s name.
- * @return the first {@link Author} that matches the given name.
- */
- @SuppressWarnings("unchecked")
- public Author findAuthor(final String name) {
- Query query = entityManager.createNamedQuery(FIND_AUTHOR);
- query.setParameter("name", name);
- List authors = query.getResultList();
- if (authors != null && authors.size() > 0) {
- return authors.get(0);
- }
- return null;
- }
-
- /**
- * Find a given {@link Book} using it's name as a key.
- * @param name {@link Book}'s name.
- * @return the first {@link Book} that matches the given name.
- */
- @SuppressWarnings("unchecked")
- public Book findBook(final String name) {
- Query query = entityManager.createNamedQuery(FIND_BOOK);
- query.setParameter("name", name);
- List books = query.getResultList();
- if (books != null && books.size() > 0) {
- return books.get(0);
- }
- return null;
- }
-
- /**
- * @return the list of all the persisted {@link Author}s.
- */
- @SuppressWarnings("unchecked")
- public List listAllAuthors() {
- return entityManager.createNamedQuery(ALL_AUTHORS).getResultList();
- }
-
- /**
- * @return the list of all the persisted {@link Book}s.
- */
- @SuppressWarnings("unchecked")
- public List listAllBooks() {
- return entityManager.createNamedQuery(ALL_BOOKS).getResultList();
- }
-
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/RemoteReader.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/RemoteReader.java
deleted file mode 100644
index 634c83d9c4248e7aee1482f58ee533c2dc334fb1..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/RemoteReader.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.reader;
-
-/**
- * {@link javax.ejb.Remote} interface.
- * @author Guillaume Sauthier
- */
-public interface RemoteReader extends Reader {
-
-}
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/package.html b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/package.html
deleted file mode 100644
index 81c64c7e71d0aff3ce66369800ad4c01bd323868..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/reader/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Java EE 5.0 EAR Sample
-
-
-
Java Enterprise Edition 5.0: EAR Sample
-
-
diff --git a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/web/AdminServlet.java b/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/web/AdminServlet.java
deleted file mode 100644
index 001f63aeea6fabc79dc27efb258a04f032b7ef54..0000000000000000000000000000000000000000
--- a/jonas/assemblies/jonas-examples/src/main/resources/examples/javaee-earsample/src/java/org/ow2/jonas/examples/ear/web/AdminServlet.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/**
- * JOnAS: Java(TM) Open Application Server
- * Copyright (C) 2007-2008 Bull S.A.S.
- * Contact: jonas-team@ow2.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-
-package org.ow2.jonas.examples.ear.web;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.List;
-
-import javax.ejb.EJB;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.ow2.jonas.examples.ear.entity.Author;
-import org.ow2.jonas.examples.ear.entity.Book;
-import org.ow2.jonas.examples.ear.init.Initializer;
-import org.ow2.jonas.examples.ear.reader.LocalReader;
-import org.ow2.jonas.examples.ear.writer.LocalWriter;
-
-/**
- * Defines a servlet that is accessing the two entities through a local session
- * bean.
- * @author Florent Benoit
- * @author Guillaume Sauthier
- */
-public class AdminServlet extends HttpServlet {
-
- /**
- * Serializable class uid.
- */
- private static final long serialVersionUID = 7724116000656853982L;
-
- /**
- * Local writer bean.
- */
- @EJB
- private LocalWriter writerBean;
-
- /**
- * Local reader bean.
- */
- @EJB
- private LocalReader readerBean;
-
- /**
- * Initializer bean.
- */
- @EJB
- private Initializer initializerBean;
-
-
- /**
- * Called by the server (via the service method) to allow a servlet to
- * handle a GET request.
- * @param request an HttpServletRequest object that contains the request the
- * client has made of the servlet
- * @param response an HttpServletResponse object that contains the response
- * the servlet sends to the client
- * @throws IOException if an input or output error is detected when the
- * servlet handles the GET request
- * @throws ServletException if the request for the GET could not be handled
- */
- @Override
- public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException {
-
- response.setContentType("text/html");
- PrintWriter out = response.getWriter();
- String title = "Ear Sample of Servlet accessing an EJB";
-
- printHTMLHeader(out, title);
-
- out.println("
");
- out.println("
");
- out.println("
");
- out.println("
");
-
- // Try to init the DB if this is the very first call to this application
- initAuthorBooks(out);
-
- out.println(" ");
-
- // Print the add-author Form
- printAddAuthorForm(out);
-
- out.println("
");
- out.println("
");
-
- // Try to add the new author
- addAuthor(out, request.getParameter("author"));
-
- // Display updated list of authors
- printAuthors(out);
-
- out.println("