You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2015/09/25 12:42:36 UTC

[01/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Repository: tomee
Updated Branches:
  refs/heads/master 9abcc3988 -> f9f1b8ad0


http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java b/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
index b15d478..b6a6e18 100644
--- a/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
+++ b/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
@@ -1,318 +1,318 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import junit.framework.TestCase;
-import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
-import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
-import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
-import org.apache.wss4j.common.ext.WSPasswordCallback;
-import org.apache.wss4j.dom.WSConstants;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public class CalculatorTest extends TestCase {
-
-    //START SNIPPET: setup
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-	
-    @Override
-    protected void setUp() throws Exception {
-        final Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-
-        new InitialContext(properties);
-    }
-    //END SNIPPET: setup
-
-    //START SNIPPET: webservice
-    public void testCalculatorViaWsInterface() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImpl?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
-        outProps.put(WSHandlerConstants.USER, "jane");
-        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
-        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
-
-            @Override
-            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-                pc.setPassword("waterfall");
-            }
-        });
-
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(10, calc.sum(4, 6));
-    }
-
-    public void testCalculatorViaWsInterfaceWithTimestamp1way() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplTimestamp1way?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplTimestamp1way");
-
-        //        CalculatorWs calc = calcService.getPort(
-        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //		CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(12, calc.multiply(3, 4));
-    }
-
-    public void testCalculatorViaWsInterfaceWithTimestamp2ways() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplTimestamp2ways?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplTimestamp2ways");
-
-        //        CalculatorWs calc = calcService.getPort(
-        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //		CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-        endpoint.getInInterceptors().add(new SAAJInInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        final Map<String, Object> inProps = new HashMap<String, Object>();
-        inProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
-        final WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
-        endpoint.getInInterceptors().add(wssIn);
-
-        assertEquals(12, calc.multiply(3, 4));
-    }
-
-    public void testCalculatorViaWsInterfaceWithUsernameTokenPlainPassword() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenPlainPassword?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplUsernameTokenPlainPassword");
-
-        //        CalculatorWs calc = calcService.getPort(
-        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //        	CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
-        outProps.put(WSHandlerConstants.USER, "jane");
-        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
-        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
-
-            @Override
-            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-                pc.setPassword("waterfall");
-            }
-        });
-
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(10, calc.sum(4, 6));
-    }
-
-    public void testCalculatorViaWsInterfaceWithUsernameTokenHashedPassword() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenHashedPassword?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplUsernameTokenHashedPassword");
-
-        //        CalculatorWs calc = calcService.getPort(
-        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //        	CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
-        outProps.put(WSHandlerConstants.USER, "jane");
-        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
-        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
-
-            @Override
-            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-                pc.setPassword("waterfall");
-            }
-        });
-
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(10, calc.sum(4, 6));
-    }
-
-    public void testCalculatorViaWsInterfaceWithUsernameTokenPlainPasswordEncrypt() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenPlainPasswordEncrypt?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplUsernameTokenPlainPasswordEncrypt");
-
-        //        CalculatorWs calc = calcService.getPort(
-        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //        	CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN
-                                                + " " + WSHandlerConstants.ENCRYPT);
-        outProps.put(WSHandlerConstants.USER, "jane");
-        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
-        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
-
-            @Override
-            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-                pc.setPassword("waterfall");
-            }
-        });
-        outProps.put(WSHandlerConstants.ENC_PROP_FILE, "META-INF/CalculatorImplUsernameTokenPlainPasswordEncrypt-client.properties");
-        outProps.put(WSHandlerConstants.ENCRYPTION_USER, "serveralias");
-
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(10, calc.sum(4, 6));
-    }
-
-    public void testCalculatorViaWsInterfaceWithSign() throws Exception {
-        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplSign?wsdl"),
-                                                   new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
-        assertNotNull(calcService);
-
-        // for debugging (ie. TCPMon)
-        calcService.addPort(new QName("http://superbiz.org/wsdl",
-                                      "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
-                            "http://127.0.0.1:8204/CalculatorImplSign");
-
-        //      CalculatorWs calc = calcService.getPort(
-        //	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
-        //	CalculatorWs.class);
-
-        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-
-        final Client client = ClientProxy.getClient(calc);
-        final Endpoint endpoint = client.getEndpoint();
-        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
-
-        final Map<String, Object> outProps = new HashMap<String, Object>();
-        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
-        outProps.put(WSHandlerConstants.USER, "clientalias");
-        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
-
-            @Override
-            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-                pc.setPassword("clientPassword");
-            }
-        });
-        outProps.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/CalculatorImplSign-client.properties");
-        outProps.put(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
-
-        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
-        endpoint.getOutInterceptors().add(wssOut);
-
-        assertEquals(24, calc.multiply(4, 6));
-    }
-    //END SNIPPET: webservice
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import junit.framework.TestCase;
+import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
+import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+import org.apache.wss4j.dom.WSConstants;
+import org.apache.wss4j.dom.handler.WSHandlerConstants;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+public class CalculatorTest extends TestCase {
+
+    //START SNIPPET: setup
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @Override
+    protected void setUp() throws Exception {
+        final Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        new InitialContext(properties);
+    }
+    //END SNIPPET: setup
+
+    //START SNIPPET: webservice
+    public void testCalculatorViaWsInterface() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImpl?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        outProps.put(WSHandlerConstants.USER, "jane");
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
+
+            @Override
+            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+                pc.setPassword("waterfall");
+            }
+        });
+
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(10, calc.sum(4, 6));
+    }
+
+    public void testCalculatorViaWsInterfaceWithTimestamp1way() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplTimestamp1way?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplTimestamp1way");
+
+        //        CalculatorWs calc = calcService.getPort(
+        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //		CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(12, calc.multiply(3, 4));
+    }
+
+    public void testCalculatorViaWsInterfaceWithTimestamp2ways() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplTimestamp2ways?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplTimestamp2ways");
+
+        //        CalculatorWs calc = calcService.getPort(
+        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //		CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+        endpoint.getInInterceptors().add(new SAAJInInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        final Map<String, Object> inProps = new HashMap<String, Object>();
+        inProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
+        final WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
+        endpoint.getInInterceptors().add(wssIn);
+
+        assertEquals(12, calc.multiply(3, 4));
+    }
+
+    public void testCalculatorViaWsInterfaceWithUsernameTokenPlainPassword() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenPlainPassword?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplUsernameTokenPlainPassword");
+
+        //        CalculatorWs calc = calcService.getPort(
+        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //        	CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        outProps.put(WSHandlerConstants.USER, "jane");
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
+
+            @Override
+            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+                pc.setPassword("waterfall");
+            }
+        });
+
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(10, calc.sum(4, 6));
+    }
+
+    public void testCalculatorViaWsInterfaceWithUsernameTokenHashedPassword() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenHashedPassword?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplUsernameTokenHashedPassword");
+
+        //        CalculatorWs calc = calcService.getPort(
+        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //        	CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        outProps.put(WSHandlerConstants.USER, "jane");
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
+
+            @Override
+            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+                pc.setPassword("waterfall");
+            }
+        });
+
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(10, calc.sum(4, 6));
+    }
+
+    public void testCalculatorViaWsInterfaceWithUsernameTokenPlainPasswordEncrypt() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplUsernameTokenPlainPasswordEncrypt?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplUsernameTokenPlainPasswordEncrypt");
+
+        //        CalculatorWs calc = calcService.getPort(
+        //        	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //        	CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN
+                + " " + WSHandlerConstants.ENCRYPT);
+        outProps.put(WSHandlerConstants.USER, "jane");
+        outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
+
+            @Override
+            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+                pc.setPassword("waterfall");
+            }
+        });
+        outProps.put(WSHandlerConstants.ENC_PROP_FILE, "META-INF/CalculatorImplUsernameTokenPlainPasswordEncrypt-client.properties");
+        outProps.put(WSHandlerConstants.ENCRYPTION_USER, "serveralias");
+
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(10, calc.sum(4, 6));
+    }
+
+    public void testCalculatorViaWsInterfaceWithSign() throws Exception {
+        final Service calcService = Service.create(new URL("http://localhost:" + port + "/webservice-ws-security/CalculatorImplSign?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorWsService"));
+        assertNotNull(calcService);
+
+        // for debugging (ie. TCPMon)
+        calcService.addPort(new QName("http://superbiz.org/wsdl",
+                        "CalculatorWsService2"), SOAPBinding.SOAP12HTTP_BINDING,
+                "http://127.0.0.1:8204/CalculatorImplSign");
+
+        //      CalculatorWs calc = calcService.getPort(
+        //	new QName("http://superbiz.org/wsdl", "CalculatorWsService2"),
+        //	CalculatorWs.class);
+
+        final CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+
+        final Client client = ClientProxy.getClient(calc);
+        final Endpoint endpoint = client.getEndpoint();
+        endpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+
+        final Map<String, Object> outProps = new HashMap<String, Object>();
+        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
+        outProps.put(WSHandlerConstants.USER, "clientalias");
+        outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
+
+            @Override
+            public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+                final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+                pc.setPassword("clientPassword");
+            }
+        });
+        outProps.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/CalculatorImplSign-client.properties");
+        outProps.put(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
+
+        final WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
+        endpoint.getOutInterceptors().add(wssOut);
+
+        assertEquals(24, calc.multiply(4, 6));
+    }
+    //END SNIPPET: webservice
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CustomPasswordHandler.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CustomPasswordHandler.java b/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CustomPasswordHandler.java
index 6605333..5539dc3 100644
--- a/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CustomPasswordHandler.java
+++ b/examples/webservice-ws-security/src/test/java/org/superbiz/calculator/CustomPasswordHandler.java
@@ -1,44 +1,44 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import org.apache.wss4j.common.ext.WSPasswordCallback;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import java.io.IOException;
-
-public class CustomPasswordHandler implements CallbackHandler {
-
-    @Override
-    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-
-        if (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN) {
-            // TODO get the password from the users.properties if possible
-            pc.setPassword("waterfall");
-
-        } else if (pc.getUsage() == WSPasswordCallback.DECRYPT) {
-            pc.setPassword("serverPassword");
-
-        } else if (pc.getUsage() == WSPasswordCallback.SIGNATURE) {
-            pc.setPassword("serverPassword");
-
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import java.io.IOException;
+
+public class CustomPasswordHandler implements CallbackHandler {
+
+    @Override
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+
+        if (pc.getUsage() == WSPasswordCallback.USERNAME_TOKEN) {
+            // TODO get the password from the users.properties if possible
+            pc.setPassword("waterfall");
+
+        } else if (pc.getUsage() == WSPasswordCallback.DECRYPT) {
+            pc.setPassword("serverPassword");
+
+        } else if (pc.getUsage() == WSPasswordCallback.SIGNATURE) {
+            pc.setPassword("serverPassword");
+
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/Calculator.java b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/Calculator.java
index f57e9cd..393a9c9 100644
--- a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/Calculator.java
+++ b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/Calculator.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.security;
-
-import javax.jws.WebService;
-
-@WebService
-public interface Calculator {
-
-    int add(int op1, int op2);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.security;
+
+import javax.jws.WebService;
+
+@WebService
+public interface Calculator {
+
+    int add(int op1, int op2);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/CalculatorBean.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/CalculatorBean.java b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/CalculatorBean.java
index 2a406fc..8854d06 100644
--- a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/CalculatorBean.java
+++ b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/CalculatorBean.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.security;
-
-import javax.ejb.Singleton;
-import javax.jws.WebService;
-
-@Singleton
-@WebService
-public class CalculatorBean implements Calculator {
-
-    @Override
-    public int add(int op1, int op2) {
-        return op1 + op2;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.security;
+
+import javax.ejb.Singleton;
+import javax.jws.WebService;
+
+@Singleton
+@WebService
+public class CalculatorBean implements Calculator {
+
+    @Override
+    public int add(int op1, int op2) {
+        return op1 + op2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java
index c28401c..f7380a0 100644
--- a/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java
+++ b/examples/webservice-ws-with-resources-config/src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java
@@ -1,44 +1,44 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.security;
-
-import org.apache.wss4j.common.ext.WSPasswordCallback;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import java.io.IOException;
-
-public class PasswordCallbackHandler implements CallbackHandler {
-
-    private static boolean called = false;
-
-    @Override
-    public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
-        called = true;
-
-        final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
-        if (pc.getIdentifier().equals("openejb")) {
-            System.out.println("logged openejb user");
-            pc.setPassword("tomee");
-        }
-    }
-
-    public static boolean wasCalled() {
-        return called;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.security;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import java.io.IOException;
+
+public class PasswordCallbackHandler implements CallbackHandler {
+
+    private static boolean called = false;
+
+    @Override
+    public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        called = true;
+
+        final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+        if (pc.getIdentifier().equals("openejb")) {
+            System.out.println("logged openejb user");
+            pc.setPassword("tomee");
+        }
+    }
+
+    public static boolean wasCalled() {
+        return called;
+    }
+}


[08/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb-with-descriptor/src/test/java/org/superbiz/mdbdesc/ChatBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb-with-descriptor/src/test/java/org/superbiz/mdbdesc/ChatBeanTest.java b/examples/simple-mdb-with-descriptor/src/test/java/org/superbiz/mdbdesc/ChatBeanTest.java
index 79ee86b..c69281c 100644
--- a/examples/simple-mdb-with-descriptor/src/test/java/org/superbiz/mdbdesc/ChatBeanTest.java
+++ b/examples/simple-mdb-with-descriptor/src/test/java/org/superbiz/mdbdesc/ChatBeanTest.java
@@ -1,85 +1,85 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdb;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.embeddable.EJBContainer;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class ChatBeanTest extends TestCase {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource(name = "ChatBean")
-    private Queue questionQueue;
-
-    @Resource(name = "AnswerQueue")
-    private Queue answerQueue;
-
-    public void test() throws Exception {
-
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-
-        final Connection connection = connectionFactory.createConnection();
-
-        connection.start();
-
-        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        final MessageProducer questions = session.createProducer(questionQueue);
-
-        final MessageConsumer answers = session.createConsumer(answerQueue);
-
-        sendText("Hello World!", questions, session);
-
-        assertEquals("Hello, Test Case!", receiveText(answers));
-
-        sendText("How are you?", questions, session);
-
-        assertEquals("I'm doing well.", receiveText(answers));
-
-        sendText("Still spinning?", questions, session);
-
-        assertEquals("Once every day, as usual.", receiveText(answers));
-
-    }
-
-    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
-
-        questions.send(session.createTextMessage(text));
-
-    }
-
-    private String receiveText(MessageConsumer answers) throws JMSException {
-
-        return ((TextMessage) answers.receive(1000)).getText();
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdb;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.embeddable.EJBContainer;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class ChatBeanTest extends TestCase {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource(name = "ChatBean")
+    private Queue questionQueue;
+
+    @Resource(name = "AnswerQueue")
+    private Queue answerQueue;
+
+    public void test() throws Exception {
+
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+
+        final Connection connection = connectionFactory.createConnection();
+
+        connection.start();
+
+        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        final MessageProducer questions = session.createProducer(questionQueue);
+
+        final MessageConsumer answers = session.createConsumer(answerQueue);
+
+        sendText("Hello World!", questions, session);
+
+        assertEquals("Hello, Test Case!", receiveText(answers));
+
+        sendText("How are you?", questions, session);
+
+        assertEquals("I'm doing well.", receiveText(answers));
+
+        sendText("Still spinning?", questions, session);
+
+        assertEquals("Once every day, as usual.", receiveText(answers));
+
+    }
+
+    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
+
+        questions.send(session.createTextMessage(text));
+
+    }
+
+    private String receiveText(MessageConsumer answers) throws JMSException {
+
+        return ((TextMessage) answers.receive(1000)).getText();
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb/src/main/java/org/superbiz/mdb/ChatBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb/src/main/java/org/superbiz/mdb/ChatBean.java b/examples/simple-mdb/src/main/java/org/superbiz/mdb/ChatBean.java
index 4b5a464..8fd1556 100644
--- a/examples/simple-mdb/src/main/java/org/superbiz/mdb/ChatBean.java
+++ b/examples/simple-mdb/src/main/java/org/superbiz/mdb/ChatBean.java
@@ -1,98 +1,98 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdb;
-
-import javax.annotation.Resource;
-import javax.ejb.MessageDriven;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-@MessageDriven
-public class ChatBean implements MessageListener {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource(name = "AnswerQueue")
-    private Queue answerQueue;
-
-    public void onMessage(Message message) {
-        try {
-
-            final TextMessage textMessage = (TextMessage) message;
-            final String question = textMessage.getText();
-
-            if ("Hello World!".equals(question)) {
-
-                respond("Hello, Test Case!");
-
-            } else if ("How are you?".equals(question)) {
-
-                respond("I'm doing well.");
-
-            } else if ("Still spinning?".equals(question)) {
-
-                respond("Once every day, as usual.");
-
-            }
-        } catch (JMSException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private void respond(String text) throws JMSException {
-
-        Connection connection = null;
-        Session session = null;
-
-        try {
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create a Session
-            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-            // Create a MessageProducer from the Session to the Topic or Queue
-            MessageProducer producer = session.createProducer(answerQueue);
-            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-            // Create a message
-            TextMessage message = session.createTextMessage(text);
-
-            // Tell the producer to send the message
-            producer.send(message);
-        } finally {
-            // Clean up
-            if (session != null) {
-                session.close();
-            }
-            if (connection != null) {
-                connection.close();
-            }
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdb;
+
+import javax.annotation.Resource;
+import javax.ejb.MessageDriven;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+@MessageDriven
+public class ChatBean implements MessageListener {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource(name = "AnswerQueue")
+    private Queue answerQueue;
+
+    public void onMessage(Message message) {
+        try {
+
+            final TextMessage textMessage = (TextMessage) message;
+            final String question = textMessage.getText();
+
+            if ("Hello World!".equals(question)) {
+
+                respond("Hello, Test Case!");
+
+            } else if ("How are you?".equals(question)) {
+
+                respond("I'm doing well.");
+
+            } else if ("Still spinning?".equals(question)) {
+
+                respond("Once every day, as usual.");
+
+            }
+        } catch (JMSException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    private void respond(String text) throws JMSException {
+
+        Connection connection = null;
+        Session session = null;
+
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            // Create a Session
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Create a MessageProducer from the Session to the Topic or Queue
+            MessageProducer producer = session.createProducer(answerQueue);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+            // Create a message
+            TextMessage message = session.createTextMessage(text);
+
+            // Tell the producer to send the message
+            producer.send(message);
+        } finally {
+            // Clean up
+            if (session != null) {
+                session.close();
+            }
+            if (connection != null) {
+                connection.close();
+            }
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb/src/test/java/org/superbiz/mdb/ChatBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb/src/test/java/org/superbiz/mdb/ChatBeanTest.java b/examples/simple-mdb/src/test/java/org/superbiz/mdb/ChatBeanTest.java
index a360d10..700cc96 100644
--- a/examples/simple-mdb/src/test/java/org/superbiz/mdb/ChatBeanTest.java
+++ b/examples/simple-mdb/src/test/java/org/superbiz/mdb/ChatBeanTest.java
@@ -1,84 +1,84 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdb;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.embeddable.EJBContainer;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class ChatBeanTest extends TestCase {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource(name = "ChatBean")
-    private Queue questionQueue;
-
-    @Resource(name = "AnswerQueue")
-    private Queue answerQueue;
-
-    public void test() throws Exception {
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-
-        final Connection connection = connectionFactory.createConnection();
-
-        connection.start();
-
-        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        final MessageProducer questions = session.createProducer(questionQueue);
-
-        final MessageConsumer answers = session.createConsumer(answerQueue);
-
-        sendText("Hello World!", questions, session);
-
-        assertEquals("Hello, Test Case!", receiveText(answers));
-
-        sendText("How are you?", questions, session);
-
-        assertEquals("I'm doing well.", receiveText(answers));
-
-        sendText("Still spinning?", questions, session);
-
-        assertEquals("Once every day, as usual.", receiveText(answers));
-
-    }
-
-    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
-
-        questions.send(session.createTextMessage(text));
-
-    }
-
-    private String receiveText(MessageConsumer answers) throws JMSException {
-
-        return ((TextMessage) answers.receive(1000)).getText();
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdb;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.embeddable.EJBContainer;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class ChatBeanTest extends TestCase {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource(name = "ChatBean")
+    private Queue questionQueue;
+
+    @Resource(name = "AnswerQueue")
+    private Queue answerQueue;
+
+    public void test() throws Exception {
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+
+        final Connection connection = connectionFactory.createConnection();
+
+        connection.start();
+
+        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        final MessageProducer questions = session.createProducer(questionQueue);
+
+        final MessageConsumer answers = session.createConsumer(answerQueue);
+
+        sendText("Hello World!", questions, session);
+
+        assertEquals("Hello, Test Case!", receiveText(answers));
+
+        sendText("How are you?", questions, session);
+
+        assertEquals("I'm doing well.", receiveText(answers));
+
+        sendText("Still spinning?", questions, session);
+
+        assertEquals("Once every day, as usual.", receiveText(answers));
+
+    }
+
+    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
+
+        questions.send(session.createTextMessage(text));
+
+    }
+
+    private String receiveText(MessageConsumer answers) throws JMSException {
+
+        return ((TextMessage) answers.receive(1000)).getText();
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
----------------------------------------------------------------------
diff --git a/examples/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java b/examples/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
index 6b1449a..0ee554d 100644
--- a/examples/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
+++ b/examples/simple-rest/src/main/java/org/superbiz/rest/GreetingService.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-@Path("/greeting")
-public class GreetingService {
-
-    @GET
-    public String message() {
-        return "Hi REST!";
-    }
-
-    @POST
-    public String lowerCase(final String message) {
-        return "Hi REST!".toLowerCase();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("/greeting")
+public class GreetingService {
+
+    @GET
+    public String message() {
+        return "Hi REST!";
+    }
+
+    @POST
+    public String lowerCase(final String message) {
+        return "Hi REST!".toLowerCase();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java b/examples/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
index 8ad7a4d..d7e6732 100644
--- a/examples/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
+++ b/examples/simple-rest/src/test/java/org/superbiz/rest/GreetingServiceTest.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.openejb.jee.WebApp;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.testing.Classes;
-import org.apache.openejb.testing.EnableServices;
-import org.apache.openejb.testing.Module;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertEquals;
-
-@EnableServices(value = "jaxrs")
-@RunWith(ApplicationComposer.class)
-public class GreetingServiceTest {
-
-    @Module
-    @Classes(GreetingService.class)
-    public WebApp app() {
-        return new WebApp().contextRoot("test");
-    }
-
-    @Test
-    public void get() throws IOException {
-        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").get(String.class);
-        assertEquals("Hi REST!", message);
-    }
-
-    @Test
-    public void post() throws IOException {
-        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").post("Hi REST!", String.class);
-        assertEquals("hi rest!", message);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Classes;
+import org.apache.openejb.testing.EnableServices;
+import org.apache.openejb.testing.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs")
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+
+    @Module
+    @Classes(GreetingService.class)
+    public WebApp app() {
+        return new WebApp().contextRoot("test");
+    }
+
+    @Test
+    public void get() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").get(String.class);
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void post() throws IOException {
+        final String message = WebClient.create("http://localhost:4204").path("/test/greeting/").post("Hi REST!", String.class);
+        assertEquals("hi rest!", message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-singleton/README.md
----------------------------------------------------------------------
diff --git a/examples/simple-singleton/README.md b/examples/simple-singleton/README.md
index 60aaee8..d24e14d 100644
--- a/examples/simple-singleton/README.md
+++ b/examples/simple-singleton/README.md
@@ -1,344 +1,344 @@
-Title: Simple Singleton
-
-As the name implies a `javax.ejb.Singleton` is a session bean with a guarantee that there is at most one instance in the application.
-
-What it gives that is completely missing in EJB 3.0 and prior versions is the ability to have an EJB that is notified when the application starts and notified when the application stops. So you can do all sorts of things that you previously could only do with a load-on-startup servlet. It also gives you a place to hold data that pertains to the entire application and all users using it, without the need for a static. Additionally, Singleton beans can be invoked by several threads at one time similar to a Servlet.
-
-See the [Singleton Beans](../../singleton-beans.html) page for a full description of the javax.ejb.Singleton api.
-
-#The Code
-
-## PropertyRegistry <small>Bean-Managed Concurrency</small>
-
-Here we see a bean that uses the Bean-Managed Concurrency option as well as the @Startup annotation which causes the bean to be instantiated by the container when the application starts. Singleton beans with @ConcurrencyManagement(BEAN) are responsible for their own thread-safety. The bean shown is a simple properties "registry" and provides a place where options could be set and retrieved by all beans in the application.
-
-    package org.superbiz.registry;
-    
-    import javax.annotation.PostConstruct;
-    import javax.annotation.PreDestroy;
-    import javax.ejb.ConcurrencyManagement;
-    import javax.ejb.Singleton;
-    import javax.ejb.Startup;
-    import java.util.Properties;
-    
-    import static javax.ejb.ConcurrencyManagementType.BEAN;
-    
-    @Singleton
-    @Startup
-    @ConcurrencyManagement(BEAN)
-    public class PropertyRegistry {
-    
-        // Note the java.util.Properties object is a thread-safe
-        // collections that uses synchronization.  If it didn't
-        // you would have to use some form of synchronization
-        // to ensure the PropertyRegistryBean is thread-safe.
-        private final Properties properties = new Properties();
-    
-        // The @Startup annotation ensures that this method is
-        // called when the application starts up.
-        @PostConstruct
-        public void applicationStartup() {
-            properties.putAll(System.getProperties());
-        }
-    
-        @PreDestroy
-        public void applicationShutdown() {
-            properties.clear();
-        }
-    
-        public String getProperty(final String key) {
-            return properties.getProperty(key);
-        }
-    
-        public String setProperty(final String key, final String value) {
-            return (String) properties.setProperty(key, value);
-        }
-    
-        public String removeProperty(final String key) {
-            return (String) properties.remove(key);
-        }
-    }
-
-## ComponentRegistry  <small>Container-Managed Concurrency</small>
-
-Here we see a bean that uses the Container-Managed Concurrency option, the default. With @ConcurrencyManagement(CONTAINER) the container controls whether multi-threaded access should be allowed to the bean (`@Lock(READ)`) or if single-threaded access should be enforced (`@Lock(WRITE)`).
-
-    package org.superbiz.registry;
-    
-    import javax.ejb.Lock;
-    import javax.ejb.Singleton;
-    import java.util.ArrayList;
-    import java.util.Collection;
-    import java.util.HashMap;
-    import java.util.Map;
-    
-    import static javax.ejb.LockType.READ;
-    import static javax.ejb.LockType.WRITE;
-    
-    @Singleton
-    @Lock(READ)
-    public class ComponentRegistry {
-    
-        private final Map<Class, Object> components = new HashMap<Class, Object>();
-    
-        public <T> T getComponent(final Class<T> type) {
-            return (T) components.get(type);
-        }
-    
-        public Collection<?> getComponents() {
-            return new ArrayList(components.values());
-        }
-    
-        @Lock(WRITE)
-        public <T> T setComponent(final Class<T> type, final T value) {
-            return (T) components.put(type, value);
-        }
-    
-        @Lock(WRITE)
-        public <T> T removeComponent(final Class<T> type) {
-            return (T) components.remove(type);
-        }
-    }
-
-Unless specified explicitly on the bean class or a method, the default `@Lock` value is `@Lock(WRITE)`. The code above uses the `@Lock(READ)` annotation on bean class to change the default so that multi-threaded access is granted by default. We then only need to apply the `@Lock(WRITE)` annotation to the methods that modify the state of the bean.
-
-Essentially `@Lock(READ)` allows multithreaded access to the Singleton bean instance unless someone is invoking an `@Lock(WRITE)` method. With `@Lock(WRITE)`, the thread invoking the bean will be guaranteed to have exclusive access to the Singleton bean instance for the duration of its invocation. This combination allows the bean instance to use data types that are not normally thread safe. Great care must still be used, though.
-
-In the example we see `ComponentRegistryBean` using a `java.util.HashMap` which is not synchronized. To make this ok we do three things:
-
- 1. Encapsulation. We don't expose the HashMap instance directly; including its iterators, key set, value set or entry set.
- 1. We use `@Lock(WRITE)` on the methods that mutate the map such as the `put()` and `remove()` methods.
- 1. We use `@Lock(READ)` on the `get()` and `values()` methods as they do not change the map state and are guaranteed not to be called at the same as any of the `@Lock(WRITE)` methods, so we know the state of the HashMap is no being mutated and therefore safe for reading.
-
-The end result is that the threading model for this bean will switch from multi-threaded access to single-threaded access dynamically as needed, depending on the method being invoked. This gives Singletons a bit of an advantage over Servlets for processing multi-threaded requests.
-
-See the [Singleton Beans](../../singleton-beans.html) page for  more advanced details on Container-Managed Concurrency.
-
-# Testing
-
-
-## ComponentRegistryTest
-
-    package org.superbiz.registry;
-    
-    import org.junit.AfterClass;
-    import org.junit.Assert;
-    import org.junit.Test;
-    
-    import javax.ejb.embeddable.EJBContainer;
-    import javax.naming.Context;
-    import java.net.URI;
-    import java.util.Collection;
-    import java.util.Date;
-    
-    public class ComponentRegistryTest {
-    
-        private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
-    
-        @Test
-        public void oneInstancePerMultipleReferences() throws Exception {
-    
-            final Context context = ejbContainer.getContext();
-    
-            // Both references below will point to the exact same instance
-            final ComponentRegistry one = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
-            final ComponentRegistry two = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
-    
-            final URI expectedUri = new URI("foo://bar/baz");
-            one.setComponent(URI.class, expectedUri);
-            final URI actualUri = two.getComponent(URI.class);
-            Assert.assertSame(expectedUri, actualUri);
-    
-            two.removeComponent(URI.class);
-            URI uri = one.getComponent(URI.class);
-            Assert.assertNull(uri);
-    
-            one.removeComponent(URI.class);
-            uri = two.getComponent(URI.class);
-            Assert.assertNull(uri);
-    
-            final Date expectedDate = new Date();
-            two.setComponent(Date.class, expectedDate);
-            final Date actualDate = one.getComponent(Date.class);
-            Assert.assertSame(expectedDate, actualDate);
-    
-            Collection<?> collection = one.getComponents();
-            System.out.println(collection);
-            Assert.assertEquals("Reference 'one' - ComponentRegistry contains one record", collection.size(), 1);
-    
-            collection = two.getComponents();
-            Assert.assertEquals("Reference 'two' - ComponentRegistry contains one record", collection.size(), 1);
-        }
-    
-        @AfterClass
-        public static void closeEjbContainer() {
-            ejbContainer.close();
-        }
-    }
-
-## PropertiesRegistryTest
-
-    package org.superbiz.registry;
-    
-    import org.junit.AfterClass;
-    import org.junit.Assert;
-    import org.junit.Test;
-    
-    import javax.ejb.embeddable.EJBContainer;
-    import javax.naming.Context;
-    
-    public class PropertiesRegistryTest {
-    
-        private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
-    
-        @Test
-        public void oneInstancePerMultipleReferences() throws Exception {
-    
-            final Context context = ejbContainer.getContext();
-    
-            final PropertyRegistry one = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
-            final PropertyRegistry two = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
-    
-            one.setProperty("url", "http://superbiz.org");
-            String url = two.getProperty("url");
-            Assert.assertSame("http://superbiz.org", url);
-    
-            two.removeProperty("url");
-            url = one.getProperty("url");
-            Assert.assertNull(url);
-    
-            two.setProperty("version", "1.0.5");
-            String version = one.getProperty("version");
-            Assert.assertSame("1.0.5", version);
-    
-            one.removeProperty("version");
-            version = two.getProperty("version");
-            Assert.assertNull(version);
-        }
-    
-        @AfterClass
-        public static void closeEjbContainer() {
-            ejbContainer.close();
-        }
-    }
-
-
-#Running
-
-Running the example is fairly simple. In the "simple-singleton" directory run:
-
-    $ mvn clean install
-
-Which should create output like the following.
-
-
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.registry.ComponentRegistryTest
-    INFO - ********************************************************************************
-    INFO - OpenEJB http://tomee.apache.org/
-    INFO - Startup: Sun Jun 09 03:46:51 IDT 2013
-    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
-    INFO - Version: 4.6.0-SNAPSHOT
-    INFO - Build date: 20130608
-    INFO - Build time: 04:07
-    INFO - ********************************************************************************
-    INFO - openejb.home = C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - openejb.base = C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
-    INFO - Succeeded in installing singleton service
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Creating TransactionManager(id=Default Transaction Manager)
-    INFO - Creating SecurityService(id=Default Security Service)
-    INFO - Found EjbModule in classpath: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
-    INFO - Beginning load: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
-    INFO - Configuring enterprise application: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Auto-deploying ejb PropertyRegistry: EjbDeployment(deployment-id=PropertyRegistry)
-    INFO - Auto-deploying ejb ComponentRegistry: EjbDeployment(deployment-id=ComponentRegistry)
-    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
-    INFO - Auto-creating a container for bean PropertyRegistry: Container(type=SINGLETON, id=Default Singleton Container)
-    INFO - Creating Container(id=Default Singleton Container)
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean org.superbiz.registry.ComponentRegistryTest: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Creating Container(id=Default Managed Container)
-    INFO - Using directory C:\Users\Oz\AppData\Local\Temp for stateful session passivation
-    INFO - Enterprise application "C:\Users\Oz\Desktop\ee-examples\simple-singleton" loaded.
-    INFO - Assembling app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry")
-    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
-    INFO - OpenWebBeans Container is starting...
-    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
-    INFO - All injection points were validated successfully.
-    INFO - OpenWebBeans Container has started, it took 68 ms.
-    INFO - Created Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
-    INFO - Created Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
-    INFO - Deployed Application(path=C:\Users\Oz\Desktop\ee-examples\simple-singleton)
-    [Sun Jun 09 03:46:52 IDT 2013]
-    INFO - Undeploying app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Destroying OpenEJB container
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.431 sec
-    Running org.superbiz.registry.PropertiesRegistryTest
-    INFO - ********************************************************************************
-    INFO - OpenEJB http://tomee.apache.org/
-    INFO - Startup: Sun Jun 09 03:46:52 IDT 2013
-    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
-    INFO - Version: 4.6.0-SNAPSHOT
-    INFO - Build date: 20130608
-    INFO - Build time: 04:07
-    INFO - ********************************************************************************
-    INFO - openejb.home = C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - openejb.base = C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
-    INFO - Succeeded in installing singleton service
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Creating TransactionManager(id=Default Transaction Manager)
-    INFO - Creating SecurityService(id=Default Security Service)
-    INFO - Using 'java.security.auth.login.config=jar:file:/C:/Users/Oz/.m2/repository/org/apache/openejb/openejb-core/4.6.0-SNAPSHOT/openejb-core-4.6.0-SNAPSHOT.jar!/login.config'
-    INFO - Found EjbModule in classpath: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
-    INFO - Beginning load: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
-    INFO - Configuring enterprise application: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Auto-deploying ejb ComponentRegistry: EjbDeployment(deployment-id=ComponentRegistry)
-    INFO - Auto-deploying ejb PropertyRegistry: EjbDeployment(deployment-id=PropertyRegistry)
-    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
-    INFO - Auto-creating a container for bean ComponentRegistry: Container(type=SINGLETON, id=Default Singleton Container)
-    INFO - Creating Container(id=Default Singleton Container)
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean org.superbiz.registry.PropertiesRegistryTest: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Creating Container(id=Default Managed Container)
-    INFO - Using directory C:\Users\Oz\AppData\Local\Temp for stateful session passivation
-    INFO - Enterprise application "C:\Users\Oz\Desktop\ee-examples\simple-singleton" loaded.
-    INFO - Assembling app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry")
-    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry")
-    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
-    INFO - OpenWebBeans Container is starting...
-    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
-    INFO - All injection points were validated successfully.
-    INFO - OpenWebBeans Container has started, it took 4 ms.
-    INFO - Created Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
-    INFO - Created Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
-    INFO - Deployed Application(path=C:\Users\Oz\Desktop\ee-examples\simple-singleton)
-    INFO - Undeploying app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
-    INFO - Destroying OpenEJB container
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.171 sec
-
-    Results :
-
-    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
-
+Title: Simple Singleton
+
+As the name implies a `javax.ejb.Singleton` is a session bean with a guarantee that there is at most one instance in the application.
+
+What it gives that is completely missing in EJB 3.0 and prior versions is the ability to have an EJB that is notified when the application starts and notified when the application stops. So you can do all sorts of things that you previously could only do with a load-on-startup servlet. It also gives you a place to hold data that pertains to the entire application and all users using it, without the need for a static. Additionally, Singleton beans can be invoked by several threads at one time similar to a Servlet.
+
+See the [Singleton Beans](../../singleton-beans.html) page for a full description of the javax.ejb.Singleton api.
+
+#The Code
+
+## PropertyRegistry <small>Bean-Managed Concurrency</small>
+
+Here we see a bean that uses the Bean-Managed Concurrency option as well as the @Startup annotation which causes the bean to be instantiated by the container when the application starts. Singleton beans with @ConcurrencyManagement(BEAN) are responsible for their own thread-safety. The bean shown is a simple properties "registry" and provides a place where options could be set and retrieved by all beans in the application.
+
+    package org.superbiz.registry;
+    
+    import javax.annotation.PostConstruct;
+    import javax.annotation.PreDestroy;
+    import javax.ejb.ConcurrencyManagement;
+    import javax.ejb.Singleton;
+    import javax.ejb.Startup;
+    import java.util.Properties;
+    
+    import static javax.ejb.ConcurrencyManagementType.BEAN;
+    
+    @Singleton
+    @Startup
+    @ConcurrencyManagement(BEAN)
+    public class PropertyRegistry {
+    
+        // Note the java.util.Properties object is a thread-safe
+        // collections that uses synchronization.  If it didn't
+        // you would have to use some form of synchronization
+        // to ensure the PropertyRegistryBean is thread-safe.
+        private final Properties properties = new Properties();
+    
+        // The @Startup annotation ensures that this method is
+        // called when the application starts up.
+        @PostConstruct
+        public void applicationStartup() {
+            properties.putAll(System.getProperties());
+        }
+    
+        @PreDestroy
+        public void applicationShutdown() {
+            properties.clear();
+        }
+    
+        public String getProperty(final String key) {
+            return properties.getProperty(key);
+        }
+    
+        public String setProperty(final String key, final String value) {
+            return (String) properties.setProperty(key, value);
+        }
+    
+        public String removeProperty(final String key) {
+            return (String) properties.remove(key);
+        }
+    }
+
+## ComponentRegistry  <small>Container-Managed Concurrency</small>
+
+Here we see a bean that uses the Container-Managed Concurrency option, the default. With @ConcurrencyManagement(CONTAINER) the container controls whether multi-threaded access should be allowed to the bean (`@Lock(READ)`) or if single-threaded access should be enforced (`@Lock(WRITE)`).
+
+    package org.superbiz.registry;
+    
+    import javax.ejb.Lock;
+    import javax.ejb.Singleton;
+    import java.util.ArrayList;
+    import java.util.Collection;
+    import java.util.HashMap;
+    import java.util.Map;
+    
+    import static javax.ejb.LockType.READ;
+    import static javax.ejb.LockType.WRITE;
+    
+    @Singleton
+    @Lock(READ)
+    public class ComponentRegistry {
+    
+        private final Map<Class, Object> components = new HashMap<Class, Object>();
+    
+        public <T> T getComponent(final Class<T> type) {
+            return (T) components.get(type);
+        }
+    
+        public Collection<?> getComponents() {
+            return new ArrayList(components.values());
+        }
+    
+        @Lock(WRITE)
+        public <T> T setComponent(final Class<T> type, final T value) {
+            return (T) components.put(type, value);
+        }
+    
+        @Lock(WRITE)
+        public <T> T removeComponent(final Class<T> type) {
+            return (T) components.remove(type);
+        }
+    }
+
+Unless specified explicitly on the bean class or a method, the default `@Lock` value is `@Lock(WRITE)`. The code above uses the `@Lock(READ)` annotation on bean class to change the default so that multi-threaded access is granted by default. We then only need to apply the `@Lock(WRITE)` annotation to the methods that modify the state of the bean.
+
+Essentially `@Lock(READ)` allows multithreaded access to the Singleton bean instance unless someone is invoking an `@Lock(WRITE)` method. With `@Lock(WRITE)`, the thread invoking the bean will be guaranteed to have exclusive access to the Singleton bean instance for the duration of its invocation. This combination allows the bean instance to use data types that are not normally thread safe. Great care must still be used, though.
+
+In the example we see `ComponentRegistryBean` using a `java.util.HashMap` which is not synchronized. To make this ok we do three things:
+
+ 1. Encapsulation. We don't expose the HashMap instance directly; including its iterators, key set, value set or entry set.
+ 1. We use `@Lock(WRITE)` on the methods that mutate the map such as the `put()` and `remove()` methods.
+ 1. We use `@Lock(READ)` on the `get()` and `values()` methods as they do not change the map state and are guaranteed not to be called at the same as any of the `@Lock(WRITE)` methods, so we know the state of the HashMap is no being mutated and therefore safe for reading.
+
+The end result is that the threading model for this bean will switch from multi-threaded access to single-threaded access dynamically as needed, depending on the method being invoked. This gives Singletons a bit of an advantage over Servlets for processing multi-threaded requests.
+
+See the [Singleton Beans](../../singleton-beans.html) page for  more advanced details on Container-Managed Concurrency.
+
+# Testing
+
+
+## ComponentRegistryTest
+
+    package org.superbiz.registry;
+    
+    import org.junit.AfterClass;
+    import org.junit.Assert;
+    import org.junit.Test;
+    
+    import javax.ejb.embeddable.EJBContainer;
+    import javax.naming.Context;
+    import java.net.URI;
+    import java.util.Collection;
+    import java.util.Date;
+    
+    public class ComponentRegistryTest {
+    
+        private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
+    
+        @Test
+        public void oneInstancePerMultipleReferences() throws Exception {
+    
+            final Context context = ejbContainer.getContext();
+    
+            // Both references below will point to the exact same instance
+            final ComponentRegistry one = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
+            final ComponentRegistry two = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
+    
+            final URI expectedUri = new URI("foo://bar/baz");
+            one.setComponent(URI.class, expectedUri);
+            final URI actualUri = two.getComponent(URI.class);
+            Assert.assertSame(expectedUri, actualUri);
+    
+            two.removeComponent(URI.class);
+            URI uri = one.getComponent(URI.class);
+            Assert.assertNull(uri);
+    
+            one.removeComponent(URI.class);
+            uri = two.getComponent(URI.class);
+            Assert.assertNull(uri);
+    
+            final Date expectedDate = new Date();
+            two.setComponent(Date.class, expectedDate);
+            final Date actualDate = one.getComponent(Date.class);
+            Assert.assertSame(expectedDate, actualDate);
+    
+            Collection<?> collection = one.getComponents();
+            System.out.println(collection);
+            Assert.assertEquals("Reference 'one' - ComponentRegistry contains one record", collection.size(), 1);
+    
+            collection = two.getComponents();
+            Assert.assertEquals("Reference 'two' - ComponentRegistry contains one record", collection.size(), 1);
+        }
+    
+        @AfterClass
+        public static void closeEjbContainer() {
+            ejbContainer.close();
+        }
+    }
+
+## PropertiesRegistryTest
+
+    package org.superbiz.registry;
+    
+    import org.junit.AfterClass;
+    import org.junit.Assert;
+    import org.junit.Test;
+    
+    import javax.ejb.embeddable.EJBContainer;
+    import javax.naming.Context;
+    
+    public class PropertiesRegistryTest {
+    
+        private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
+    
+        @Test
+        public void oneInstancePerMultipleReferences() throws Exception {
+    
+            final Context context = ejbContainer.getContext();
+    
+            final PropertyRegistry one = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
+            final PropertyRegistry two = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
+    
+            one.setProperty("url", "http://superbiz.org");
+            String url = two.getProperty("url");
+            Assert.assertSame("http://superbiz.org", url);
+    
+            two.removeProperty("url");
+            url = one.getProperty("url");
+            Assert.assertNull(url);
+    
+            two.setProperty("version", "1.0.5");
+            String version = one.getProperty("version");
+            Assert.assertSame("1.0.5", version);
+    
+            one.removeProperty("version");
+            version = two.getProperty("version");
+            Assert.assertNull(version);
+        }
+    
+        @AfterClass
+        public static void closeEjbContainer() {
+            ejbContainer.close();
+        }
+    }
+
+
+#Running
+
+Running the example is fairly simple. In the "simple-singleton" directory run:
+
+    $ mvn clean install
+
+Which should create output like the following.
+
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.registry.ComponentRegistryTest
+    INFO - ********************************************************************************
+    INFO - OpenEJB http://tomee.apache.org/
+    INFO - Startup: Sun Jun 09 03:46:51 IDT 2013
+    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFO - Version: 7.0.0-SNAPSHOT
+    INFO - Build date: 20130608
+    INFO - Build time: 04:07
+    INFO - ********************************************************************************
+    INFO - openejb.home = C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - openejb.base = C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
+    INFO - Succeeded in installing singleton service
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Creating TransactionManager(id=Default Transaction Manager)
+    INFO - Creating SecurityService(id=Default Security Service)
+    INFO - Found EjbModule in classpath: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
+    INFO - Beginning load: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
+    INFO - Configuring enterprise application: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Auto-deploying ejb PropertyRegistry: EjbDeployment(deployment-id=PropertyRegistry)
+    INFO - Auto-deploying ejb ComponentRegistry: EjbDeployment(deployment-id=ComponentRegistry)
+    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+    INFO - Auto-creating a container for bean PropertyRegistry: Container(type=SINGLETON, id=Default Singleton Container)
+    INFO - Creating Container(id=Default Singleton Container)
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean org.superbiz.registry.ComponentRegistryTest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Creating Container(id=Default Managed Container)
+    INFO - Using directory C:\Users\Oz\AppData\Local\Temp for stateful session passivation
+    INFO - Enterprise application "C:\Users\Oz\Desktop\ee-examples\simple-singleton" loaded.
+    INFO - Assembling app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry")
+    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
+    INFO - OpenWebBeans Container is starting...
+    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+    INFO - All injection points were validated successfully.
+    INFO - OpenWebBeans Container has started, it took 68 ms.
+    INFO - Created Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
+    INFO - Created Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
+    INFO - Deployed Application(path=C:\Users\Oz\Desktop\ee-examples\simple-singleton)
+    [Sun Jun 09 03:46:52 IDT 2013]
+    INFO - Undeploying app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Destroying OpenEJB container
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.431 sec
+    Running org.superbiz.registry.PropertiesRegistryTest
+    INFO - ********************************************************************************
+    INFO - OpenEJB http://tomee.apache.org/
+    INFO - Startup: Sun Jun 09 03:46:52 IDT 2013
+    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFO - Version: 7.0.0-SNAPSHOT
+    INFO - Build date: 20130608
+    INFO - Build time: 04:07
+    INFO - ********************************************************************************
+    INFO - openejb.home = C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - openejb.base = C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
+    INFO - Succeeded in installing singleton service
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Creating TransactionManager(id=Default Transaction Manager)
+    INFO - Creating SecurityService(id=Default Security Service)
+    INFO - Using 'java.security.auth.login.config=jar:file:/C:/Users/Oz/.m2/repository/org/apache/openejb/openejb-core/7.0.0-SNAPSHOT/openejb-core-7.0.0-SNAPSHOT.jar!/login.config'
+    INFO - Found EjbModule in classpath: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
+    INFO - Beginning load: c:\users\oz\desktop\ee-examples\simple-singleton\target\classes
+    INFO - Configuring enterprise application: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Auto-deploying ejb ComponentRegistry: EjbDeployment(deployment-id=ComponentRegistry)
+    INFO - Auto-deploying ejb PropertyRegistry: EjbDeployment(deployment-id=PropertyRegistry)
+    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+    INFO - Auto-creating a container for bean ComponentRegistry: Container(type=SINGLETON, id=Default Singleton Container)
+    INFO - Creating Container(id=Default Singleton Container)
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean org.superbiz.registry.PropertiesRegistryTest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Creating Container(id=Default Managed Container)
+    INFO - Using directory C:\Users\Oz\AppData\Local\Temp for stateful session passivation
+    INFO - Enterprise application "C:\Users\Oz\Desktop\ee-examples\simple-singleton" loaded.
+    INFO - Assembling app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/ComponentRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry")
+    INFO - Jndi(name="java:global/simple-singleton/PropertyRegistry")
+    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@448ad367
+    INFO - OpenWebBeans Container is starting...
+    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+    INFO - All injection points were validated successfully.
+    INFO - OpenWebBeans Container has started, it took 4 ms.
+    INFO - Created Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
+    INFO - Created Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=PropertyRegistry, ejb-name=PropertyRegistry, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=ComponentRegistry, ejb-name=ComponentRegistry, container=Default Singleton Container)
+    INFO - Deployed Application(path=C:\Users\Oz\Desktop\ee-examples\simple-singleton)
+    INFO - Undeploying app: C:\Users\Oz\Desktop\ee-examples\simple-singleton
+    INFO - Destroying OpenEJB container
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.171 sec
+
+    Results :
+
+    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistry.java
----------------------------------------------------------------------
diff --git a/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistry.java b/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistry.java
index 8197241..eea69a4 100644
--- a/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistry.java
+++ b/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistry.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.registry;
-
-import javax.ejb.Lock;
-import javax.ejb.Singleton;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import static javax.ejb.LockType.READ;
-import static javax.ejb.LockType.WRITE;
-
-@Singleton
-@Lock(READ)
-public class ComponentRegistry {
-
-    private final Map<Class, Object> components = new HashMap<Class, Object>();
-
-    public <T> T getComponent(final Class<T> type) {
-        return (T) components.get(type);
-    }
-
-    public Collection<?> getComponents() {
-        return new ArrayList(components.values());
-    }
-
-    @Lock(WRITE)
-    public <T> T setComponent(final Class<T> type, final T value) {
-        return (T) components.put(type, value);
-    }
-
-    @Lock(WRITE)
-    public <T> T removeComponent(final Class<T> type) {
-        return (T) components.remove(type);
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.registry;
+
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import static javax.ejb.LockType.READ;
+import static javax.ejb.LockType.WRITE;
+
+@Singleton
+@Lock(READ)
+public class ComponentRegistry {
+
+    private final Map<Class, Object> components = new HashMap<Class, Object>();
+
+    public <T> T getComponent(final Class<T> type) {
+        return (T) components.get(type);
+    }
+
+    public Collection<?> getComponents() {
+        return new ArrayList(components.values());
+    }
+
+    @Lock(WRITE)
+    public <T> T setComponent(final Class<T> type, final T value) {
+        return (T) components.put(type, value);
+    }
+
+    @Lock(WRITE)
+    public <T> T removeComponent(final Class<T> type) {
+        return (T) components.remove(type);
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistry.java
----------------------------------------------------------------------
diff --git a/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistry.java b/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistry.java
index 56adcb1..14094b3 100644
--- a/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistry.java
+++ b/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistry.java
@@ -1,62 +1,62 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.registry;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.ejb.ConcurrencyManagement;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import java.util.Properties;
-
-import static javax.ejb.ConcurrencyManagementType.BEAN;
-
-@Singleton
-@Startup
-@ConcurrencyManagement(BEAN)
-public class PropertyRegistry {
-
-    // Note the java.util.Properties object is a thread-safe
-    // collections that uses synchronization.  If it didn't
-    // you would have to use some form of synchronization
-    // to ensure the PropertyRegistryBean is thread-safe.
-    private final Properties properties = new Properties();
-
-    // The @Startup annotation ensures that this method is
-    // called when the application starts up.
-    @PostConstruct
-    public void applicationStartup() {
-        properties.putAll(System.getProperties());
-    }
-
-    @PreDestroy
-    public void applicationShutdown() {
-        properties.clear();
-    }
-
-    public String getProperty(final String key) {
-        return properties.getProperty(key);
-    }
-
-    public String setProperty(final String key, final String value) {
-        return (String) properties.setProperty(key, value);
-    }
-
-    public String removeProperty(final String key) {
-        return (String) properties.remove(key);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.registry;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import java.util.Properties;
+
+import static javax.ejb.ConcurrencyManagementType.BEAN;
+
+@Singleton
+@Startup
+@ConcurrencyManagement(BEAN)
+public class PropertyRegistry {
+
+    // Note the java.util.Properties object is a thread-safe
+    // collections that uses synchronization.  If it didn't
+    // you would have to use some form of synchronization
+    // to ensure the PropertyRegistryBean is thread-safe.
+    private final Properties properties = new Properties();
+
+    // The @Startup annotation ensures that this method is
+    // called when the application starts up.
+    @PostConstruct
+    public void applicationStartup() {
+        properties.putAll(System.getProperties());
+    }
+
+    @PreDestroy
+    public void applicationShutdown() {
+        properties.clear();
+    }
+
+    public String getProperty(final String key) {
+        return properties.getProperty(key);
+    }
+
+    public String setProperty(final String key, final String value) {
+        return (String) properties.setProperty(key, value);
+    }
+
+    public String removeProperty(final String key) {
+        return (String) properties.remove(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryTest.java b/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryTest.java
index e325e42..bd6b14e 100644
--- a/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryTest.java
+++ b/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryTest.java
@@ -1,72 +1,72 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.registry;
-
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Date;
-
-public class ComponentRegistryTest {
-
-    private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
-
-    @Test
-    public void oneInstancePerMultipleReferences() throws Exception {
-
-        final Context context = ejbContainer.getContext();
-
-        // Both references below will point to the exact same instance
-        final ComponentRegistry one = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
-        final ComponentRegistry two = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
-
-        final URI expectedUri = new URI("foo://bar/baz");
-        one.setComponent(URI.class, expectedUri);
-        final URI actualUri = two.getComponent(URI.class);
-        Assert.assertSame(expectedUri, actualUri);
-
-        two.removeComponent(URI.class);
-        URI uri = one.getComponent(URI.class);
-        Assert.assertNull(uri);
-
-        one.removeComponent(URI.class);
-        uri = two.getComponent(URI.class);
-        Assert.assertNull(uri);
-
-        final Date expectedDate = new Date();
-        two.setComponent(Date.class, expectedDate);
-        final Date actualDate = one.getComponent(Date.class);
-        Assert.assertSame(expectedDate, actualDate);
-
-        Collection<?> collection = one.getComponents();
-        System.out.println(collection);
-        Assert.assertEquals("Reference 'one' - ComponentRegistry contains one record", collection.size(), 1);
-
-        collection = two.getComponents();
-        Assert.assertEquals("Reference 'two' - ComponentRegistry contains one record", collection.size(), 1);
-    }
-
-    @AfterClass
-    public static void closeEjbContainer() {
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.registry;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Date;
+
+public class ComponentRegistryTest {
+
+    private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
+
+    @Test
+    public void oneInstancePerMultipleReferences() throws Exception {
+
+        final Context context = ejbContainer.getContext();
+
+        // Both references below will point to the exact same instance
+        final ComponentRegistry one = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
+        final ComponentRegistry two = (ComponentRegistry) context.lookup("java:global/simple-singleton/ComponentRegistry");
+
+        final URI expectedUri = new URI("foo://bar/baz");
+        one.setComponent(URI.class, expectedUri);
+        final URI actualUri = two.getComponent(URI.class);
+        Assert.assertSame(expectedUri, actualUri);
+
+        two.removeComponent(URI.class);
+        URI uri = one.getComponent(URI.class);
+        Assert.assertNull(uri);
+
+        one.removeComponent(URI.class);
+        uri = two.getComponent(URI.class);
+        Assert.assertNull(uri);
+
+        final Date expectedDate = new Date();
+        two.setComponent(Date.class, expectedDate);
+        final Date actualDate = one.getComponent(Date.class);
+        Assert.assertSame(expectedDate, actualDate);
+
+        Collection<?> collection = one.getComponents();
+        System.out.println(collection);
+        Assert.assertEquals("Reference 'one' - ComponentRegistry contains one record", collection.size(), 1);
+
+        collection = two.getComponents();
+        Assert.assertEquals("Reference 'two' - ComponentRegistry contains one record", collection.size(), 1);
+    }
+
+    @AfterClass
+    public static void closeEjbContainer() {
+        ejbContainer.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-singleton/src/test/java/org/superbiz/registry/PropertiesRegistryTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-singleton/src/test/java/org/superbiz/registry/PropertiesRegistryTest.java b/examples/simple-singleton/src/test/java/org/superbiz/registry/PropertiesRegistryTest.java
index 4b887c7..8384286 100644
--- a/examples/simple-singleton/src/test/java/org/superbiz/registry/PropertiesRegistryTest.java
+++ b/examples/simple-singleton/src/test/java/org/superbiz/registry/PropertiesRegistryTest.java
@@ -1,59 +1,59 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.registry;
-
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-public class PropertiesRegistryTest {
-
-    private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
-
-    @Test
-    public void oneInstancePerMultipleReferences() throws Exception {
-
-        final Context context = ejbContainer.getContext();
-
-        final PropertyRegistry one = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
-        final PropertyRegistry two = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
-
-        one.setProperty("url", "http://superbiz.org");
-        String url = two.getProperty("url");
-        Assert.assertSame("http://superbiz.org", url);
-
-        two.removeProperty("url");
-        url = one.getProperty("url");
-        Assert.assertNull(url);
-
-        two.setProperty("version", "1.0.5");
-        String version = one.getProperty("version");
-        Assert.assertSame("1.0.5", version);
-
-        one.removeProperty("version");
-        version = two.getProperty("version");
-        Assert.assertNull(version);
-    }
-
-    @AfterClass
-    public static void closeEjbContainer() {
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.registry;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+public class PropertiesRegistryTest {
+
+    private final static EJBContainer ejbContainer = EJBContainer.createEJBContainer();
+
+    @Test
+    public void oneInstancePerMultipleReferences() throws Exception {
+
+        final Context context = ejbContainer.getContext();
+
+        final PropertyRegistry one = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
+        final PropertyRegistry two = (PropertyRegistry) context.lookup("java:global/simple-singleton/PropertyRegistry");
+
+        one.setProperty("url", "http://superbiz.org");
+        String url = two.getProperty("url");
+        Assert.assertSame("http://superbiz.org", url);
+
+        two.removeProperty("url");
+        url = one.getProperty("url");
+        Assert.assertNull(url);
+
+        two.setProperty("version", "1.0.5");
+        String version = one.getProperty("version");
+        Assert.assertSame("1.0.5", version);
+
+        one.removeProperty("version");
+        version = two.getProperty("version");
+        Assert.assertNull(version);
+    }
+
+    @AfterClass
+    public static void closeEjbContainer() {
+        ejbContainer.close();
+    }
+}


[04/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/ReadPermission.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/ReadPermission.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/ReadPermission.java
index 9614e09..b0e8a9d 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/ReadPermission.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/ReadPermission.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.annotation.security.PermitAll;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface ReadPermission {
-
-    public static interface $ {
-
-        @ReadPermission
-        @PermitAll
-        @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.annotation.security.PermitAll;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface ReadPermission {
+
+    public static interface $ {
+
+        @ReadPermission
+        @PermitAll
+        @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsEmployee.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsEmployee.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsEmployee.java
index 1600c69..bba18b1 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsEmployee.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsEmployee.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.annotation.security.RunAs;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-
-@RunAs("Employee")
-public @interface RunAsEmployee {
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.annotation.security.RunAs;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+
+@RunAs("Employee")
+public @interface RunAsEmployee {
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsManager.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsManager.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsManager.java
index 64e07db..3061ae8 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsManager.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/RunAsManager.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.annotation.security.RunAs;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-
-@RunAs("Manager")
-public @interface RunAsManager {
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.annotation.security.RunAs;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+
+@RunAs("Manager")
+public @interface RunAsManager {
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/test/java/org/superbiz/injection/secure/MovieTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/test/java/org/superbiz/injection/secure/MovieTest.java b/examples/testing-security-meta/src/test/java/org/superbiz/injection/secure/MovieTest.java
index 47f6efd..e1e8a40 100644
--- a/examples/testing-security-meta/src/test/java/org/superbiz/injection/secure/MovieTest.java
+++ b/examples/testing-security-meta/src/test/java/org/superbiz/injection/secure/MovieTest.java
@@ -1,158 +1,158 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import junit.framework.TestCase;
-import org.superbiz.injection.secure.api.RunAsEmployee;
-import org.superbiz.injection.secure.api.RunAsManager;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.ejb.Stateless;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-
-//START SNIPPET: code
-
-public class MovieTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @EJB(beanName = "ManagerBean")
-    private Caller manager;
-
-    @EJB(beanName = "EmployeeBean")
-    private Caller employee;
-
-    protected void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    public void testAsManager() throws Exception {
-        manager.call(new Callable() {
-            public Object call() throws Exception {
-
-                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-                List<Movie> list = movies.getMovies();
-                assertEquals("List.size()", 3, list.size());
-
-                for (Movie movie : list) {
-                    movies.deleteMovie(movie);
-                }
-
-                assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-                return null;
-            }
-        });
-    }
-
-    public void testAsEmployee() throws Exception {
-        employee.call(new Callable() {
-            public Object call() throws Exception {
-
-                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-                List<Movie> list = movies.getMovies();
-                assertEquals("List.size()", 3, list.size());
-
-                for (Movie movie : list) {
-                    try {
-                        movies.deleteMovie(movie);
-                        fail("Employees should not be allowed to delete");
-                    } catch (EJBAccessException e) {
-                        // Good, Employees cannot delete things
-                    }
-                }
-
-                // The list should still be three movies long
-                assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
-                return null;
-            }
-        });
-    }
-
-    public void testUnauthenticated() throws Exception {
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            fail("Unauthenticated users should not be able to add movies");
-        } catch (EJBAccessException e) {
-            // Good, guests cannot add things
-        }
-
-        try {
-            movies.deleteMovie(null);
-            fail("Unauthenticated users should not be allowed to delete");
-        } catch (EJBAccessException e) {
-            // Good, Unauthenticated users cannot delete things
-        }
-
-        try {
-            // Read access should be allowed
-
-            List<Movie> list = movies.getMovies();
-
-        } catch (EJBAccessException e) {
-            fail("Read access should be allowed");
-        }
-
-    }
-
-    public interface Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception;
-    }
-
-    /**
-     * This little bit of magic allows our test code to execute in
-     * the desired security scope.
-     */
-
-    @Stateless
-    @RunAsManager
-    public static class ManagerBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-    @Stateless
-    @RunAsEmployee
-    public static class EmployeeBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import junit.framework.TestCase;
+import org.superbiz.injection.secure.api.RunAsEmployee;
+import org.superbiz.injection.secure.api.RunAsManager;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.ejb.Stateless;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+//START SNIPPET: code
+
+public class MovieTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @EJB(beanName = "ManagerBean")
+    private Caller manager;
+
+    @EJB(beanName = "EmployeeBean")
+    private Caller employee;
+
+    protected void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    public void testAsManager() throws Exception {
+        manager.call(new Callable() {
+            public Object call() throws Exception {
+
+                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+                List<Movie> list = movies.getMovies();
+                assertEquals("List.size()", 3, list.size());
+
+                for (Movie movie : list) {
+                    movies.deleteMovie(movie);
+                }
+
+                assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+                return null;
+            }
+        });
+    }
+
+    public void testAsEmployee() throws Exception {
+        employee.call(new Callable() {
+            public Object call() throws Exception {
+
+                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+                List<Movie> list = movies.getMovies();
+                assertEquals("List.size()", 3, list.size());
+
+                for (Movie movie : list) {
+                    try {
+                        movies.deleteMovie(movie);
+                        fail("Employees should not be allowed to delete");
+                    } catch (EJBAccessException e) {
+                        // Good, Employees cannot delete things
+                    }
+                }
+
+                // The list should still be three movies long
+                assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
+                return null;
+            }
+        });
+    }
+
+    public void testUnauthenticated() throws Exception {
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            fail("Unauthenticated users should not be able to add movies");
+        } catch (EJBAccessException e) {
+            // Good, guests cannot add things
+        }
+
+        try {
+            movies.deleteMovie(null);
+            fail("Unauthenticated users should not be allowed to delete");
+        } catch (EJBAccessException e) {
+            // Good, Unauthenticated users cannot delete things
+        }
+
+        try {
+            // Read access should be allowed
+
+            List<Movie> list = movies.getMovies();
+
+        } catch (EJBAccessException e) {
+            fail("Read access should be allowed");
+        }
+
+    }
+
+    public interface Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception;
+    }
+
+    /**
+     * This little bit of magic allows our test code to execute in
+     * the desired security scope.
+     */
+
+    @Stateless
+    @RunAsManager
+    public static class ManagerBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+    @Stateless
+    @RunAsEmployee
+    public static class EmployeeBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movie.java b/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movie.java
index b5df45c..73fdf33 100644
--- a/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movie.java
+++ b/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movies.java b/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movies.java
index b3ba8e8..100598b 100644
--- a/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movies.java
+++ b/examples/testing-security/src/main/java/org/superbiz/injection/secure/Movies.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-//START SNIPPET: code
-
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    @RolesAllowed({"Employee", "Manager"})
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @RolesAllowed({"Manager"})
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @PermitAll
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+//START SNIPPET: code
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    @RolesAllowed({"Employee", "Manager"})
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @RolesAllowed({"Manager"})
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @PermitAll
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security/src/test/java/org/superbiz/injection/secure/MovieTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-security/src/test/java/org/superbiz/injection/secure/MovieTest.java b/examples/testing-security/src/test/java/org/superbiz/injection/secure/MovieTest.java
index 303d513..49ddb21 100644
--- a/examples/testing-security/src/test/java/org/superbiz/injection/secure/MovieTest.java
+++ b/examples/testing-security/src/test/java/org/superbiz/injection/secure/MovieTest.java
@@ -1,167 +1,167 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.annotation.security.RunAs;
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.ejb.Stateless;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-
-//START SNIPPET: code
-
-public class MovieTest {
-
-    @EJB
-    private Movies movies;
-
-    @EJB(name = "ManagerBean")
-    private Caller manager;
-
-    @EJB(name = "EmployeeBean")
-    private Caller employee;
-
-    private EJBContainer container;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        this.container = EJBContainer.createEJBContainer(p);
-        this.container.getContext().bind("inject", this);
-    }
-
-    @After
-    public void tearDown() {
-        this.container.close();
-    }
-
-    @Test
-    public void testAsManager() throws Exception {
-        manager.call(new Callable() {
-            public Object call() throws Exception {
-
-                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-                List<Movie> list = movies.getMovies();
-                Assert.assertEquals("List.size()", 3, list.size());
-
-                for (Movie movie : list) {
-                    movies.deleteMovie(movie);
-                }
-
-                Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-                return null;
-            }
-        });
-    }
-
-    @Test
-    public void testAsEmployee() throws Exception {
-        employee.call(new Callable() {
-            public Object call() throws Exception {
-
-                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-                List<Movie> list = movies.getMovies();
-                Assert.assertEquals("List.size()", 3, list.size());
-
-                for (Movie movie : list) {
-                    try {
-                        movies.deleteMovie(movie);
-                        Assert.fail("Employees should not be allowed to delete");
-                    } catch (EJBAccessException e) {
-                        // Good, Employees cannot delete things
-                    }
-                }
-
-                // The list should still be three movies long
-                Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
-                return null;
-            }
-        });
-    }
-
-    @Test
-    public void testUnauthenticated() throws Exception {
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            Assert.fail("Unauthenticated users should not be able to add movies");
-        } catch (EJBAccessException e) {
-            // Good, guests cannot add things
-        }
-
-        try {
-            movies.deleteMovie(null);
-            Assert.fail("Unauthenticated users should not be allowed to delete");
-        } catch (EJBAccessException e) {
-            // Good, Unauthenticated users cannot delete things
-        }
-
-        try {
-            // Read access should be allowed
-
-            movies.getMovies();
-
-        } catch (EJBAccessException e) {
-            Assert.fail("Read access should be allowed");
-        }
-
-    }
-
-    public static interface Caller {
-        public <V> V call(Callable<V> callable) throws Exception;
-    }
-
-    /**
-     * This little bit of magic allows our test code to execute in
-     * the desired security scope.
-     */
-
-    @Stateless
-    @RunAs("Manager")
-    public static class ManagerBean implements Caller {
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-    }
-
-    @Stateless
-    @RunAs("Employee")
-    public static class EmployeeBean implements Caller {
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.annotation.security.RunAs;
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.ejb.Stateless;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+//START SNIPPET: code
+
+public class MovieTest {
+
+    @EJB
+    private Movies movies;
+
+    @EJB(name = "ManagerBean")
+    private Caller manager;
+
+    @EJB(name = "EmployeeBean")
+    private Caller employee;
+
+    private EJBContainer container;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        this.container = EJBContainer.createEJBContainer(p);
+        this.container.getContext().bind("inject", this);
+    }
+
+    @After
+    public void tearDown() {
+        this.container.close();
+    }
+
+    @Test
+    public void testAsManager() throws Exception {
+        manager.call(new Callable() {
+            public Object call() throws Exception {
+
+                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+                List<Movie> list = movies.getMovies();
+                Assert.assertEquals("List.size()", 3, list.size());
+
+                for (Movie movie : list) {
+                    movies.deleteMovie(movie);
+                }
+
+                Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void testAsEmployee() throws Exception {
+        employee.call(new Callable() {
+            public Object call() throws Exception {
+
+                movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+                movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+                movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+                List<Movie> list = movies.getMovies();
+                Assert.assertEquals("List.size()", 3, list.size());
+
+                for (Movie movie : list) {
+                    try {
+                        movies.deleteMovie(movie);
+                        Assert.fail("Employees should not be allowed to delete");
+                    } catch (EJBAccessException e) {
+                        // Good, Employees cannot delete things
+                    }
+                }
+
+                // The list should still be three movies long
+                Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
+                return null;
+            }
+        });
+    }
+
+    @Test
+    public void testUnauthenticated() throws Exception {
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            Assert.fail("Unauthenticated users should not be able to add movies");
+        } catch (EJBAccessException e) {
+            // Good, guests cannot add things
+        }
+
+        try {
+            movies.deleteMovie(null);
+            Assert.fail("Unauthenticated users should not be allowed to delete");
+        } catch (EJBAccessException e) {
+            // Good, Unauthenticated users cannot delete things
+        }
+
+        try {
+            // Read access should be allowed
+
+            movies.getMovies();
+
+        } catch (EJBAccessException e) {
+            Assert.fail("Read access should be allowed");
+        }
+
+    }
+
+    public static interface Caller {
+        public <V> V call(Callable<V> callable) throws Exception;
+    }
+
+    /**
+     * This little bit of magic allows our test code to execute in
+     * the desired security scope.
+     */
+
+    @Stateless
+    @RunAs("Manager")
+    public static class ManagerBean implements Caller {
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+    }
+
+    @Stateless
+    @RunAs("Employee")
+    public static class EmployeeBean implements Caller {
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movie.java b/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movie.java
index 454196b..a9c3e47 100644
--- a/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movie.java
+++ b/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movie.java
@@ -1,74 +1,74 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue
-    private Long id;
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie(final String director, final String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public Movie() {
-
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(final int year) {
-        this.year = year;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue
+    private Long id;
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie(final String director, final String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public Movie() {
+
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(final int year) {
+        this.year = year;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movies.java b/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movies.java
index 964eafc..8c0eeb5 100644
--- a/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movies.java
+++ b/examples/testing-transactions-bmt/src/main/java/org/superbiz/injection/tx/Movies.java
@@ -1,62 +1,62 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionManagement;
-import javax.ejb.TransactionManagementType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import javax.transaction.UserTransaction;
-
-@Stateful(name = "Movies")
-@TransactionManagement(TransactionManagementType.BEAN)
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    public void addMovie(Movie movie) throws Exception {
-        try {
-            userTransaction.begin();
-            entityManager.persist(movie);
-
-            //For some dummy reason, this db can have only 5 titles. :O)
-            if (countMovies() > 5) {
-                userTransaction.rollback();
-            } else {
-                userTransaction.commit();
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            userTransaction.rollback();
-        }
-    }
-
-    public Long countMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT COUNT(m) FROM Movie m");
-        return Long.class.cast(query.getSingleResult());
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import javax.transaction.UserTransaction;
+
+@Stateful(name = "Movies")
+@TransactionManagement(TransactionManagementType.BEAN)
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    public void addMovie(Movie movie) throws Exception {
+        try {
+            userTransaction.begin();
+            entityManager.persist(movie);
+
+            //For some dummy reason, this db can have only 5 titles. :O)
+            if (countMovies() > 5) {
+                userTransaction.rollback();
+            } else {
+                userTransaction.commit();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            userTransaction.rollback();
+        }
+    }
+
+    public Long countMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT COUNT(m) FROM Movie m");
+        return Long.class.cast(query.getSingleResult());
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions-bmt/src/test/java/org/superbiz/injection/tx/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions-bmt/src/test/java/org/superbiz/injection/tx/MoviesTest.java b/examples/testing-transactions-bmt/src/test/java/org/superbiz/injection/tx/MoviesTest.java
index 3315153..e4262be 100644
--- a/examples/testing-transactions-bmt/src/test/java/org/superbiz/injection/tx/MoviesTest.java
+++ b/examples/testing-transactions-bmt/src/test/java/org/superbiz/injection/tx/MoviesTest.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.Properties;
-
-public class MoviesTest {
-
-    @EJB
-    private Movies movies;
-
-    @Test
-    public void testMe() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-
-        movies.addMovie(new Movie("Asif Kapadia", "Senna", 2010));
-        movies.addMovie(new Movie("José Padilha", "Tropa de Elite", 2007));
-        movies.addMovie(new Movie("Andy Wachowski/Lana Wachowski", "The Matrix", 1999));
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        Assert.assertEquals(5L, movies.countMovies().longValue());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.Properties;
+
+public class MoviesTest {
+
+    @EJB
+    private Movies movies;
+
+    @Test
+    public void testMe() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+
+        movies.addMovie(new Movie("Asif Kapadia", "Senna", 2010));
+        movies.addMovie(new Movie("José Padilha", "Tropa de Elite", 2007));
+        movies.addMovie(new Movie("Andy Wachowski/Lana Wachowski", "The Matrix", 1999));
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        Assert.assertEquals(5L, movies.countMovies().longValue());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movie.java b/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movie.java
index 1d0c359..5b880ba 100644
--- a/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movie.java
+++ b/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movies.java b/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movies.java
index 6c5ace4..e998d3f 100644
--- a/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movies.java
+++ b/examples/testing-transactions/src/main/java/org/superbiz/injection/tx/Movies.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-import static javax.ejb.TransactionAttributeType.MANDATORY;
-
-//START SNIPPET: code
-@Stateful(name = "Movies")
-@TransactionAttribute(MANDATORY)
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+
+//START SNIPPET: code
+@Stateful(name = "Movies")
+@TransactionAttribute(MANDATORY)
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-transactions/src/test/java/org/superbiz/injection/tx/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-transactions/src/test/java/org/superbiz/injection/tx/MoviesTest.java b/examples/testing-transactions/src/test/java/org/superbiz/injection/tx/MoviesTest.java
index 15928bc..f9e1f92 100644
--- a/examples/testing-transactions/src/test/java/org/superbiz/injection/tx/MoviesTest.java
+++ b/examples/testing-transactions/src/test/java/org/superbiz/injection/tx/MoviesTest.java
@@ -1,107 +1,107 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import junit.framework.TestCase;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-
-import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
-
-/**
- * See the transaction-rollback example as it does the same thing
- * via UserTransaction and shows more techniques for rollback
- */
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @EJB
-    private Caller transactionalCaller;
-
-    protected void setUp() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    private void doWork() throws Exception {
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-
-    public void testWithTransaction() throws Exception {
-        transactionalCaller.call(new Callable() {
-            public Object call() throws Exception {
-                doWork();
-                return null;
-            }
-        });
-    }
-
-    public void testWithoutTransaction() throws Exception {
-        try {
-            doWork();
-            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
-        } catch (javax.ejb.EJBTransactionRequiredException e) {
-            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
-        }
-    }
-
-    public static interface Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception;
-    }
-
-    /**
-     * This little bit of magic allows our test code to execute in
-     * the scope of a container controlled transaction.
-     */
-    @Stateless
-    @TransactionAttribute(REQUIRES_NEW)
-    public static class TransactionBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import junit.framework.TestCase;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+
+/**
+ * See the transaction-rollback example as it does the same thing
+ * via UserTransaction and shows more techniques for rollback
+ */
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @EJB
+    private Caller transactionalCaller;
+
+    protected void setUp() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    private void doWork() throws Exception {
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+
+    public void testWithTransaction() throws Exception {
+        transactionalCaller.call(new Callable() {
+            public Object call() throws Exception {
+                doWork();
+                return null;
+            }
+        });
+    }
+
+    public void testWithoutTransaction() throws Exception {
+        try {
+            doWork();
+            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
+        } catch (javax.ejb.EJBTransactionRequiredException e) {
+            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
+        }
+    }
+
+    public static interface Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception;
+    }
+
+    /**
+     * This little bit of magic allows our test code to execute in
+     * the scope of a container controlled transaction.
+     */
+    @Stateless
+    @TransactionAttribute(REQUIRES_NEW)
+    public static class TransactionBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/dao/PersonDAO.java
----------------------------------------------------------------------
diff --git a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/dao/PersonDAO.java b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/dao/PersonDAO.java
index c5cbc80..6fe326c 100644
--- a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/dao/PersonDAO.java
+++ b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/dao/PersonDAO.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.dao;
-
-import org.superbiz.domain.Person;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import java.util.List;
-
-@Singleton
-@Lock(LockType.READ)
-public class PersonDAO {
-
-    @PersistenceContext
-    private EntityManager em;
-
-    public Person save(final String name) {
-        final Person person = new Person();
-        person.setName(name);
-        em.persist(person);
-        return person;
-    }
-
-    public List<Person> findAll() {
-        return em.createNamedQuery("Person.findAll", Person.class).getResultList();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dao;
+
+import org.superbiz.domain.Person;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.util.List;
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+    @PersistenceContext
+    private EntityManager em;
+
+    public Person save(final String name) {
+        final Person person = new Person();
+        person.setName(name);
+        em.persist(person);
+        return person;
+    }
+
+    public List<Person> findAll() {
+        return em.createNamedQuery("Person.findAll", Person.class).getResultList();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/domain/Person.java
----------------------------------------------------------------------
diff --git a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/domain/Person.java b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/domain/Person.java
index a74732c..516d57b 100644
--- a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/domain/Person.java
+++ b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/domain/Person.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.domain;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.NamedQuery;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Entity
-@XmlRootElement
-@NamedQuery(name = "Person.findAll", query = "select p from Person p")
-public class Person {
-
-    @Id
-    @GeneratedValue
-    private long id;
-    private String name;
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQuery;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+    @Id
+    @GeneratedValue
+    private long id;
+    private String name;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/init/Initializer.java
----------------------------------------------------------------------
diff --git a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/init/Initializer.java b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/init/Initializer.java
index 5077838..76087fd 100644
--- a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/init/Initializer.java
+++ b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/init/Initializer.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.init;
-
-import org.eclipse.persistence.transaction.JTATransactionController;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.transaction.TransactionManager;
-
-@Startup
-@Singleton // tomee does it itself if eclipselink is in common.lib otherwise it is to be done by the app
-public class Initializer {
-
-    @Resource
-    private TransactionManager tm;
-
-    @PostConstruct
-    private void init() {
-        JTATransactionController.setDefaultTransactionManager(tm);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.init;
+
+import org.eclipse.persistence.transaction.JTATransactionController;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.transaction.TransactionManager;
+
+@Startup
+@Singleton // tomee does it itself if eclipselink is in common.lib otherwise it is to be done by the app
+public class Initializer {
+
+    @Resource
+    private TransactionManager tm;
+
+    @PostConstruct
+    private void init() {
+        JTATransactionController.setDefaultTransactionManager(tm);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/JerseyApplication.java
----------------------------------------------------------------------
diff --git a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/JerseyApplication.java b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/JerseyApplication.java
index bb355e6..7f56b4d 100644
--- a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/JerseyApplication.java
+++ b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/JerseyApplication.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.service;
-
-import javax.ws.rs.core.Application;
-import java.util.HashSet;
-import java.util.Set;
-
-public class JerseyApplication extends Application {
-
-    @Override
-    public Set<Class<?>> getClasses() {
-        final Set<Class<?>> classes = new HashSet<Class<?>>();
-        classes.add(PersonService.class);
-        return classes;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.service;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+public class JerseyApplication extends Application {
+
+    @Override
+    public Set<Class<?>> getClasses() {
+        final Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(PersonService.class);
+        return classes;
+    }
+}


[23/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
index 5751e07..66d635a 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
@@ -1,37 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view;
-
-import org.apache.deltaspike.core.api.config.view.metadata.ViewMetaData;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Target({TYPE})
-@Retention(RUNTIME)
-@Documented
-
-@ViewMetaData
-public @interface InfoPage
-{
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.config.view.metadata.ViewMetaData;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE})
+@Retention(RUNTIME)
+@Documented
+
+@ViewMetaData
+public @interface InfoPage {
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
index 01e36eb..b797a86 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
@@ -1,67 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view;
-
-import org.apache.deltaspike.core.spi.scope.conversation.GroupedConversationManager;
-import org.superbiz.deltaspike.view.config.Pages;
-
-import javax.enterprise.inject.Model;
-import javax.inject.Inject;
-
-@Model
-public class MenuBean
-{
-    @Inject
-    private GroupedConversationManager groupedConversationManager;
-
-    public Class<? extends Pages> home()
-    {
-        //close all conversations of the current window
-        this.groupedConversationManager.closeConversations();
-        return Pages.Index.class;
-    }
-
-    public Class<? extends Pages.Secure> feedback()
-    {
-        //close all conversations of the current window
-        this.groupedConversationManager.closeConversations();
-        return Pages.Secure.FeedbackList.class;
-    }
-
-    public Class<? extends Pages> about()
-    {
-        //close all conversations of the current window
-        this.groupedConversationManager.closeConversations();
-        return Pages.About.class;
-    }
-
-    public Class<? extends Pages> login()
-    {
-        //close all conversations of the current window
-        this.groupedConversationManager.closeConversations();
-        return Pages.Login.class;
-    }
-
-    public Class<? extends Pages> register()
-    {
-        //close all conversations of the current window
-        this.groupedConversationManager.closeConversations();
-        return Pages.Registration.class;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.spi.scope.conversation.GroupedConversationManager;
+import org.superbiz.deltaspike.view.config.Pages;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+@Model
+public class MenuBean {
+    @Inject
+    private GroupedConversationManager groupedConversationManager;
+
+    public Class<? extends Pages> home() {
+        //close all conversations of the current window
+        this.groupedConversationManager.closeConversations();
+        return Pages.Index.class;
+    }
+
+    public Class<? extends Pages.Secure> feedback() {
+        //close all conversations of the current window
+        this.groupedConversationManager.closeConversations();
+        return Pages.Secure.FeedbackList.class;
+    }
+
+    public Class<? extends Pages> about() {
+        //close all conversations of the current window
+        this.groupedConversationManager.closeConversations();
+        return Pages.About.class;
+    }
+
+    public Class<? extends Pages> login() {
+        //close all conversations of the current window
+        this.groupedConversationManager.closeConversations();
+        return Pages.Login.class;
+    }
+
+    public Class<? extends Pages> register() {
+        //close all conversations of the current window
+        this.groupedConversationManager.closeConversations();
+        return Pages.Registration.class;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java
index e3994f1..9853f7c 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java
@@ -1,100 +1,93 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view;
-
-import org.apache.deltaspike.core.api.scope.GroupedConversation;
-import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;
-import org.apache.deltaspike.jsf.api.message.JsfMessage;
-import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
-import org.apache.myfaces.extensions.validator.crossval.annotation.Equals;
-import org.superbiz.deltaspike.WebappMessageBundle;
-import org.superbiz.deltaspike.domain.User;
-import org.superbiz.deltaspike.domain.validation.Full;
-import org.superbiz.deltaspike.repository.UserRepository;
-import org.superbiz.deltaspike.view.config.Pages;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.Serializable;
-
-@Named
-@GroupedConversationScoped
-public class RegistrationPage implements Serializable
-{
-    private static final long serialVersionUID = 3844502441069448490L;
-
-    @Inject
-    private UserRepository userService;
-
-    @Inject
-    private GroupedConversation conversation;
-
-    @Inject
-    private JsfMessage<WebappMessageBundle> webappMessages;
-
-    private User user = new User();
-
-    @Inject
-    private UserHolder userHolder;
-
-    @Equals("user.password")
-    private String repeatedPassword;
-
-    @BeanValidation(useGroups = Full.class) //triggers UniqueUserNameValidator
-    public Class<? extends Pages> register()
-    {
-        this.userService.save(this.user);
-        this.webappMessages.addInfo().msgUserRegistered(this.user.getUserName());
-
-        //in order to re-use the page-bean for the login-page
-        this.conversation.close();
-
-        return Pages.Login.class;
-    }
-
-    public Class<? extends Pages> login()
-    {
-        User user = this.userService.findByUserName(this.user.getUserName());
-        if (user != null && user.getPassword().equals(this.user.getPassword()))
-        {
-            this.webappMessages.addInfo().msgLoginSuccessful();
-            this.userHolder.setCurrentUser(user);
-            return Pages.About.class;
-        }
-
-        this.webappMessages.addError().msgLoginFailed();
-
-        return null;
-    }
-
-    public User getUser()
-    {
-        return user;
-    }
-
-    public String getRepeatedPassword()
-    {
-        return repeatedPassword;
-    }
-
-    public void setRepeatedPassword(String repeatedPassword)
-    {
-        this.repeatedPassword = repeatedPassword;
-    }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.scope.GroupedConversation;
+import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;
+import org.apache.deltaspike.jsf.api.message.JsfMessage;
+import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
+import org.apache.myfaces.extensions.validator.crossval.annotation.Equals;
+import org.superbiz.deltaspike.WebappMessageBundle;
+import org.superbiz.deltaspike.domain.User;
+import org.superbiz.deltaspike.domain.validation.Full;
+import org.superbiz.deltaspike.repository.UserRepository;
+import org.superbiz.deltaspike.view.config.Pages;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+
+@Named
+@GroupedConversationScoped
+public class RegistrationPage implements Serializable {
+    private static final long serialVersionUID = 3844502441069448490L;
+
+    @Inject
+    private UserRepository userService;
+
+    @Inject
+    private GroupedConversation conversation;
+
+    @Inject
+    private JsfMessage<WebappMessageBundle> webappMessages;
+
+    private User user = new User();
+
+    @Inject
+    private UserHolder userHolder;
+
+    @Equals("user.password")
+    private String repeatedPassword;
+
+    @BeanValidation(useGroups = Full.class) //triggers UniqueUserNameValidator
+    public Class<? extends Pages> register() {
+        this.userService.save(this.user);
+        this.webappMessages.addInfo().msgUserRegistered(this.user.getUserName());
+
+        //in order to re-use the page-bean for the login-page
+        this.conversation.close();
+
+        return Pages.Login.class;
+    }
+
+    public Class<? extends Pages> login() {
+        User user = this.userService.findByUserName(this.user.getUserName());
+        if (user != null && user.getPassword().equals(this.user.getPassword())) {
+            this.webappMessages.addInfo().msgLoginSuccessful();
+            this.userHolder.setCurrentUser(user);
+            return Pages.About.class;
+        }
+
+        this.webappMessages.addError().msgLoginFailed();
+
+        return null;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public String getRepeatedPassword() {
+        return repeatedPassword;
+    }
+
+    public void setRepeatedPassword(String repeatedPassword) {
+        this.repeatedPassword = repeatedPassword;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java
index 911ed6c..b59849e 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java
@@ -1,58 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view;
-
-import org.apache.deltaspike.core.api.scope.WindowScoped;
-import org.superbiz.deltaspike.domain.User;
-
-import javax.enterprise.context.Dependent;
-import javax.enterprise.inject.New;
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.Serializable;
-
-//due to the enhanced entities it isn't possible to use them directly (due to final methods)
-@WindowScoped
-public class UserHolder implements Serializable
-{
-    private static final long serialVersionUID = -7687528373042288584L;
-
-    @Inject
-    @New
-    private User user;
-
-    @Produces
-    @Dependent
-    @Named("currentUser")
-    protected User createCurrentUser()
-    {
-        return this.user;
-    }
-
-    public void setCurrentUser(User user)
-    {
-        this.user = user;
-    }
-
-    public boolean isLoggedIn()
-    {
-        return this.user.getId() != null;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.scope.WindowScoped;
+import org.superbiz.deltaspike.domain.User;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+
+//due to the enhanced entities it isn't possible to use them directly (due to final methods)
+@WindowScoped
+public class UserHolder implements Serializable {
+    private static final long serialVersionUID = -7687528373042288584L;
+
+    @Inject
+    @New
+    private User user;
+
+    @Produces
+    @Dependent
+    @Named("currentUser")
+    protected User createCurrentUser() {
+        return this.user;
+    }
+
+    public void setCurrentUser(User user) {
+        this.user = user;
+    }
+
+    public boolean isLoggedIn() {
+        return this.user.getId() != null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java
index 650f72d..d973520 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java
@@ -1,51 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view.config;
-
-import org.apache.deltaspike.core.api.config.view.DefaultErrorView;
-import org.apache.deltaspike.core.api.config.view.ViewConfig;
-import org.apache.deltaspike.core.api.config.view.controller.ViewControllerRef;
-import org.apache.deltaspike.jsf.api.config.view.View;
-import org.apache.deltaspike.security.api.authorization.Secured;
-import org.superbiz.deltaspike.view.FeedbackPage;
-import org.superbiz.deltaspike.view.InfoPage;
-import org.superbiz.deltaspike.view.security.LoginAccessDecisionVoter;
-
-import static org.apache.deltaspike.jsf.api.config.view.View.NavigationMode.REDIRECT;
-
-@View(navigation = REDIRECT)
-public interface Pages extends ViewConfig
-{
-    class Index implements Pages {}
-
-    @InfoPage class About implements Pages {}
-
-    class Registration implements Pages {}
-
-    class Login extends DefaultErrorView implements Pages /*just to benefit from the config*/ {}
-
-    @Secured(LoginAccessDecisionVoter.class)
-    //@Secured(value = LoginAccessDecisionVoter.class, errorView = Login.class)
-    interface Secure extends Pages
-    {
-        @ViewControllerRef(FeedbackPage.class)
-        //optional: @View
-        class FeedbackList implements Secure {}
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view.config;
+
+import org.apache.deltaspike.core.api.config.view.DefaultErrorView;
+import org.apache.deltaspike.core.api.config.view.ViewConfig;
+import org.apache.deltaspike.core.api.config.view.controller.ViewControllerRef;
+import org.apache.deltaspike.jsf.api.config.view.View;
+import org.apache.deltaspike.security.api.authorization.Secured;
+import org.superbiz.deltaspike.view.FeedbackPage;
+import org.superbiz.deltaspike.view.InfoPage;
+import org.superbiz.deltaspike.view.security.LoginAccessDecisionVoter;
+
+import static org.apache.deltaspike.jsf.api.config.view.View.NavigationMode.REDIRECT;
+
+@View(navigation = REDIRECT)
+public interface Pages extends ViewConfig {
+    class Index implements Pages {
+    }
+
+    @InfoPage
+    class About implements Pages {
+    }
+
+    class Registration implements Pages {
+    }
+
+    class Login extends DefaultErrorView implements Pages /*just to benefit from the config*/ {
+    }
+
+    @Secured(LoginAccessDecisionVoter.class)
+            //@Secured(value = LoginAccessDecisionVoter.class, errorView = Login.class)
+    interface Secure extends Pages {
+        @ViewControllerRef(FeedbackPage.class)
+                //optional: @View
+        class FeedbackList implements Secure {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java
index 1bcc034..71a3cfa 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java
@@ -1,51 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view.security;
-
-import org.apache.deltaspike.security.api.authorization.AbstractAccessDecisionVoter;
-import org.apache.deltaspike.security.api.authorization.AccessDecisionVoterContext;
-import org.apache.deltaspike.security.api.authorization.SecurityViolation;
-import org.superbiz.deltaspike.WebappMessageBundle;
-import org.superbiz.deltaspike.view.UserHolder;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import java.util.Set;
-
-@ApplicationScoped
-public class LoginAccessDecisionVoter extends AbstractAccessDecisionVoter
-{
-    private static final long serialVersionUID = -6332617547592896599L;
-
-    @Inject
-    private UserHolder userHolder;
-
-    @Inject
-    private WebappMessageBundle webappMessageBundle;
-
-    @Override
-    protected void checkPermission(AccessDecisionVoterContext accessDecisionVoterContext,
-                                   Set<SecurityViolation> violations)
-    {
-        if (!this.userHolder.isLoggedIn())
-        {
-            violations.add(newSecurityViolation(this.webappMessageBundle.msgAccessDenied()));
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view.security;
+
+import org.apache.deltaspike.security.api.authorization.AbstractAccessDecisionVoter;
+import org.apache.deltaspike.security.api.authorization.AccessDecisionVoterContext;
+import org.apache.deltaspike.security.api.authorization.SecurityViolation;
+import org.superbiz.deltaspike.WebappMessageBundle;
+import org.superbiz.deltaspike.view.UserHolder;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import java.util.Set;
+
+@ApplicationScoped
+public class LoginAccessDecisionVoter extends AbstractAccessDecisionVoter {
+    private static final long serialVersionUID = -6332617547592896599L;
+
+    @Inject
+    private UserHolder userHolder;
+
+    @Inject
+    private WebappMessageBundle webappMessageBundle;
+
+    @Override
+    protected void checkPermission(AccessDecisionVoterContext accessDecisionVoterContext,
+                                   Set<SecurityViolation> violations) {
+        if (!this.userHolder.isLoggedIn()) {
+            violations.add(newSecurityViolation(this.webappMessageBundle.msgAccessDenied()));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java
index c84e4e0..3f10344 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java
@@ -1,149 +1,135 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view.util;
-
-import org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor;
-import org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver;
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
-import org.apache.deltaspike.core.spi.scope.window.WindowContext;
-import org.apache.deltaspike.jsf.api.message.JsfMessage;
-import org.apache.myfaces.extensions.validator.ExtValInformation;
-import org.apache.myfaces.extensions.validator.util.ClassUtils;
-import org.superbiz.deltaspike.WebappMessageBundle;
-import org.superbiz.deltaspike.view.InfoPage;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
-import javax.faces.context.FacesContext;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.persistence.Persistence;
-import javax.validation.Validation;
-import java.io.Serializable;
-
-@SuppressWarnings("CdiUnproxyableBeanTypesInspection")
-@Named
-@SessionScoped
-public class InfoBean implements Serializable
-{
-    private static final long serialVersionUID = -1748909261695527800L;
-
-    @Inject
-    private WindowContext windowContext;
-
-    @Inject
-    private JsfMessage<WebappMessageBundle> webappMessages;
-
-    @Inject
-    private ProjectStage projectStage;
-
-    @Inject
-    private ViewConfigResolver viewConfigResolver;
-
-    private String applicationMessageVersionInfo;
-
-    private String beanValidationVersion;
-
-    private String jpaVersion;
-
-    @PostConstruct
-    protected void showWelcomeMessage()
-    {
-        String versionString = ClassUtils.getJarVersion(InfoBean.class);
-
-        if (versionString != null)
-        {
-            this.applicationMessageVersionInfo = " (v" + versionString + ")";
-        }
-
-        this.beanValidationVersion =
-                ClassUtils.getJarVersion(Validation.buildDefaultValidatorFactory().getValidator().getClass());
-
-        this.jpaVersion =
-                ClassUtils.getJarVersion(Persistence.createEntityManagerFactory("demoApplicationPU").getClass());
-
-        if (!ProjectStage.IntegrationTest.equals(this.projectStage))
-        {
-            this.webappMessages.addInfo().msgWelcome();
-        }
-    }
-
-    public boolean isInfoPage()
-    {
-        ViewConfigDescriptor viewConfigDescriptor =
-                this.viewConfigResolver.getViewConfigDescriptor(FacesContext.getCurrentInstance().getViewRoot().getViewId());
-
-        if (viewConfigDescriptor == null)
-        {
-            return false;
-        }
-
-        return !viewConfigDescriptor.getMetaData(InfoPage.class).isEmpty();
-    }
-
-    public String getProjectStage()
-    {
-        return this.projectStage.toString();
-    }
-
-    public String getApplicationVersion()
-    {
-        return this.applicationMessageVersionInfo;
-    }
-
-    public String getDeltaSpikeVersion()
-    {
-        return ClassUtils.getJarVersion(BeanManagerProvider.class);
-    }
-
-    public String getCdiVersion() {
-        try {
-            return ClassUtils.getJarVersion(BeanManagerProvider.getInstance().getBeanManager().getClass());
-        } catch (Exception e) {
-            e.printStackTrace();
-            return "Failed to get CDI Version: " + e.getMessage();
-        }
-    }
-
-    public String getExtValVersion()
-    {
-        return ExtValInformation.VERSION;
-    }
-
-    public String getJsfVersion()
-    {
-        return ClassUtils.getJarVersion(FacesContext.class);
-    }
-
-    public String getBeanValidationVersion()
-    {
-        return this.beanValidationVersion;
-    }
-
-    public String getJpaVersion()
-    {
-        return this.jpaVersion;
-    }
-
-    public String getWindowId()
-    {
-        return this.windowContext.getCurrentWindowId();
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view.util;
+
+import org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor;
+import org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.jsf.api.message.JsfMessage;
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.util.ClassUtils;
+import org.superbiz.deltaspike.WebappMessageBundle;
+import org.superbiz.deltaspike.view.InfoPage;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.persistence.Persistence;
+import javax.validation.Validation;
+import java.io.Serializable;
+
+@SuppressWarnings("CdiUnproxyableBeanTypesInspection")
+@Named
+@SessionScoped
+public class InfoBean implements Serializable {
+    private static final long serialVersionUID = -1748909261695527800L;
+
+    @Inject
+    private WindowContext windowContext;
+
+    @Inject
+    private JsfMessage<WebappMessageBundle> webappMessages;
+
+    @Inject
+    private ProjectStage projectStage;
+
+    @Inject
+    private ViewConfigResolver viewConfigResolver;
+
+    private String applicationMessageVersionInfo;
+
+    private String beanValidationVersion;
+
+    private String jpaVersion;
+
+    @PostConstruct
+    protected void showWelcomeMessage() {
+        String versionString = ClassUtils.getJarVersion(InfoBean.class);
+
+        if (versionString != null) {
+            this.applicationMessageVersionInfo = " (v" + versionString + ")";
+        }
+
+        this.beanValidationVersion =
+                ClassUtils.getJarVersion(Validation.buildDefaultValidatorFactory().getValidator().getClass());
+
+        this.jpaVersion =
+                ClassUtils.getJarVersion(Persistence.createEntityManagerFactory("demoApplicationPU").getClass());
+
+        if (!ProjectStage.IntegrationTest.equals(this.projectStage)) {
+            this.webappMessages.addInfo().msgWelcome();
+        }
+    }
+
+    public boolean isInfoPage() {
+        ViewConfigDescriptor viewConfigDescriptor =
+                this.viewConfigResolver.getViewConfigDescriptor(FacesContext.getCurrentInstance().getViewRoot().getViewId());
+
+        if (viewConfigDescriptor == null) {
+            return false;
+        }
+
+        return !viewConfigDescriptor.getMetaData(InfoPage.class).isEmpty();
+    }
+
+    public String getProjectStage() {
+        return this.projectStage.toString();
+    }
+
+    public String getApplicationVersion() {
+        return this.applicationMessageVersionInfo;
+    }
+
+    public String getDeltaSpikeVersion() {
+        return ClassUtils.getJarVersion(BeanManagerProvider.class);
+    }
+
+    public String getCdiVersion() {
+        try {
+            return ClassUtils.getJarVersion(BeanManagerProvider.getInstance().getBeanManager().getClass());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "Failed to get CDI Version: " + e.getMessage();
+        }
+    }
+
+    public String getExtValVersion() {
+        return ExtValInformation.VERSION;
+    }
+
+    public String getJsfVersion() {
+        return ClassUtils.getJarVersion(FacesContext.class);
+    }
+
+    public String getBeanValidationVersion() {
+        return this.beanValidationVersion;
+    }
+
+    public String getJpaVersion() {
+        return this.jpaVersion;
+    }
+
+    public String getWindowId() {
+        return this.windowContext.getCurrentWindowId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/PageBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/PageBeanTest.java b/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/PageBeanTest.java
index 3d72c83..b3855c7 100644
--- a/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/PageBeanTest.java
+++ b/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/PageBeanTest.java
@@ -1,131 +1,127 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.test;
-
-import org.apache.deltaspike.cdise.api.ContextControl;
-import org.apache.deltaspike.core.spi.scope.window.WindowContext;
-import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.deltaspike.WebappMessageBundle;
-import org.superbiz.deltaspike.domain.User;
-import org.superbiz.deltaspike.repository.UserRepository;
-import org.superbiz.deltaspike.view.RegistrationPage;
-import org.superbiz.deltaspike.view.config.Pages;
-
-import javax.faces.context.FacesContext;
-import javax.inject.Inject;
-import javax.persistence.PersistenceException;
-
-@RunWith(CdiTestRunner.class)
-public class PageBeanTest
-{
-    @Inject
-    private RegistrationPage registrationPage;
-
-    @Inject
-    private WindowContext windowContext;
-
-    @Inject
-    private WebappMessageBundle webappMessageBundle;
-
-    @Inject
-    private UserRepository userRepository;
-
-    @Inject
-    private ContextControl contextControl;
-
-    @Test(expected = PersistenceException.class)
-    public void duplicatedUser()
-    {
-        final String userName = "tomee";
-        final String firstName = "Apache";
-        final String lastName = "TomEE";
-
-        this.userRepository.saveAndFlush(new User(userName, firstName, lastName));
-        this.userRepository.saveAndFlush(new User(userName, firstName + "2", lastName + "2"));
-    }
-
-    @Test
-    public void saveUser()
-    {
-        final String userName = "GP";
-        final String firstName = "Gerhard";
-        final String lastName = "Petracek";
-        this.windowContext.activateWindow("testWindow");
-
-        this.registrationPage.getUser().setUserName(userName);
-        this.registrationPage.getUser().setFirstName(firstName);
-        this.registrationPage.getUser().setLastName(lastName);
-        this.registrationPage.getUser().setPassword("123");
-
-        Class<? extends Pages> targetPage = this.registrationPage.register();
-
-        Assert.assertEquals(Pages.Login.class, targetPage);
-        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
-        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
-
-        User user = this.userRepository.findByUserName(userName);
-        Assert.assertNotNull(user);
-        Assert.assertEquals(firstName, user.getFirstName());
-        Assert.assertEquals(lastName, user.getLastName());
-    }
-
-    @Test
-    public void saveUserAndLogin()
-    {
-        final String userName = "tt";
-        final String firstName = "Tom";
-        final String lastName = "Tester";
-        this.windowContext.activateWindow("testWindow");
-
-        Assert.assertTrue(FacesContext.getCurrentInstance().getMessageList().isEmpty());
-
-        this.registrationPage.getUser().setUserName(userName);
-        this.registrationPage.getUser().setFirstName(firstName);
-        this.registrationPage.getUser().setLastName(lastName);
-        this.registrationPage.getUser().setPassword("123");
-
-        Class<? extends Pages> targetPage = this.registrationPage.register();
-
-        Assert.assertEquals(Pages.Login.class, targetPage);
-        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
-        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
-
-        User user = this.userRepository.findByUserName(userName);
-        Assert.assertNotNull(user);
-        Assert.assertEquals(firstName, user.getFirstName());
-        Assert.assertEquals(lastName, user.getLastName());
-
-        this.contextControl.stopContexts();
-        this.contextControl.startContexts();
-        this.windowContext.activateWindow("testWindow");
-
-        Assert.assertTrue(FacesContext.getCurrentInstance().getMessageList().isEmpty());
-
-        this.registrationPage.getUser().setUserName(userName);
-        this.registrationPage.getUser().setFirstName(firstName);
-        this.registrationPage.getUser().setLastName(lastName);
-        this.registrationPage.getUser().setPassword("123");
-
-        targetPage = this.registrationPage.login();
-        Assert.assertEquals(Pages.About.class, targetPage);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.test;
+
+import org.apache.deltaspike.cdise.api.ContextControl;
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.deltaspike.WebappMessageBundle;
+import org.superbiz.deltaspike.domain.User;
+import org.superbiz.deltaspike.repository.UserRepository;
+import org.superbiz.deltaspike.view.RegistrationPage;
+import org.superbiz.deltaspike.view.config.Pages;
+
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.persistence.PersistenceException;
+
+@RunWith(CdiTestRunner.class)
+public class PageBeanTest {
+    @Inject
+    private RegistrationPage registrationPage;
+
+    @Inject
+    private WindowContext windowContext;
+
+    @Inject
+    private WebappMessageBundle webappMessageBundle;
+
+    @Inject
+    private UserRepository userRepository;
+
+    @Inject
+    private ContextControl contextControl;
+
+    @Test(expected = PersistenceException.class)
+    public void duplicatedUser() {
+        final String userName = "tomee";
+        final String firstName = "Apache";
+        final String lastName = "TomEE";
+
+        this.userRepository.saveAndFlush(new User(userName, firstName, lastName));
+        this.userRepository.saveAndFlush(new User(userName, firstName + "2", lastName + "2"));
+    }
+
+    @Test
+    public void saveUser() {
+        final String userName = "GP";
+        final String firstName = "Gerhard";
+        final String lastName = "Petracek";
+        this.windowContext.activateWindow("testWindow");
+
+        this.registrationPage.getUser().setUserName(userName);
+        this.registrationPage.getUser().setFirstName(firstName);
+        this.registrationPage.getUser().setLastName(lastName);
+        this.registrationPage.getUser().setPassword("123");
+
+        Class<? extends Pages> targetPage = this.registrationPage.register();
+
+        Assert.assertEquals(Pages.Login.class, targetPage);
+        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
+        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
+
+        User user = this.userRepository.findByUserName(userName);
+        Assert.assertNotNull(user);
+        Assert.assertEquals(firstName, user.getFirstName());
+        Assert.assertEquals(lastName, user.getLastName());
+    }
+
+    @Test
+    public void saveUserAndLogin() {
+        final String userName = "tt";
+        final String firstName = "Tom";
+        final String lastName = "Tester";
+        this.windowContext.activateWindow("testWindow");
+
+        Assert.assertTrue(FacesContext.getCurrentInstance().getMessageList().isEmpty());
+
+        this.registrationPage.getUser().setUserName(userName);
+        this.registrationPage.getUser().setFirstName(firstName);
+        this.registrationPage.getUser().setLastName(lastName);
+        this.registrationPage.getUser().setPassword("123");
+
+        Class<? extends Pages> targetPage = this.registrationPage.register();
+
+        Assert.assertEquals(Pages.Login.class, targetPage);
+        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
+        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
+
+        User user = this.userRepository.findByUserName(userName);
+        Assert.assertNotNull(user);
+        Assert.assertEquals(firstName, user.getFirstName());
+        Assert.assertEquals(lastName, user.getLastName());
+
+        this.contextControl.stopContexts();
+        this.contextControl.startContexts();
+        this.windowContext.activateWindow("testWindow");
+
+        Assert.assertTrue(FacesContext.getCurrentInstance().getMessageList().isEmpty());
+
+        this.registrationPage.getUser().setUserName(userName);
+        this.registrationPage.getUser().setFirstName(firstName);
+        this.registrationPage.getUser().setLastName(lastName);
+        this.registrationPage.getUser().setPassword("123");
+
+        targetPage = this.registrationPage.login();
+        Assert.assertEquals(Pages.About.class, targetPage);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-i18n/src/main/java/org/superbiz/deltaspike/i18n/MessageHelper.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-i18n/src/main/java/org/superbiz/deltaspike/i18n/MessageHelper.java b/examples/deltaspike-i18n/src/main/java/org/superbiz/deltaspike/i18n/MessageHelper.java
index 72911dd..17ddb8e 100644
--- a/examples/deltaspike-i18n/src/main/java/org/superbiz/deltaspike/i18n/MessageHelper.java
+++ b/examples/deltaspike-i18n/src/main/java/org/superbiz/deltaspike/i18n/MessageHelper.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.i18n;
-
-import org.apache.deltaspike.core.api.message.MessageBundle;
-import org.apache.deltaspike.core.api.message.MessageTemplate;
-
-@MessageBundle
-public interface MessageHelper {
-
-    @MessageTemplate("{openejb.and.deltaspike}")
-    String openejbAndDeltaspike();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.i18n;
+
+import org.apache.deltaspike.core.api.message.MessageBundle;
+import org.apache.deltaspike.core.api.message.MessageTemplate;
+
+@MessageBundle
+public interface MessageHelper {
+
+    @MessageTemplate("{openejb.and.deltaspike}")
+    String openejbAndDeltaspike();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-i18n/src/test/java/org/superbiz/deltaspike/i18n/MessageHelperTest.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-i18n/src/test/java/org/superbiz/deltaspike/i18n/MessageHelperTest.java b/examples/deltaspike-i18n/src/test/java/org/superbiz/deltaspike/i18n/MessageHelperTest.java
index 72d07ab..b2c7ad6 100644
--- a/examples/deltaspike-i18n/src/test/java/org/superbiz/deltaspike/i18n/MessageHelperTest.java
+++ b/examples/deltaspike-i18n/src/test/java/org/superbiz/deltaspike/i18n/MessageHelperTest.java
@@ -1,56 +1,56 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.i18n;
-
-import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-import org.apache.ziplock.JarLocation;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class MessageHelperTest {
-
-    @Inject
-    private MessageHelper msg;
-
-    @Deployment
-    public static WebArchive jar() {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addClasses(MessageHelper.class)
-                         .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
-                         .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
-                         .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class));
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(msg);
-        assertEquals("OpenEJB and DeltaSpike are cool products!", msg.openejbAndDeltaspike());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.i18n;
+
+import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class MessageHelperTest {
+
+    @Inject
+    private MessageHelper msg;
+
+    @Deployment
+    public static WebArchive jar() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClasses(MessageHelper.class)
+                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
+                .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
+                .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class));
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(msg);
+        assertEquals("OpenEJB and DeltaSpike are cool products!", msg.openejbAndDeltaspike());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-dao-implementation/src/main/java/org/superbiz/dynamic/User.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-dao-implementation/src/main/java/org/superbiz/dynamic/User.java b/examples/dynamic-dao-implementation/src/main/java/org/superbiz/dynamic/User.java
index c5d51f7..4d9de82 100644
--- a/examples/dynamic-dao-implementation/src/main/java/org/superbiz/dynamic/User.java
+++ b/examples/dynamic-dao-implementation/src/main/java/org/superbiz/dynamic/User.java
@@ -1,61 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
-    * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.dynamic;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = "dynamic-ejb-impl-test.query", query = "SELECT u FROM User AS u WHERE u.name LIKE :name"),
-                  @NamedQuery(name = "dynamic-ejb-impl-test.all", query = "SELECT u FROM User AS u")
-              })
-public class User {
-
-    @Id
-    @GeneratedValue
-    private long id;
-    private String name;
-    private int age;
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public int getAge() {
-        return age;
-    }
-
-    public void setAge(int age) {
-        this.age = age;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+    * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamic;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = "dynamic-ejb-impl-test.query", query = "SELECT u FROM User AS u WHERE u.name LIKE :name"),
+        @NamedQuery(name = "dynamic-ejb-impl-test.all", query = "SELECT u FROM User AS u")
+})
+public class User {
+
+    @Id
+    @GeneratedValue
+    private long id;
+    private String name;
+    private int age;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/BoostrapUtility.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/BoostrapUtility.java b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/BoostrapUtility.java
index 8ee973c..d74b1e7 100755
--- a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/BoostrapUtility.java
+++ b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/BoostrapUtility.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamicdatasourcerouting;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-/**
- * OpenJPA create the table at the first query.
- * To avoid to have to create the table manunally this singleton will do it for us.
- */
-@Startup
-@Singleton
-public class BoostrapUtility {
-
-    @PersistenceContext(unitName = "db1")
-    private EntityManager em1;
-
-    @PersistenceContext(unitName = "db2")
-    private EntityManager em2;
-
-    @PersistenceContext(unitName = "db3")
-    private EntityManager em3;
-
-    @PostConstruct
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public void initDatabase() {
-        em1.find(Person.class, 0);
-        em2.find(Person.class, 0);
-        em3.find(Person.class, 0);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamicdatasourcerouting;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ * OpenJPA create the table at the first query.
+ * To avoid to have to create the table manunally this singleton will do it for us.
+ */
+@Startup
+@Singleton
+public class BoostrapUtility {
+
+    @PersistenceContext(unitName = "db1")
+    private EntityManager em1;
+
+    @PersistenceContext(unitName = "db2")
+    private EntityManager em2;
+
+    @PersistenceContext(unitName = "db3")
+    private EntityManager em3;
+
+    @PostConstruct
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public void initDatabase() {
+        em1.find(Person.class, 0);
+        em2.find(Person.class, 0);
+        em3.find(Person.class, 0);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/DeterminedRouter.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/DeterminedRouter.java b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/DeterminedRouter.java
index e2b1caa..b22dc08 100755
--- a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/DeterminedRouter.java
+++ b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/DeterminedRouter.java
@@ -1,107 +1,107 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamicdatasourcerouting;
-
-import org.apache.openejb.resource.jdbc.router.AbstractRouter;
-
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class DeterminedRouter extends AbstractRouter {
-
-    private String dataSourceNames;
-    private String defaultDataSourceName;
-    private Map<String, DataSource> dataSources = null;
-    private ThreadLocal<DataSource> currentDataSource = new ThreadLocal<DataSource>();
-
-    /**
-     * @param datasourceList datasource resource name, separator is a space
-     */
-    public void setDataSourceNames(String datasourceList) {
-        dataSourceNames = datasourceList;
-    }
-
-    /**
-     * lookup datasource in openejb resources
-     */
-    private void init() {
-        dataSources = new ConcurrentHashMap<String, DataSource>();
-        for (String ds : dataSourceNames.split(" ")) {
-            try {
-                Object o = getOpenEJBResource(ds);
-                if (o instanceof DataSource) {
-                    dataSources.put(ds, DataSource.class.cast(o));
-                }
-            } catch (NamingException e) {
-                // ignored
-            }
-        }
-    }
-
-    /**
-     * @return the user selected data source if it is set
-     *         or the default one
-     * @throws IllegalArgumentException if the data source is not found
-     */
-    @Override
-    public DataSource getDataSource() {
-        // lazy init of routed datasources
-        if (dataSources == null) {
-            init();
-        }
-
-        // if no datasource is selected use the default one
-        if (currentDataSource.get() == null) {
-            if (dataSources.containsKey(defaultDataSourceName)) {
-                return dataSources.get(defaultDataSourceName);
-
-            } else {
-                throw new IllegalArgumentException("you have to specify at least one datasource");
-            }
-        }
-
-        // the developper set the datasource to use
-        return currentDataSource.get();
-    }
-
-    /**
-     * @param datasourceName data source name
-     */
-    public void setDataSource(String datasourceName) {
-        if (dataSources == null) {
-            init();
-        }
-        if (!dataSources.containsKey(datasourceName)) {
-            throw new IllegalArgumentException("data source called " + datasourceName + " can't be found.");
-        }
-        DataSource ds = dataSources.get(datasourceName);
-        currentDataSource.set(ds);
-    }
-
-    /**
-     * reset the data source
-     */
-    public void clear() {
-        currentDataSource.remove();
-    }
-
-    public void setDefaultDataSourceName(String name) {
-        this.defaultDataSourceName = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamicdatasourcerouting;
+
+import org.apache.openejb.resource.jdbc.router.AbstractRouter;
+
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class DeterminedRouter extends AbstractRouter {
+
+    private String dataSourceNames;
+    private String defaultDataSourceName;
+    private Map<String, DataSource> dataSources = null;
+    private ThreadLocal<DataSource> currentDataSource = new ThreadLocal<DataSource>();
+
+    /**
+     * @param datasourceList datasource resource name, separator is a space
+     */
+    public void setDataSourceNames(String datasourceList) {
+        dataSourceNames = datasourceList;
+    }
+
+    /**
+     * lookup datasource in openejb resources
+     */
+    private void init() {
+        dataSources = new ConcurrentHashMap<String, DataSource>();
+        for (String ds : dataSourceNames.split(" ")) {
+            try {
+                Object o = getOpenEJBResource(ds);
+                if (o instanceof DataSource) {
+                    dataSources.put(ds, DataSource.class.cast(o));
+                }
+            } catch (NamingException e) {
+                // ignored
+            }
+        }
+    }
+
+    /**
+     * @return the user selected data source if it is set
+     *         or the default one
+     * @throws IllegalArgumentException if the data source is not found
+     */
+    @Override
+    public DataSource getDataSource() {
+        // lazy init of routed datasources
+        if (dataSources == null) {
+            init();
+        }
+
+        // if no datasource is selected use the default one
+        if (currentDataSource.get() == null) {
+            if (dataSources.containsKey(defaultDataSourceName)) {
+                return dataSources.get(defaultDataSourceName);
+
+            } else {
+                throw new IllegalArgumentException("you have to specify at least one datasource");
+            }
+        }
+
+        // the developper set the datasource to use
+        return currentDataSource.get();
+    }
+
+    /**
+     * @param datasourceName data source name
+     */
+    public void setDataSource(String datasourceName) {
+        if (dataSources == null) {
+            init();
+        }
+        if (!dataSources.containsKey(datasourceName)) {
+            throw new IllegalArgumentException("data source called " + datasourceName + " can't be found.");
+        }
+        DataSource ds = dataSources.get(datasourceName);
+        currentDataSource.set(ds);
+    }
+
+    /**
+     * reset the data source
+     */
+    public void clear() {
+        currentDataSource.remove();
+    }
+
+    public void setDefaultDataSourceName(String name) {
+        this.defaultDataSourceName = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/Person.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/Person.java b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/Person.java
index cefa256..00e3b89 100755
--- a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/Person.java
+++ b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/Person.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamicdatasourcerouting;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class Person {
-
-    @Id
-    private long id;
-    private String name;
-
-    public Person() {
-        // no-op
-    }
-
-    public Person(int i, String n) {
-        id = i;
-        name = n;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamicdatasourcerouting;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Person {
+
+    @Id
+    private long id;
+    private String name;
+
+    public Person() {
+        // no-op
+    }
+
+    public Person(int i, String n) {
+        id = i;
+        name = n;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/RoutedPersister.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/RoutedPersister.java b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/RoutedPersister.java
index 462bb2f..d2398a6 100755
--- a/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/RoutedPersister.java
+++ b/examples/dynamic-datasource-routing/src/main/java/org/superbiz/dynamicdatasourcerouting/RoutedPersister.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamicdatasourcerouting;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-@Stateless
-public class RoutedPersister {
-
-    @PersistenceContext(unitName = "router")
-    private EntityManager em;
-
-    @Resource(name = "My Router", type = DeterminedRouter.class)
-    private DeterminedRouter router;
-
-    public void persist(int id, String name, String ds) {
-        router.setDataSource(ds);
-        em.persist(new Person(id, name));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamicdatasourcerouting;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Stateless
+public class RoutedPersister {
+
+    @PersistenceContext(unitName = "router")
+    private EntityManager em;
+
+    @Resource(name = "My Router", type = DeterminedRouter.class)
+    private DeterminedRouter router;
+
+    public void persist(int id, String name, String ds) {
+        router.setDataSource(ds);
+        em.persist(new Person(id, name));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-implementation/src/main/java/org/superbiz/dynamic/SocialInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-implementation/src/main/java/org/superbiz/dynamic/SocialInterceptor.java b/examples/dynamic-implementation/src/main/java/org/superbiz/dynamic/SocialInterceptor.java
index 762e04a..d43c4e0 100644
--- a/examples/dynamic-implementation/src/main/java/org/superbiz/dynamic/SocialInterceptor.java
+++ b/examples/dynamic-implementation/src/main/java/org/superbiz/dynamic/SocialInterceptor.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-public class SocialInterceptor {
-
-    @AroundInvoke
-    public Object around(InvocationContext context) throws Exception {
-        String mtd = context.getMethod().getName();
-        String address;
-        if (mtd.toLowerCase().contains("facebook")) {
-            address = "http://www.facebook.com";
-        } else if (mtd.toLowerCase().contains("twitter")) {
-            address = "http://twitter.com";
-        } else {
-            address = "no website for you";
-        }
-
-        System.out.println("go on " + address);
-        return context.proceed();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+public class SocialInterceptor {
+
+    @AroundInvoke
+    public Object around(InvocationContext context) throws Exception {
+        String mtd = context.getMethod().getName();
+        String address;
+        if (mtd.toLowerCase().contains("facebook")) {
+            address = "http://www.facebook.com";
+        } else if (mtd.toLowerCase().contains("twitter")) {
+            address = "http://twitter.com";
+        } else {
+            address = "no website for you";
+        }
+
+        System.out.println("go on " + address);
+        return context.proceed();
+    }
+}


[29/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-application-scope/README.md
----------------------------------------------------------------------
diff --git a/examples/cdi-application-scope/README.md b/examples/cdi-application-scope/README.md
index a5bfd72..736be8a 100644
--- a/examples/cdi-application-scope/README.md
+++ b/examples/cdi-application-scope/README.md
@@ -1,133 +1,133 @@
-Title: CDI @ApplicationScoped
-
-This example show the use of `@ApplicationScoped` annotation for injected objects. An object
-which is defined as `@ApplicationScoped` is created once for the duration of the application.
-
-# Example
-
-This example depicts a similar scenario to cdi-request-scope. A restaurant guest orders
-a soup from the waiter. The waiter then delivers the soup back to the guest. Another
-guest can order the same soup that was ordered by the previous client - this is where
-the application scope is used. 
-
-## Waiter
-
-The `Waiter` session bean receives a request from the test class via the `orderSoup()` method
-and sets the name for the `soup` field. The `orderWhatTheOtherGuyHad()` method returns
-the name of the `soup` field.
-
-    @Stateless
-    public class Waiter {
-
-        @Inject
-        public Soup soup;
-
-        public String orderSoup(String name){
-            soup.setName(name);
-            return soup.getName();
-        }
-
-        public String orderWhatTheOtherGuyHad() {
-            String name = soup.getName();
-            return name;
-        }
-    }
-
-## Soup
-
-The `Soup` class is an injectable POJO, defined as `@ApplicationScoped`. This means that an instance
-will be created only once for the duration of the whole application. Try changing the `@ApplicationScoped`
-annotation to `@RequestScoped` and see what happens.
-
-    @ApplicationScoped
-    public class Soup {
-
-        private String name = "Soup of the day";
-
-        @PostConstruct
-        public void afterCreate() {
-            System.out.println("Soup created");
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name){
-            this.name = name;
-        }
-    }
-
-
-# Test Case
-
-This is the entry class for this example. First a soup is ordered via `orderSoup()` method.
-This initiates the `soup` field. Next, `orderWhatTheOtherGuyHad()` method returns the soup
-from the application context.
-
-    public class RestaurantTest {
-
-        private static String TOMATO_SOUP = "Tomato Soup";
-        private EJBContainer container;
-
-        @EJB
-        private Waiter joe;
-
-        @Before
-        public void startContainer() throws Exception {
-            container = EJBContainer.createEJBContainer();
-            container.getContext().bind("inject", this);
-        }
-
-        @Test
-        public void orderSoup(){
-            String someSoup = joe.orderSoup(TOMATO_SOUP);
-            assertEquals(TOMATO_SOUP, someSoup);
-
-            String sameSoup = joe.orderWhatTheOtherGuyHad();
-            assertEquals(TOMATO_SOUP, sameSoup);
-        }
-
-        @After
-        public void closeContainer() throws Exception {
-            container.close();
-        }
-    }
-
-# Running
-
-In the output you can see that there is just one `Soup` instance created - one for
-the whole application.
-
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.cdi.applicationscope.RestaurantTest
-    Apache OpenEJB 4.0.0-beta-2-SNAPSHOT    build: 20111224-11:09
-    http://tomee.apache.org/
-    INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-    INFO - openejb.base = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Found EjbModule in classpath: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope\target\classes
-    INFO - Beginning load: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope\target\classes
-    INFO - Configuring enterprise application: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean cdi-application-scope.Comp: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
-    INFO - Auto-creating a container for bean Waiter: Container(type=STATELESS, id=Default Stateless Container)
-    INFO - Enterprise application "c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope" loaded.
-    INFO - Assembling app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-    INFO - Jndi(name="java:global/cdi-application-scope/Waiter!org.superbiz.cdi.applicationscope.Waiter")
-    INFO - Jndi(name="java:global/cdi-application-scope/Waiter")
-    INFO - Created Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
-    INFO - Deployed Application(path=c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope)
-    Soup created
-    INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.42 sec
-
-    Results :
-
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+Title: CDI @ApplicationScoped
+
+This example show the use of `@ApplicationScoped` annotation for injected objects. An object
+which is defined as `@ApplicationScoped` is created once for the duration of the application.
+
+# Example
+
+This example depicts a similar scenario to cdi-request-scope. A restaurant guest orders
+a soup from the waiter. The waiter then delivers the soup back to the guest. Another
+guest can order the same soup that was ordered by the previous client - this is where
+the application scope is used. 
+
+## Waiter
+
+The `Waiter` session bean receives a request from the test class via the `orderSoup()` method
+and sets the name for the `soup` field. The `orderWhatTheOtherGuyHad()` method returns
+the name of the `soup` field.
+
+    @Stateless
+    public class Waiter {
+
+        @Inject
+        public Soup soup;
+
+        public String orderSoup(String name){
+            soup.setName(name);
+            return soup.getName();
+        }
+
+        public String orderWhatTheOtherGuyHad() {
+            String name = soup.getName();
+            return name;
+        }
+    }
+
+## Soup
+
+The `Soup` class is an injectable POJO, defined as `@ApplicationScoped`. This means that an instance
+will be created only once for the duration of the whole application. Try changing the `@ApplicationScoped`
+annotation to `@RequestScoped` and see what happens.
+
+    @ApplicationScoped
+    public class Soup {
+
+        private String name = "Soup of the day";
+
+        @PostConstruct
+        public void afterCreate() {
+            System.out.println("Soup created");
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name){
+            this.name = name;
+        }
+    }
+
+
+# Test Case
+
+This is the entry class for this example. First a soup is ordered via `orderSoup()` method.
+This initiates the `soup` field. Next, `orderWhatTheOtherGuyHad()` method returns the soup
+from the application context.
+
+    public class RestaurantTest {
+
+        private static String TOMATO_SOUP = "Tomato Soup";
+        private EJBContainer container;
+
+        @EJB
+        private Waiter joe;
+
+        @Before
+        public void startContainer() throws Exception {
+            container = EJBContainer.createEJBContainer();
+            container.getContext().bind("inject", this);
+        }
+
+        @Test
+        public void orderSoup(){
+            String someSoup = joe.orderSoup(TOMATO_SOUP);
+            assertEquals(TOMATO_SOUP, someSoup);
+
+            String sameSoup = joe.orderWhatTheOtherGuyHad();
+            assertEquals(TOMATO_SOUP, sameSoup);
+        }
+
+        @After
+        public void closeContainer() throws Exception {
+            container.close();
+        }
+    }
+
+# Running
+
+In the output you can see that there is just one `Soup` instance created - one for
+the whole application.
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.cdi.applicationscope.RestaurantTest
+    Apache OpenEJB 7.0.0-SNAPSHOT    build: 20111224-11:09
+    http://tomee.apache.org/
+    INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
+    INFO - openejb.base = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Found EjbModule in classpath: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope\target\classes
+    INFO - Beginning load: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope\target\classes
+    INFO - Configuring enterprise application: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean cdi-application-scope.Comp: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+    INFO - Auto-creating a container for bean Waiter: Container(type=STATELESS, id=Default Stateless Container)
+    INFO - Enterprise application "c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope" loaded.
+    INFO - Assembling app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
+    INFO - Jndi(name="java:global/cdi-application-scope/Waiter!org.superbiz.cdi.applicationscope.Waiter")
+    INFO - Jndi(name="java:global/cdi-application-scope/Waiter")
+    INFO - Created Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
+    INFO - Deployed Application(path=c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope)
+    Soup created
+    INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-application-scope
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.42 sec
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
----------------------------------------------------------------------
diff --git a/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java b/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
index 39773ec..9fa87a7 100644
--- a/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
+++ b/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Soup.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.applicationscope;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-
-@ApplicationScoped
-public class Soup {
-
-    private String name = "Soup of the day";
-
-    @PostConstruct
-    public void afterCreate() {
-        System.out.println("Soup created");
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.applicationscope;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class Soup {
+
+    private String name = "Soup of the day";
+
+    @PostConstruct
+    public void afterCreate() {
+        System.out.println("Soup created");
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
----------------------------------------------------------------------
diff --git a/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java b/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
index 9752ec4..55d9df2 100644
--- a/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
+++ b/examples/cdi-application-scope/src/main/java/org/superbiz/cdi/applicationscope/Waiter.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.applicationscope;
-
-import javax.ejb.Stateless;
-import javax.inject.Inject;
-
-@Stateless
-public class Waiter {
-
-    @Inject
-    public Soup soup;
-
-    public String orderSoup(String name) {
-        soup.setName(name);
-        return soup.getName();
-    }
-
-    public String orderWhatTheOtherGuyHad() {
-        String name = soup.getName();
-        return name;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.applicationscope;
+
+import javax.ejb.Stateless;
+import javax.inject.Inject;
+
+@Stateless
+public class Waiter {
+
+    @Inject
+    public Soup soup;
+
+    public String orderSoup(String name) {
+        soup.setName(name);
+        return soup.getName();
+    }
+
+    public String orderWhatTheOtherGuyHad() {
+        String name = soup.getName();
+        return name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java b/examples/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
index c2e34fd..2a2bdcc 100644
--- a/examples/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
+++ b/examples/cdi-application-scope/src/test/java/org/superbiz/cdi/applicationscope/RestaurantTest.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.applicationscope;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-import static org.junit.Assert.assertEquals;
-
-public class RestaurantTest {
-
-    private static String TOMATO_SOUP = "Tomato Soup";
-    private EJBContainer container;
-
-    @EJB
-    private Waiter joe;
-
-    @Before
-    public void startContainer() throws Exception {
-        container = EJBContainer.createEJBContainer();
-        container.getContext().bind("inject", this);
-    }
-
-    @Test
-    public void orderSoup() {
-        String someSoup = joe.orderSoup(TOMATO_SOUP);
-        assertEquals(TOMATO_SOUP, someSoup);
-
-        String sameSoup = joe.orderWhatTheOtherGuyHad();
-        assertEquals(TOMATO_SOUP, sameSoup);
-    }
-
-    @After
-    public void closeContainer() throws Exception {
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.applicationscope;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+import static org.junit.Assert.assertEquals;
+
+public class RestaurantTest {
+
+    private static String TOMATO_SOUP = "Tomato Soup";
+    private EJBContainer container;
+
+    @EJB
+    private Waiter joe;
+
+    @Before
+    public void startContainer() throws Exception {
+        container = EJBContainer.createEJBContainer();
+        container.getContext().bind("inject", this);
+    }
+
+    @Test
+    public void orderSoup() {
+        String someSoup = joe.orderSoup(TOMATO_SOUP);
+        assertEquals(TOMATO_SOUP, someSoup);
+
+        String sameSoup = joe.orderWhatTheOtherGuyHad();
+        assertEquals(TOMATO_SOUP, sameSoup);
+    }
+
+    @After
+    public void closeContainer() throws Exception {
+        container.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Course.java
----------------------------------------------------------------------
diff --git a/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Course.java b/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Course.java
index a515897..dc3113a 100644
--- a/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Course.java
+++ b/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Course.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.basic;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Stateless;
-import javax.inject.Inject;
-
-@Stateless
-public class Course {
-
-    @Inject
-    private Faculty faculty;
-
-    private String courseName;
-
-    private int capacity;
-
-    @PostConstruct
-    private void init() {
-        assert faculty != null;
-
-        // These strings can be externalized
-        // We'll see how to do that later
-        this.courseName = "CDI 101 - Introduction to CDI";
-        this.capacity = 100;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public int getCapacity() {
-        return capacity;
-    }
-
-    public Faculty getFaculty() {
-        return faculty;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.basic;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Stateless;
+import javax.inject.Inject;
+
+@Stateless
+public class Course {
+
+    @Inject
+    private Faculty faculty;
+
+    private String courseName;
+
+    private int capacity;
+
+    @PostConstruct
+    private void init() {
+        assert faculty != null;
+
+        // These strings can be externalized
+        // We'll see how to do that later
+        this.courseName = "CDI 101 - Introduction to CDI";
+        this.capacity = 100;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public int getCapacity() {
+        return capacity;
+    }
+
+    public Faculty getFaculty() {
+        return faculty;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Faculty.java
----------------------------------------------------------------------
diff --git a/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Faculty.java b/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Faculty.java
index 2cf8d8a..e0adf28 100644
--- a/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Faculty.java
+++ b/examples/cdi-basic/src/main/java/org/superbiz/cdi/basic/Faculty.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.basic;
-
-import javax.annotation.PostConstruct;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Faculty {
-
-    private List<String> facultyMembers;
-
-    private String facultyName;
-
-    @PostConstruct
-    public void initialize() {
-        this.facultyMembers = new ArrayList<String>();
-        facultyMembers.add("Ian Schultz");
-        facultyMembers.add("Diane Reyes");
-        facultyName = "Computer Science";
-    }
-
-    public List<String> getFacultyMembers() {
-        return facultyMembers;
-    }
-
-    public String getFacultyName() {
-        return facultyName;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.basic;
+
+import javax.annotation.PostConstruct;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Faculty {
+
+    private List<String> facultyMembers;
+
+    private String facultyName;
+
+    @PostConstruct
+    public void initialize() {
+        this.facultyMembers = new ArrayList<String>();
+        facultyMembers.add("Ian Schultz");
+        facultyMembers.add("Diane Reyes");
+        facultyName = "Computer Science";
+    }
+
+    public List<String> getFacultyMembers() {
+        return facultyMembers;
+    }
+
+    public String getFacultyName() {
+        return facultyName;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-basic/src/test/java/org/superbiz/cdi/basic/CourseTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-basic/src/test/java/org/superbiz/cdi/basic/CourseTest.java b/examples/cdi-basic/src/test/java/org/superbiz/cdi/basic/CourseTest.java
index 3271f33..cb042f4 100644
--- a/examples/cdi-basic/src/test/java/org/superbiz/cdi/basic/CourseTest.java
+++ b/examples/cdi-basic/src/test/java/org/superbiz/cdi/basic/CourseTest.java
@@ -1,71 +1,71 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.basic;
-
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-public class CourseTest {
-
-    private static EJBContainer container;
-
-    @EJB
-    private Course course;
-
-    @BeforeClass
-    public static void start() {
-        container = EJBContainer.createEJBContainer();
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        container.getContext().bind("inject", this);
-    }
-
-    @Test
-    public void test() {
-
-        // Was the EJB injected?
-        assertTrue(course != null);
-
-        // Was the Course @PostConstruct called?
-        assertNotNull(course.getCourseName());
-        assertTrue(course.getCapacity() > 0);
-
-        // Was a Faculty instance injected into Course?
-        final Faculty faculty = course.getFaculty();
-        assertTrue(faculty != null);
-
-        // Was the @PostConstruct called on Faculty?
-        assertEquals(faculty.getFacultyName(), "Computer Science");
-        assertEquals(faculty.getFacultyMembers().size(), 2);
-    }
-
-    @AfterClass
-    public static void stop() {
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.basic;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+public class CourseTest {
+
+    private static EJBContainer container;
+
+    @EJB
+    private Course course;
+
+    @BeforeClass
+    public static void start() {
+        container = EJBContainer.createEJBContainer();
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        container.getContext().bind("inject", this);
+    }
+
+    @Test
+    public void test() {
+
+        // Was the EJB injected?
+        assertTrue(course != null);
+
+        // Was the Course @PostConstruct called?
+        assertNotNull(course.getCourseName());
+        assertTrue(course.getCapacity() > 0);
+
+        // Was a Faculty instance injected into Course?
+        final Faculty faculty = course.getFaculty();
+        assertTrue(faculty != null);
+
+        // Was the @PostConstruct called on Faculty?
+        assertEquals(faculty.getFacultyName(), "Computer Science");
+        assertEquals(faculty.getFacultyMembers().size(), 2);
+    }
+
+    @AfterClass
+    public static void stop() {
+        container.close();
+    }
+}

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

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
----------------------------------------------------------------------
diff --git a/examples/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java b/examples/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
index b0ed888..6dd11f5 100644
--- a/examples/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
+++ b/examples/cdi-ejbcontext-jaas/src/main/java/org/superbiz/cdi/ejbcontext/PrinciaplEjb.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.cdi.ejbcontext;
-
-import javax.annotation.Resource;
-import javax.ejb.EJBContext;
-import javax.ejb.Stateless;
-
-@Stateless
-public class PrinciaplEjb {
-
-    @Resource
-    private EJBContext context;
-
-    public String info() {
-        return context.getCallerPrincipal().getName();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.ejbcontext;
+
+import javax.annotation.Resource;
+import javax.ejb.EJBContext;
+import javax.ejb.Stateless;
+
+@Stateless
+public class PrinciaplEjb {
+
+    @Resource
+    private EJBContext context;
+
+    public String info() {
+        return context.getCallerPrincipal().getName();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-events/src/main/java/org/superbiz/cdi/events/Notifier.java
----------------------------------------------------------------------
diff --git a/examples/cdi-events/src/main/java/org/superbiz/cdi/events/Notifier.java b/examples/cdi-events/src/main/java/org/superbiz/cdi/events/Notifier.java
index ac2eb96..06e6ff7 100644
--- a/examples/cdi-events/src/main/java/org/superbiz/cdi/events/Notifier.java
+++ b/examples/cdi-events/src/main/java/org/superbiz/cdi/events/Notifier.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.events;
-
-import javax.ejb.Schedule;
-import javax.ejb.Singleton;
-import javax.enterprise.event.Event;
-import javax.inject.Inject;
-import java.util.Date;
-
-@Singleton
-public class Notifier {
-
-    @Inject
-    private Event<Date> dateEvent;
-
-    @Schedule(second = "*", minute = "*", hour = "*")
-    public void sendHour() {
-        dateEvent.fire(new Date());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.events;
+
+import javax.ejb.Schedule;
+import javax.ejb.Singleton;
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+import java.util.Date;
+
+@Singleton
+public class Notifier {
+
+    @Inject
+    private Event<Date> dateEvent;
+
+    @Schedule(second = "*", minute = "*", hour = "*")
+    public void sendHour() {
+        dateEvent.fire(new Date());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-events/src/test/java/org/superbiz/cdi/events/EventTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-events/src/test/java/org/superbiz/cdi/events/EventTest.java b/examples/cdi-events/src/test/java/org/superbiz/cdi/events/EventTest.java
index bb330be..ab0701f 100644
--- a/examples/cdi-events/src/test/java/org/superbiz/cdi/events/EventTest.java
+++ b/examples/cdi-events/src/test/java/org/superbiz/cdi/events/EventTest.java
@@ -1,73 +1,73 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.events;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.inject.Inject;
-import javax.naming.NamingException;
-
-import static org.junit.Assert.assertTrue;
-
-public class EventTest {
-
-    private static EJBContainer container;
-    private static String initialLogProperty;
-
-    @Inject
-    private Observer observer;
-
-    @BeforeClass
-    public static void start() throws NamingException {
-        initialLogProperty = System.getProperty("openejb.logger.external");
-        System.setProperty("openejb.logger.external", "true");
-        container = EJBContainer.createEJBContainer();
-    }
-
-    @AfterClass
-    public static void shutdown() {
-        if (container != null) {
-            container.close();
-        }
-        if (initialLogProperty != null) {
-            System.setProperty("openejb.logger.external", initialLogProperty);
-        } else {
-            System.getProperties().remove("openejb.logger.external");
-        }
-    }
-
-    @Before
-    public void inject() throws NamingException {
-        container.getContext().bind("inject", this);
-    }
-
-    @After
-    public void reset() throws NamingException {
-        container.getContext().unbind("inject");
-    }
-
-    @Test
-    public void observe() throws InterruptedException {
-        Thread.sleep(4000);
-        assertTrue(observer.getDates().size() > 3); // in 4s normally at least 3 events were received
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.events;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.inject.Inject;
+import javax.naming.NamingException;
+
+import static org.junit.Assert.assertTrue;
+
+public class EventTest {
+
+    private static EJBContainer container;
+    private static String initialLogProperty;
+
+    @Inject
+    private Observer observer;
+
+    @BeforeClass
+    public static void start() throws NamingException {
+        initialLogProperty = System.getProperty("openejb.logger.external");
+        System.setProperty("openejb.logger.external", "true");
+        container = EJBContainer.createEJBContainer();
+    }
+
+    @AfterClass
+    public static void shutdown() {
+        if (container != null) {
+            container.close();
+        }
+        if (initialLogProperty != null) {
+            System.setProperty("openejb.logger.external", initialLogProperty);
+        } else {
+            System.getProperties().remove("openejb.logger.external");
+        }
+    }
+
+    @Before
+    public void inject() throws NamingException {
+        container.getContext().bind("inject", this);
+    }
+
+    @After
+    public void reset() throws NamingException {
+        container.getContext().unbind("inject");
+    }
+
+    @Test
+    public void observe() throws InterruptedException {
+        Thread.sleep(4000);
+        assertTrue(observer.getDates().size() > 3); // in 4s normally at least 3 events were received
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-events/src/test/java/org/superbiz/cdi/events/Observer.java
----------------------------------------------------------------------
diff --git a/examples/cdi-events/src/test/java/org/superbiz/cdi/events/Observer.java b/examples/cdi-events/src/test/java/org/superbiz/cdi/events/Observer.java
index 5d58369..f08ff55 100644
--- a/examples/cdi-events/src/test/java/org/superbiz/cdi/events/Observer.java
+++ b/examples/cdi-events/src/test/java/org/superbiz/cdi/events/Observer.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.events;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.enterprise.event.Observes;
-import javax.inject.Singleton;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-@Singleton
-public class Observer {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(Observer.class);
-
-    private List<Date> dates = new ArrayList<Date>();
-
-    public void saveDate(@Observes Date date) {
-        dates.add(date);
-        LOGGER.info("received date '{}'", date);
-    }
-
-    public List<Date> getDates() {
-        return dates;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.events;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.event.Observes;
+import javax.inject.Singleton;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Singleton
+public class Observer {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(Observer.class);
+
+    private List<Date> dates = new ArrayList<Date>();
+
+    public void saveDate(@Observes Date date) {
+        dates.add(date);
+        LOGGER.info("received date '{}'", date);
+    }
+
+    public List<Date> getDates() {
+        return dates;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/AccessDeniedException.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/AccessDeniedException.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/AccessDeniedException.java
index 9d038a2..65ed85c 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/AccessDeniedException.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/AccessDeniedException.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi;
-
-import javax.ejb.ApplicationException;
-
-/**
- * @version $Revision$ $Date$
- */
-@ApplicationException
-public class AccessDeniedException extends RuntimeException {
-
-    private static final long serialVersionUID = 1L;
-
-    public AccessDeniedException(String s) {
-        super(s);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi;
+
+import javax.ejb.ApplicationException;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@ApplicationException
+public class AccessDeniedException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    public AccessDeniedException(String s) {
+        super(s);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOldStyleInterceptorBinding.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOldStyleInterceptorBinding.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOldStyleInterceptorBinding.java
index 99e2071..f128ed8 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOldStyleInterceptorBinding.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOldStyleInterceptorBinding.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.beans;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-import org.superbiz.cdi.bookshow.interceptors.BookForAShowLoggingInterceptor;
-
-import javax.ejb.Stateful;
-import javax.interceptor.Interceptors;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * CDI supports binding an interceptor using @Interceptors
- * Not recommended though. Has its disadvantages
- * Cannot be disabled easily
- * Order dependent on how it is listed in class
- * Instead, create interceptor bindings using @InterceptorBinding and bind them
- * See {@link Log}, {@link BookForAShowOneInterceptorApplied}, {@link BookForAShowLoggingInterceptor}
- */
-@Interceptors(BookForAShowLoggingInterceptor.class)
-@Stateful
-public class BookForAShowOldStyleInterceptorBinding implements Serializable {
-
-    private static final long serialVersionUID = 6350400892234496909L;
-
-    public List<String> getMoviesList() {
-        List<String> moviesAvailable = new ArrayList<String>();
-        moviesAvailable.add("KungFu Panda 2");
-        moviesAvailable.add("Kings speech");
-        return moviesAvailable;
-    }
-
-    public Integer getDiscountedPrice(int ticketPrice) {
-        return ticketPrice - 50;
-    }
-    // assume more methods are present
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.beans;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+import org.superbiz.cdi.bookshow.interceptors.BookForAShowLoggingInterceptor;
+
+import javax.ejb.Stateful;
+import javax.interceptor.Interceptors;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * CDI supports binding an interceptor using @Interceptors
+ * Not recommended though. Has its disadvantages
+ * Cannot be disabled easily
+ * Order dependent on how it is listed in class
+ * Instead, create interceptor bindings using @InterceptorBinding and bind them
+ * See {@link Log}, {@link BookForAShowOneInterceptorApplied}, {@link BookForAShowLoggingInterceptor}
+ */
+@Interceptors(BookForAShowLoggingInterceptor.class)
+@Stateful
+public class BookForAShowOldStyleInterceptorBinding implements Serializable {
+
+    private static final long serialVersionUID = 6350400892234496909L;
+
+    public List<String> getMoviesList() {
+        List<String> moviesAvailable = new ArrayList<String>();
+        moviesAvailable.add("KungFu Panda 2");
+        moviesAvailable.add("Kings speech");
+        return moviesAvailable;
+    }
+
+    public Integer getDiscountedPrice(int ticketPrice) {
+        return ticketPrice - 50;
+    }
+    // assume more methods are present
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOneInterceptorApplied.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOneInterceptorApplied.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOneInterceptorApplied.java
index ee5127d..6b94b79 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOneInterceptorApplied.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowOneInterceptorApplied.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.beans;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-
-import javax.ejb.Stateful;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-@Log
-@Stateful
-public class BookForAShowOneInterceptorApplied implements Serializable {
-
-    private static final long serialVersionUID = 6350400892234496909L;
-
-    public List<String> getMoviesList() {
-        List<String> moviesAvailable = new ArrayList<String>();
-        moviesAvailable.add("12 Angry Men");
-        moviesAvailable.add("Kings speech");
-        return moviesAvailable;
-    }
-
-    public Integer getDiscountedPrice(int ticketPrice) {
-        return ticketPrice - 50;
-    }
-    // assume more methods are present
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.beans;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+
+import javax.ejb.Stateful;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Log
+@Stateful
+public class BookForAShowOneInterceptorApplied implements Serializable {
+
+    private static final long serialVersionUID = 6350400892234496909L;
+
+    public List<String> getMoviesList() {
+        List<String> moviesAvailable = new ArrayList<String>();
+        moviesAvailable.add("12 Angry Men");
+        moviesAvailable.add("Kings speech");
+        return moviesAvailable;
+    }
+
+    public Integer getDiscountedPrice(int ticketPrice) {
+        return ticketPrice - 50;
+    }
+    // assume more methods are present
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowTwoInterceptorsApplied.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowTwoInterceptorsApplied.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowTwoInterceptorsApplied.java
index a3b98f5..bc088f2 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowTwoInterceptorsApplied.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookForAShowTwoInterceptorsApplied.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.beans;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestricted;
-
-import javax.ejb.Stateful;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-@Log
-@Stateful
-public class BookForAShowTwoInterceptorsApplied implements Serializable {
-
-    private static final long serialVersionUID = 6350400892234496909L;
-
-    public List<String> getMoviesList() {
-        List<String> moviesAvailable = new ArrayList<String>();
-        moviesAvailable.add("12 Angry Men");
-        moviesAvailable.add("Kings speech");
-        return moviesAvailable;
-    }
-
-    @TimeRestricted
-    public Integer getDiscountedPrice(int ticketPrice) {
-        return ticketPrice - 50;
-    }
-    // assume more methods are present
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.beans;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestricted;
+
+import javax.ejb.Stateful;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Log
+@Stateful
+public class BookForAShowTwoInterceptorsApplied implements Serializable {
+
+    private static final long serialVersionUID = 6350400892234496909L;
+
+    public List<String> getMoviesList() {
+        List<String> moviesAvailable = new ArrayList<String>();
+        moviesAvailable.add("12 Angry Men");
+        moviesAvailable.add("Kings speech");
+        return moviesAvailable;
+    }
+
+    @TimeRestricted
+    public Integer getDiscountedPrice(int ticketPrice) {
+        return ticketPrice - 50;
+    }
+    // assume more methods are present
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookShowInterceptorBindingInheritanceExplored.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookShowInterceptorBindingInheritanceExplored.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookShowInterceptorBindingInheritanceExplored.java
index 766a6f1..323526f 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookShowInterceptorBindingInheritanceExplored.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/beans/BookShowInterceptorBindingInheritanceExplored.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.superbiz.cdi.bookshow.beans;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestrictAndLog;
-
-import javax.ejb.Stateful;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-@Stateful
-public class BookShowInterceptorBindingInheritanceExplored implements Serializable {
-
-    private static final long serialVersionUID = 6350400892234496909L;
-
-    public List<String> getMoviesList() {
-        List<String> moviesAvailable = new ArrayList<String>();
-        moviesAvailable.add("12 Angry Men");
-        moviesAvailable.add("Kings speech");
-        return moviesAvailable;
-    }
-
-    @TimeRestrictAndLog
-    public Integer getDiscountedPrice(int ticketPrice) {
-        return ticketPrice - 50;
-    }
-    // assume more methods are present
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.superbiz.cdi.bookshow.beans;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestrictAndLog;
+
+import javax.ejb.Stateful;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Stateful
+public class BookShowInterceptorBindingInheritanceExplored implements Serializable {
+
+    private static final long serialVersionUID = 6350400892234496909L;
+
+    public List<String> getMoviesList() {
+        List<String> moviesAvailable = new ArrayList<String>();
+        moviesAvailable.add("12 Angry Men");
+        moviesAvailable.add("Kings speech");
+        return moviesAvailable;
+    }
+
+    @TimeRestrictAndLog
+    public Integer getDiscountedPrice(int ticketPrice) {
+        return ticketPrice - 50;
+    }
+    // assume more methods are present
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
index 6516dbc..cdaf8d7 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptorbinding;
-
-import javax.interceptor.InterceptorBinding;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@InterceptorBinding
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface Log {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptorbinding;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface Log {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestrictAndLog.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestrictAndLog.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestrictAndLog.java
index 67c7232..f3315da 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestrictAndLog.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestrictAndLog.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptorbinding;
-
-import javax.interceptor.InterceptorBinding;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * This InterceptorBinding inherits from @Log and @TimeRestricted Interceptor-Bindings.
- */
-@Inherited
-@InterceptorBinding
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-@Log
-@TimeRestricted
-public @interface TimeRestrictAndLog {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptorbinding;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This InterceptorBinding inherits from @Log and @TimeRestricted Interceptor-Bindings.
+ */
+@Inherited
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+@Log
+@TimeRestricted
+public @interface TimeRestrictAndLog {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestricted.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestricted.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestricted.java
index 3409482..d83bb73 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestricted.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/TimeRestricted.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptorbinding;
-
-import javax.interceptor.InterceptorBinding;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@InterceptorBinding
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface TimeRestricted {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptorbinding;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface TimeRestricted {
+
+}


[10/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java b/examples/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java
index 1b164b3..9fd1240 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java
@@ -1,72 +1,72 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.dao;
-
-import org.superbiz.rest.model.Post;
-import org.superbiz.rest.model.User;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-import java.util.List;
-
-@Singleton
-@Lock(LockType.READ)
-public class PostDAO {
-
-    @Inject
-    private DAO dao;
-
-    public Post create(String title, String content, long userId) {
-        User user = dao.find(User.class, userId);
-        Post post = new Post();
-        post.setTitle(title);
-        post.setContent(content);
-        post.setUser(user);
-        return dao.create(post);
-    }
-
-    public Post find(long id) {
-        return dao.find(Post.class, id);
-    }
-
-    public List<Post> list(int first, int max) {
-        return dao.namedFind(Post.class, "post.list", first, max);
-    }
-
-    public void delete(long id) {
-        dao.delete(Post.class, id);
-    }
-
-    public Post update(long id, long userId, String title, String content) {
-        User user = dao.find(User.class, userId);
-        if (user == null) {
-            throw new IllegalArgumentException("user id " + id + " not found");
-        }
-
-        Post post = dao.find(Post.class, id);
-        if (post == null) {
-            throw new IllegalArgumentException("post id " + id + " not found");
-        }
-
-        post.setTitle(title);
-        post.setContent(content);
-        post.setUser(user);
-        return dao.update(post);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest.dao;
+
+import org.superbiz.rest.model.Post;
+import org.superbiz.rest.model.User;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import java.util.List;
+
+@Singleton
+@Lock(LockType.READ)
+public class PostDAO {
+
+    @Inject
+    private DAO dao;
+
+    public Post create(String title, String content, long userId) {
+        User user = dao.find(User.class, userId);
+        Post post = new Post();
+        post.setTitle(title);
+        post.setContent(content);
+        post.setUser(user);
+        return dao.create(post);
+    }
+
+    public Post find(long id) {
+        return dao.find(Post.class, id);
+    }
+
+    public List<Post> list(int first, int max) {
+        return dao.namedFind(Post.class, "post.list", first, max);
+    }
+
+    public void delete(long id) {
+        dao.delete(Post.class, id);
+    }
+
+    public Post update(long id, long userId, String title, String content) {
+        User user = dao.find(User.class, userId);
+        if (user == null) {
+            throw new IllegalArgumentException("user id " + id + " not found");
+        }
+
+        Post post = dao.find(Post.class, id);
+        if (post == null) {
+            throw new IllegalArgumentException("post id " + id + " not found");
+        }
+
+        post.setTitle(title);
+        post.setContent(content);
+        post.setUser(user);
+        return dao.update(post);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java b/examples/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java
index 75135e4..2c1f509 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java
@@ -1,65 +1,65 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.dao;
-
-import org.superbiz.rest.model.User;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-import java.util.List;
-
-@Singleton
-@Lock(LockType.READ)
-public class UserDAO {
-
-    @Inject
-    private DAO dao;
-
-    public User create(String name, String pwd, String mail) {
-        User user = new User();
-        user.setFullname(name);
-        user.setPassword(pwd);
-        user.setEmail(mail);
-        return dao.create(user);
-    }
-
-    public List<User> list(int first, int max) {
-        return dao.namedFind(User.class, "user.list", first, max);
-    }
-
-    public User find(long id) {
-        return dao.find(User.class, id);
-    }
-
-    public void delete(long id) {
-        dao.delete(User.class, id);
-    }
-
-    public User update(long id, String name, String pwd, String mail) {
-        User user = dao.find(User.class, id);
-        if (user == null) {
-            throw new IllegalArgumentException("setUser id " + id + " not found");
-        }
-
-        user.setFullname(name);
-        user.setPassword(pwd);
-        user.setEmail(mail);
-        return dao.update(user);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest.dao;
+
+import org.superbiz.rest.model.User;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import java.util.List;
+
+@Singleton
+@Lock(LockType.READ)
+public class UserDAO {
+
+    @Inject
+    private DAO dao;
+
+    public User create(String name, String pwd, String mail) {
+        User user = new User();
+        user.setFullname(name);
+        user.setPassword(pwd);
+        user.setEmail(mail);
+        return dao.create(user);
+    }
+
+    public List<User> list(int first, int max) {
+        return dao.namedFind(User.class, "user.list", first, max);
+    }
+
+    public User find(long id) {
+        return dao.find(User.class, id);
+    }
+
+    public void delete(long id) {
+        dao.delete(User.class, id);
+    }
+
+    public User update(long id, String name, String pwd, String mail) {
+        User user = dao.find(User.class, id);
+        if (user == null) {
+            throw new IllegalArgumentException("setUser id " + id + " not found");
+        }
+
+        user.setFullname(name);
+        user.setPassword(pwd);
+        user.setEmail(mail);
+        return dao.update(user);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/model/Comment.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/model/Comment.java b/examples/rest-example/src/main/java/org/superbiz/rest/model/Comment.java
index 71ec450..76b8c2c 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/model/Comment.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/model/Comment.java
@@ -1,75 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.model;
-
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.Lob;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = "comment.list", query = "select c from Comment c")
-              })
-@XmlRootElement(name = "comment")
-public class Comment extends Model {
-
-    @NotNull
-    @Size(min = 1)
-    private String author;
-    @NotNull
-    @Size(min = 1)
-    @Lob
-    private String content;
-    @ManyToOne
-    @JoinColumn(name = "post_id")
-    @Valid
-    @XmlTransient
-    private Post post;
-
-    public void setAuthor(final String author) {
-        this.author = author;
-    }
-
-    public void setContent(final String content) {
-        this.content = content;
-    }
-
-    public void setPost(Post post) {
-        post.addComment(this);
-        this.post = post;
-    }
-
-    public String getAuthor() {
-        return author;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public Post getPost() {
-        return post;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest.model;
+
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = "comment.list", query = "select c from Comment c")
+})
+@XmlRootElement(name = "comment")
+public class Comment extends Model {
+
+    @NotNull
+    @Size(min = 1)
+    private String author;
+    @NotNull
+    @Size(min = 1)
+    @Lob
+    private String content;
+    @ManyToOne
+    @JoinColumn(name = "post_id")
+    @Valid
+    @XmlTransient
+    private Post post;
+
+    public void setAuthor(final String author) {
+        this.author = author;
+    }
+
+    public void setContent(final String content) {
+        this.content = content;
+    }
+
+    public void setPost(Post post) {
+        post.addComment(this);
+        this.post = post;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public Post getPost() {
+        return post;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/model/Post.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/model/Post.java b/examples/rest-example/src/main/java/org/superbiz/rest/model/Post.java
index 9d720b6..cde4d05 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/model/Post.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/model/Post.java
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.model;
-
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Lob;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = "post.list", query = "select p from Post p")
-              })
-@XmlRootElement(name = "post")
-public class Post extends DatedModel {
-
-    @NotNull
-    @Size(min = 1)
-    private String title;
-
-    @NotNull
-    @Size(min = 1)
-    @Lob
-    private String content;
-
-    @ManyToOne
-    @Valid
-    private User user;
-
-    @OneToMany(mappedBy = "post", fetch = FetchType.EAGER)
-    private List<Comment> comments = new ArrayList<Comment>();
-
-    public void setTitle(final String title) {
-        this.title = title;
-    }
-
-    public void setContent(final String content) {
-        this.content = content;
-    }
-
-    public void setUser(final User user) {
-        this.user = user;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public User getUser() {
-        return user;
-    }
-
-    public List<Comment> getComments() {
-        return comments;
-    }
-
-    public void setComments(List<Comment> comments) {
-        this.comments = comments;
-    }
-
-    public void addComment(final Comment comment) {
-        getComments().add(comment);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest.model;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = "post.list", query = "select p from Post p")
+})
+@XmlRootElement(name = "post")
+public class Post extends DatedModel {
+
+    @NotNull
+    @Size(min = 1)
+    private String title;
+
+    @NotNull
+    @Size(min = 1)
+    @Lob
+    private String content;
+
+    @ManyToOne
+    @Valid
+    private User user;
+
+    @OneToMany(mappedBy = "post", fetch = FetchType.EAGER)
+    private List<Comment> comments = new ArrayList<Comment>();
+
+    public void setTitle(final String title) {
+        this.title = title;
+    }
+
+    public void setContent(final String content) {
+        this.content = content;
+    }
+
+    public void setUser(final User user) {
+        this.user = user;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public List<Comment> getComments() {
+        return comments;
+    }
+
+    public void setComments(List<Comment> comments) {
+        this.comments = comments;
+    }
+
+    public void addComment(final Comment comment) {
+        getComments().add(comment);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/model/User.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/model/User.java b/examples/rest-example/src/main/java/org/superbiz/rest/model/User.java
index 30eec97..acba12b 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/model/User.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/model/User.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.model;
-
-import javax.persistence.Entity;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = "user.list", query = "select u from User u")
-              })
-@XmlRootElement(name = "user")
-public class User extends Model {
-
-    @NotNull
-    @Size(min = 3, max = 15)
-    private String fullname;
-
-    @NotNull
-    @Size(min = 5, max = 15)
-    private String password;
-
-    @NotNull
-    @Pattern(regexp = ".+@.+\\.[a-z]+")
-    private String email;
-
-    public void setFullname(final String fullname) {
-        this.fullname = fullname;
-    }
-
-    public void setPassword(final String password) {
-        this.password = password;
-    }
-
-    public void setEmail(final String email) {
-        this.email = email;
-    }
-
-    public String getFullname() {
-        return fullname;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest.model;
+
+import javax.persistence.Entity;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = "user.list", query = "select u from User u")
+})
+@XmlRootElement(name = "user")
+public class User extends Model {
+
+    @NotNull
+    @Size(min = 3, max = 15)
+    private String fullname;
+
+    @NotNull
+    @Size(min = 5, max = 15)
+    private String password;
+
+    @NotNull
+    @Pattern(regexp = ".+@.+\\.[a-z]+")
+    private String email;
+
+    public void setFullname(final String fullname) {
+        this.fullname = fullname;
+    }
+
+    public void setPassword(final String password) {
+        this.password = password;
+    }
+
+    public void setEmail(final String email) {
+        this.email = email;
+    }
+
+    public String getFullname() {
+        return fullname;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java b/examples/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java
index 04a985a..af0a671 100644
--- a/examples/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java
+++ b/examples/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest.dao;
-
-import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
-import org.apache.tomee.embedded.EmbeddedTomEEContainer;
-import org.apache.ziplock.Archive;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.superbiz.rest.model.User;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.NamingException;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.apache.openejb.loader.JarLocation.jarLocation;
-
-public class UserServiceTest {
-
-    private static EJBContainer container;
-
-    @BeforeClass
-    public static void start() throws IOException {
-        final File webApp = Archive.archive().copyTo("WEB-INF/classes", jarLocation(UserDAO.class)).asDir();
-        final Properties p = new Properties();
-        p.setProperty(EJBContainer.APP_NAME, "rest-example");
-        p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
-        p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
-        p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "-1"); // random port
-        container = EJBContainer.createEJBContainer(p);
-    }
-
-    @AfterClass
-    public static void stop() {
-        if (container != null) {
-            container.close();
-        }
-    }
-
-    @Test
-    public void create() throws NamingException {
-        final UserDAO dao = (UserDAO) container.getContext().lookup("java:global/rest-example/UserDAO");
-        final User user = dao.create("foo", "dummy", "foo@dummy.org");
-        assertNotNull(dao.find(user.getId()));
-
-        final String uri = "http://127.0.0.1:" + System.getProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT) + "/rest-example";
-        final UserServiceClientAPI client = JAXRSClientFactory.create(uri, UserServiceClientAPI.class);
-        final User retrievedUser = client.show(user.getId());
-        assertNotNull(retrievedUser);
-        assertEquals("foo", retrievedUser.getFullname());
-        assertEquals("dummy", retrievedUser.getPassword());
-        assertEquals("foo@dummy.org", retrievedUser.getEmail());
-    }
-
-    /**
-     * a simple copy of the unique method i want to use from my service.
-     * It allows to use cxf proxy to call remotely our rest service.
-     * Any other way to do it is good.
-     */
-    @Path("/api/user")
-    @Produces({"text/xml", "application/json"})
-    public static interface UserServiceClientAPI {
-
-        @Path("/show/{id}")
-        @GET
-        User show(@PathParam("id") long id);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.rest.dao;
+
+import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
+import org.apache.tomee.embedded.EmbeddedTomEEContainer;
+import org.apache.ziplock.Archive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.superbiz.rest.model.User;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import static org.apache.openejb.loader.JarLocation.jarLocation;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class UserServiceTest {
+
+    private static EJBContainer container;
+
+    @BeforeClass
+    public static void start() throws IOException {
+        final File webApp = Archive.archive().copyTo("WEB-INF/classes", jarLocation(UserDAO.class)).asDir();
+        final Properties p = new Properties();
+        p.setProperty(EJBContainer.APP_NAME, "rest-example");
+        p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
+        p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
+        p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "-1"); // random port
+        container = EJBContainer.createEJBContainer(p);
+    }
+
+    @AfterClass
+    public static void stop() {
+        if (container != null) {
+            container.close();
+        }
+    }
+
+    @Test
+    public void create() throws NamingException {
+        final UserDAO dao = (UserDAO) container.getContext().lookup("java:global/rest-example/UserDAO");
+        final User user = dao.create("foo", "dummy", "foo@dummy.org");
+        assertNotNull(dao.find(user.getId()));
+
+        final String uri = "http://127.0.0.1:" + System.getProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT) + "/rest-example";
+        final UserServiceClientAPI client = JAXRSClientFactory.create(uri, UserServiceClientAPI.class);
+        final User retrievedUser = client.show(user.getId());
+        assertNotNull(retrievedUser);
+        assertEquals("foo", retrievedUser.getFullname());
+        assertEquals("dummy", retrievedUser.getPassword());
+        assertEquals("foo@dummy.org", retrievedUser.getEmail());
+    }
+
+    /**
+     * a simple copy of the unique method i want to use from my service.
+     * It allows to use cxf proxy to call remotely our rest service.
+     * Any other way to do it is good.
+     */
+    @Path("/api/user")
+    @Produces({"text/xml", "application/json"})
+    public static interface UserServiceClientAPI {
+
+        @Path("/show/{id}")
+        @GET
+        User show(@PathParam("id") long id);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-jaas/src/main/java/org/superbiz/jaxrs/jaas/JAASSecuredRestEndpoint.java
----------------------------------------------------------------------
diff --git a/examples/rest-jaas/src/main/java/org/superbiz/jaxrs/jaas/JAASSecuredRestEndpoint.java b/examples/rest-jaas/src/main/java/org/superbiz/jaxrs/jaas/JAASSecuredRestEndpoint.java
index 420ef2f..b44db79 100644
--- a/examples/rest-jaas/src/main/java/org/superbiz/jaxrs/jaas/JAASSecuredRestEndpoint.java
+++ b/examples/rest-jaas/src/main/java/org/superbiz/jaxrs/jaas/JAASSecuredRestEndpoint.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.jaxrs.jaas;
-
-import javax.annotation.Resource;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.SessionContext;
-import javax.ejb.Singleton;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Path("rest")
-@Singleton
-@Lock(LockType.READ)
-public class JAASSecuredRestEndpoint {
-
-    @Resource
-    private SessionContext ctx;
-
-    @GET
-    @Path("jaas")
-    @RolesAllowed("superUser")
-    public String getPrincipalName() {
-        return ctx.getCallerPrincipal().getName();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jaxrs.jaas;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.SessionContext;
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("rest")
+@Singleton
+@Lock(LockType.READ)
+public class JAASSecuredRestEndpoint {
+
+    @Resource
+    private SessionContext ctx;
+
+    @GET
+    @Path("jaas")
+    @RolesAllowed("superUser")
+    public String getPrincipalName() {
+        return ctx.getCallerPrincipal().getName();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-on-ejb/src/main/java/org/superbiz/rest/User.java
----------------------------------------------------------------------
diff --git a/examples/rest-on-ejb/src/main/java/org/superbiz/rest/User.java b/examples/rest-on-ejb/src/main/java/org/superbiz/rest/User.java
index 87227f5..048f0d5 100644
--- a/examples/rest-on-ejb/src/main/java/org/superbiz/rest/User.java
+++ b/examples/rest-on-ejb/src/main/java/org/superbiz/rest/User.java
@@ -1,100 +1,100 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- *     contributor license agreements.  See the NOTICE file distributed with
- *     this work for additional information regarding copyright ownership.
- *     The ASF licenses this file to You under the Apache License, Version 2.0
- *     (the "License"); you may not use this file except in compliance with
- *     the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *     Unless required by applicable law or agreed to in writing, software
- *     distributed under the License is distributed on an "AS IS" BASIS,
- *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *     See the License for the specific language governing permissions and
- *     limitations under the License.
- */
-
-package org.superbiz.rest;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = "user.list", query = "select u from User u order by u.fullname")
-              })
-@XmlRootElement(name = "user")
-public class User implements Cloneable {
-
-    @Id
-    @GeneratedValue
-    private long id;
-    private String fullname;
-    private String password;
-    private String email;
-
-    public void setFullname(final String fullname) {
-        this.fullname = fullname;
-    }
-
-    public void setPassword(final String password) {
-        this.password = password;
-    }
-
-    public void setEmail(final String email) {
-        this.email = email;
-    }
-
-    public String getFullname() {
-        return fullname;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public User copy() {
-        User user = new User();
-        user.setEmail(getEmail());
-        user.setFullname(getFullname());
-        user.setPassword(getPassword());
-        user.setId(getId());
-        return user;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || !User.class.isAssignableFrom(o.getClass())) {
-            return false;
-        }
-
-        User user = (User) o;
-
-        return id == user.id;
-    }
-
-    @Override
-    public int hashCode() {
-        return (int) (id ^ (id >>> 32));
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *     contributor license agreements.  See the NOTICE file distributed with
+ *     this work for additional information regarding copyright ownership.
+ *     The ASF licenses this file to You under the Apache License, Version 2.0
+ *     (the "License"); you may not use this file except in compliance with
+ *     the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *     Unless required by applicable law or agreed to in writing, software
+ *     distributed under the License is distributed on an "AS IS" BASIS,
+ *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *     See the License for the specific language governing permissions and
+ *     limitations under the License.
+ */
+
+package org.superbiz.rest;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = "user.list", query = "select u from User u order by u.fullname")
+})
+@XmlRootElement(name = "user")
+public class User implements Cloneable {
+
+    @Id
+    @GeneratedValue
+    private long id;
+    private String fullname;
+    private String password;
+    private String email;
+
+    public void setFullname(final String fullname) {
+        this.fullname = fullname;
+    }
+
+    public void setPassword(final String password) {
+        this.password = password;
+    }
+
+    public void setEmail(final String email) {
+        this.email = email;
+    }
+
+    public String getFullname() {
+        return fullname;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public User copy() {
+        User user = new User();
+        user.setEmail(getEmail());
+        user.setFullname(getFullname());
+        user.setPassword(getPassword());
+        user.setId(getId());
+        return user;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || !User.class.isAssignableFrom(o.getClass())) {
+            return false;
+        }
+
+        User user = (User) o;
+
+        return id == user.id;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) (id ^ (id >>> 32));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
----------------------------------------------------------------------
diff --git a/examples/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java b/examples/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
index 4128e17..119f01e 100644
--- a/examples/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
+++ b/examples/rest-xml-json/src/main/java/org/superbiz/rest/GreetingService.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-@Path("/greeting")
-@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-public class GreetingService {
-
-    @GET
-    public Response message() {
-        return new Response("Hi REST!");
-    }
-
-    @POST
-    public Response lowerCase(final Request message) {
-        return new Response(message.getValue().toLowerCase());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/greeting")
+@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+public class GreetingService {
+
+    @GET
+    public Response message() {
+        return new Response("Hi REST!");
+    }
+
+    @POST
+    public Response lowerCase(final Request message) {
+        return new Response(message.getValue().toLowerCase());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
----------------------------------------------------------------------
diff --git a/examples/rest-xml-json/src/main/java/org/superbiz/rest/Request.java b/examples/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
index cac8e74..679d439 100644
--- a/examples/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
+++ b/examples/rest-xml-json/src/main/java/org/superbiz/rest/Request.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Request {
-
-    private String value;
-
-    public Request() {
-        //no-op
-    }
-
-    public Request(final String s) {
-        value = s;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Request {
+
+    private String value;
+
+    public Request() {
+        //no-op
+    }
+
+    public Request(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
----------------------------------------------------------------------
diff --git a/examples/rest-xml-json/src/main/java/org/superbiz/rest/Response.java b/examples/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
index 4c2319d..4cb0818 100644
--- a/examples/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
+++ b/examples/rest-xml-json/src/main/java/org/superbiz/rest/Response.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Response {
-
-    private String value;
-
-    public Response() {
-        // no-op
-    }
-
-    public Response(final String s) {
-        value = s;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Response {
+
+    private String value;
+
+    public Response() {
+        // no-op
+    }
+
+    public Response(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java b/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
index 406d0b0..7b54d10 100644
--- a/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
+++ b/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.rest;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-events/src/test/java/org/superbiz/schedule/events/SchedulerTest.java
----------------------------------------------------------------------
diff --git a/examples/schedule-events/src/test/java/org/superbiz/schedule/events/SchedulerTest.java b/examples/schedule-events/src/test/java/org/superbiz/schedule/events/SchedulerTest.java
index 66b78d0..07082ee 100644
--- a/examples/schedule-events/src/test/java/org/superbiz/schedule/events/SchedulerTest.java
+++ b/examples/schedule-events/src/test/java/org/superbiz/schedule/events/SchedulerTest.java
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.schedule.events;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.AccessTimeout;
-import javax.ejb.EJB;
-import javax.ejb.ScheduleExpression;
-import javax.ejb.embeddable.EJBContainer;
-import javax.enterprise.event.Observes;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @version $Revision$ $Date$
- */
-public class SchedulerTest {
-
-    public static final CountDownLatch events = new CountDownLatch(3);
-
-    @EJB
-    private Scheduler scheduler;
-
-    @Test
-    public void test() throws Exception {
-
-        final ScheduleExpression schedule = new ScheduleExpression()
-                                                .hour("*")
-                                                .minute("*")
-                                                .second("*/5");
-
-        scheduler.scheduleEvent(schedule, new TestEvent("five"));
-
-        Assert.assertTrue(events.await(1, TimeUnit.MINUTES));
-    }
-
-    @AccessTimeout(value = 1, unit = TimeUnit.MINUTES)
-    public void observe(@Observes TestEvent event) {
-        if ("five".equals(event.getMessage())) {
-            events.countDown();
-        }
-    }
-
-    public static class TestEvent {
-
-        private final String message;
-
-        public TestEvent(String message) {
-            this.message = message;
-        }
-
-        public String getMessage() {
-            return message;
-        }
-    }
-
-    @Before
-    public void setup() throws Exception {
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.schedule.events;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.AccessTimeout;
+import javax.ejb.EJB;
+import javax.ejb.ScheduleExpression;
+import javax.ejb.embeddable.EJBContainer;
+import javax.enterprise.event.Observes;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class SchedulerTest {
+
+    public static final CountDownLatch events = new CountDownLatch(3);
+
+    @EJB
+    private Scheduler scheduler;
+
+    @Test
+    public void test() throws Exception {
+
+        final ScheduleExpression schedule = new ScheduleExpression()
+                .hour("*")
+                .minute("*")
+                .second("*/5");
+
+        scheduler.scheduleEvent(schedule, new TestEvent("five"));
+
+        Assert.assertTrue(events.await(1, TimeUnit.MINUTES));
+    }
+
+    @AccessTimeout(value = 1, unit = TimeUnit.MINUTES)
+    public void observe(@Observes TestEvent event) {
+        if ("five".equals(event.getMessage())) {
+            events.countDown();
+        }
+    }
+
+    public static class TestEvent {
+
+        private final String message;
+
+        public TestEvent(String message) {
+            this.message = message;
+        }
+
+        public String getMessage() {
+            return message;
+        }
+    }
+
+    @Before
+    public void setup() throws Exception {
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-expression/src/main/java/org/superbiz/corn/FarmerBrown.java
----------------------------------------------------------------------
diff --git a/examples/schedule-expression/src/main/java/org/superbiz/corn/FarmerBrown.java b/examples/schedule-expression/src/main/java/org/superbiz/corn/FarmerBrown.java
index 8a3e939..2024e25 100644
--- a/examples/schedule-expression/src/main/java/org/superbiz/corn/FarmerBrown.java
+++ b/examples/schedule-expression/src/main/java/org/superbiz/corn/FarmerBrown.java
@@ -1,87 +1,87 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.ScheduleExpression;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.ejb.Timeout;
-import javax.ejb.Timer;
-import javax.ejb.TimerConfig;
-import javax.ejb.TimerService;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * This is where we schedule all of Farmer Brown's corn jobs
- *
- * @version $Revision$ $Date$
- */
-@Singleton
-@Lock(LockType.READ) // allows timers to execute in parallel
-@Startup
-public class FarmerBrown {
-
-    private final AtomicInteger checks = new AtomicInteger();
-
-    @Resource
-    private TimerService timerService;
-
-    @PostConstruct
-    private void construct() {
-        final TimerConfig plantTheCorn = new TimerConfig("plantTheCorn", false);
-        timerService.createCalendarTimer(new ScheduleExpression().month(5).dayOfMonth("20-Last").minute(0).hour(8), plantTheCorn);
-        timerService.createCalendarTimer(new ScheduleExpression().month(6).dayOfMonth("1-10").minute(0).hour(8), plantTheCorn);
-
-        final TimerConfig harvestTheCorn = new TimerConfig("harvestTheCorn", false);
-        timerService.createCalendarTimer(new ScheduleExpression().month(9).dayOfMonth("20-Last").minute(0).hour(8), harvestTheCorn);
-        timerService.createCalendarTimer(new ScheduleExpression().month(10).dayOfMonth("1-10").minute(0).hour(8), harvestTheCorn);
-
-        final TimerConfig checkOnTheDaughters = new TimerConfig("checkOnTheDaughters", false);
-        timerService.createCalendarTimer(new ScheduleExpression().second("*").minute("*").hour("*"), checkOnTheDaughters);
-    }
-
-    @Timeout
-    public void timeout(Timer timer) {
-        if ("plantTheCorn".equals(timer.getInfo())) {
-            plantTheCorn();
-        } else if ("harvestTheCorn".equals(timer.getInfo())) {
-            harvestTheCorn();
-        } else if ("checkOnTheDaughters".equals(timer.getInfo())) {
-            checkOnTheDaughters();
-        }
-    }
-
-    private void plantTheCorn() {
-        // Dig out the planter!!!
-    }
-
-    private void harvestTheCorn() {
-        // Dig out the combine!!!
-    }
-
-    private void checkOnTheDaughters() {
-        checks.incrementAndGet();
-    }
-
-    public int getChecks() {
-        return checks.get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.ScheduleExpression;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.Timeout;
+import javax.ejb.Timer;
+import javax.ejb.TimerConfig;
+import javax.ejb.TimerService;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * This is where we schedule all of Farmer Brown's corn jobs
+ *
+ * @version $Revision$ $Date$
+ */
+@Singleton
+@Lock(LockType.READ) // allows timers to execute in parallel
+@Startup
+public class FarmerBrown {
+
+    private final AtomicInteger checks = new AtomicInteger();
+
+    @Resource
+    private TimerService timerService;
+
+    @PostConstruct
+    private void construct() {
+        final TimerConfig plantTheCorn = new TimerConfig("plantTheCorn", false);
+        timerService.createCalendarTimer(new ScheduleExpression().month(5).dayOfMonth("20-Last").minute(0).hour(8), plantTheCorn);
+        timerService.createCalendarTimer(new ScheduleExpression().month(6).dayOfMonth("1-10").minute(0).hour(8), plantTheCorn);
+
+        final TimerConfig harvestTheCorn = new TimerConfig("harvestTheCorn", false);
+        timerService.createCalendarTimer(new ScheduleExpression().month(9).dayOfMonth("20-Last").minute(0).hour(8), harvestTheCorn);
+        timerService.createCalendarTimer(new ScheduleExpression().month(10).dayOfMonth("1-10").minute(0).hour(8), harvestTheCorn);
+
+        final TimerConfig checkOnTheDaughters = new TimerConfig("checkOnTheDaughters", false);
+        timerService.createCalendarTimer(new ScheduleExpression().second("*").minute("*").hour("*"), checkOnTheDaughters);
+    }
+
+    @Timeout
+    public void timeout(Timer timer) {
+        if ("plantTheCorn".equals(timer.getInfo())) {
+            plantTheCorn();
+        } else if ("harvestTheCorn".equals(timer.getInfo())) {
+            harvestTheCorn();
+        } else if ("checkOnTheDaughters".equals(timer.getInfo())) {
+            checkOnTheDaughters();
+        }
+    }
+
+    private void plantTheCorn() {
+        // Dig out the planter!!!
+    }
+
+    private void harvestTheCorn() {
+        // Dig out the combine!!!
+    }
+
+    private void checkOnTheDaughters() {
+        checks.incrementAndGet();
+    }
+
+    public int getChecks() {
+        return checks.get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-expression/src/test/java/org/superbiz/corn/FarmerBrownTest.java
----------------------------------------------------------------------
diff --git a/examples/schedule-expression/src/test/java/org/superbiz/corn/FarmerBrownTest.java b/examples/schedule-expression/src/test/java/org/superbiz/corn/FarmerBrownTest.java
index 9b008c5..9aef7a6 100644
--- a/examples/schedule-expression/src/test/java/org/superbiz/corn/FarmerBrownTest.java
+++ b/examples/schedule-expression/src/test/java/org/superbiz/corn/FarmerBrownTest.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-
-/**
- * @version $Revision$ $Date$
- */
-public class FarmerBrownTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-expression/FarmerBrown");
-
-        // Give Farmer brown a chance to do some work
-        Thread.sleep(SECONDS.toMillis(5));
-
-        final int checks = farmerBrown.getChecks();
-        assertTrue(checks + "", checks > 4);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class FarmerBrownTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-expression/FarmerBrown");
+
+        // Give Farmer brown a chance to do some work
+        Thread.sleep(SECONDS.toMillis(5));
+
+        final int checks = farmerBrown.getChecks();
+        assertTrue(checks + "", checks > 4);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
index d9c4016..c7e4708 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta;
-
-import org.superbiz.corn.meta.api.HarvestTime;
-import org.superbiz.corn.meta.api.Organic;
-import org.superbiz.corn.meta.api.PlantingTime;
-import org.superbiz.corn.meta.api.Secondly;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * This is where we schedule all of Farmer Brown's corn jobs
- *
- * @version $Revision$ $Date$
- */
-@Organic
-public class FarmerBrown {
-
-    private final AtomicInteger checks = new AtomicInteger();
-
-    @PlantingTime
-    private void plantTheCorn() {
-        // Dig out the planter!!!
-    }
-
-    @HarvestTime
-    private void harvestTheCorn() {
-        // Dig out the combine!!!
-    }
-
-    @Secondly
-    private void checkOnTheDaughters() {
-        checks.incrementAndGet();
-    }
-
-    public int getChecks() {
-        return checks.get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta;
+
+import org.superbiz.corn.meta.api.HarvestTime;
+import org.superbiz.corn.meta.api.Organic;
+import org.superbiz.corn.meta.api.PlantingTime;
+import org.superbiz.corn.meta.api.Secondly;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * This is where we schedule all of Farmer Brown's corn jobs
+ *
+ * @version $Revision$ $Date$
+ */
+@Organic
+public class FarmerBrown {
+
+    private final AtomicInteger checks = new AtomicInteger();
+
+    @PlantingTime
+    private void plantTheCorn() {
+        // Dig out the planter!!!
+    }
+
+    @HarvestTime
+    private void harvestTheCorn() {
+        // Dig out the combine!!!
+    }
+
+    @Secondly
+    private void checkOnTheDaughters() {
+        checks.incrementAndGet();
+    }
+
+    public int getChecks() {
+        return checks.get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
index e2cfd4b..ab48c17 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface BiAnnually {
-
-    public static interface $ {
-
-        @BiAnnually
-        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1", month = "1,6")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface BiAnnually {
+
+    public static interface $ {
+
+        @BiAnnually
+        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1", month = "1,6")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
index 9241b29..918d158 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface BiMonthly {
-
-    public static interface $ {
-
-        @BiMonthly
-        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1,15")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface BiMonthly {
+
+    public static interface $ {
+
+        @BiMonthly
+        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1,15")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
index f4747c3..b793646 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface Daily {
-
-    public static interface $ {
-
-        @Daily
-        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "*")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Daily {
+
+    public static interface $ {
+
+        @Daily
+        @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "*")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
index 9b513d6..51029cb 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import javax.ejb.Schedules;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface HarvestTime {
-
-    public static interface $ {
-
-        @HarvestTime
-        @Schedules({
-                       @Schedule(month = "9", dayOfMonth = "20-Last", minute = "0", hour = "8"),
-                       @Schedule(month = "10", dayOfMonth = "1-10", minute = "0", hour = "8")
-                   })
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface HarvestTime {
+
+    public static interface $ {
+
+        @HarvestTime
+        @Schedules({
+                @Schedule(month = "9", dayOfMonth = "20-Last", minute = "0", hour = "8"),
+                @Schedule(month = "10", dayOfMonth = "1-10", minute = "0", hour = "8")
+        })
+        public void method();
+    }
 }
\ No newline at end of file


[24/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSourceProvider.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSourceProvider.java b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSourceProvider.java
index e9f42bb..4fd042c 100644
--- a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSourceProvider.java
+++ b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSourceProvider.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.config;
-
-import org.apache.deltaspike.core.spi.config.ConfigSource;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class MyConfigSourceProvider implements ConfigSourceProvider {
-    @Override
-    public List<ConfigSource> getConfigSources() {
-        return Arrays.asList((ConfigSource) new MyConfigSource());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.config;
+
+import org.apache.deltaspike.core.spi.config.ConfigSource;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class MyConfigSourceProvider implements ConfigSourceProvider {
+    @Override
+    public List<ConfigSource> getConfigSources() {
+        return Arrays.asList((ConfigSource) new MyConfigSource());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-configproperty/src/test/java/org/superbiz/deltaspike/config/ConfigTest.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-configproperty/src/test/java/org/superbiz/deltaspike/config/ConfigTest.java b/examples/deltaspike-configproperty/src/test/java/org/superbiz/deltaspike/config/ConfigTest.java
index f6547d0..49aff53 100644
--- a/examples/deltaspike-configproperty/src/test/java/org/superbiz/deltaspike/config/ConfigTest.java
+++ b/examples/deltaspike-configproperty/src/test/java/org/superbiz/deltaspike/config/ConfigTest.java
@@ -1,59 +1,59 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.config;
-
-import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-import org.apache.openjpa.lib.conf.MapConfigurationProvider;
-import org.apache.ziplock.JarLocation;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class ConfigTest {
-
-    @Inject
-    private Counter counter;
-
-    @Deployment
-    public static WebArchive jar() {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addClasses(Counter.class, MyConfigSource.class, MapConfigurationProvider.class)
-                         .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
-                         .addAsResource(new ClassLoaderAsset("my-app-config.properties"), "my-app-config.properties")
-                         .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
-                         .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class))
-                         .addAsServiceProvider(ConfigSourceProvider.class, MyConfigSourceProvider.class);
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(counter);
-        counter.loop();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.config;
+
+import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+import org.apache.openjpa.lib.conf.MapConfigurationProvider;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class ConfigTest {
+
+    @Inject
+    private Counter counter;
+
+    @Deployment
+    public static WebArchive jar() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClasses(Counter.class, MyConfigSource.class, MapConfigurationProvider.class)
+                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
+                .addAsResource(new ClassLoaderAsset("my-app-config.properties"), "my-app-config.properties")
+                .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
+                .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class))
+                .addAsServiceProvider(ConfigSourceProvider.class, MyConfigSourceProvider.class);
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(counter);
+        counter.loop();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
index 58b0027..81be407 100644
--- a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
+++ b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSExceptionHandler.java
@@ -1,34 +1,34 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.exceptionhandling;
-
-import org.apache.deltaspike.core.api.exception.control.ExceptionHandler;
-import org.apache.deltaspike.core.api.exception.control.Handles;
-import org.apache.deltaspike.core.api.exception.control.event.ExceptionEvent;
-
-import java.util.logging.Logger;
-
-@ExceptionHandler
-public class OSExceptionHandler {
-
-    private static final Logger LOGGER = Logger.getLogger(OSExceptionHandler.class.getName());
-
-    public void printExceptions(@Handles final ExceptionEvent<OSRuntimeException> evt) {
-        LOGGER.severe("==> a bad OS was mentionned");
-        evt.handled();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.exceptionhandling;
+
+import org.apache.deltaspike.core.api.exception.control.ExceptionHandler;
+import org.apache.deltaspike.core.api.exception.control.Handles;
+import org.apache.deltaspike.core.api.exception.control.event.ExceptionEvent;
+
+import java.util.logging.Logger;
+
+@ExceptionHandler
+public class OSExceptionHandler {
+
+    private static final Logger LOGGER = Logger.getLogger(OSExceptionHandler.class.getName());
+
+    public void printExceptions(@Handles final ExceptionEvent<OSRuntimeException> evt) {
+        LOGGER.severe("==> a bad OS was mentionned");
+        evt.handled();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
index c457adb..8973c06 100644
--- a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
+++ b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSRuntimeException.java
@@ -1,21 +1,21 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.exceptionhandling;
-
-public class OSRuntimeException extends RuntimeException {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.exceptionhandling;
+
+public class OSRuntimeException extends RuntimeException {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
index 0334c75..d123e96 100644
--- a/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
+++ b/examples/deltaspike-exception-handling/src/main/java/org/superbiz/deltaspike/exceptionhandling/OSValidator.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.exceptionhandling;
-
-import org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent;
-
-import javax.enterprise.event.Event;
-import javax.inject.Inject;
-
-public class OSValidator {
-
-    @Inject
-    private Event<ExceptionToCatchEvent> exceptionEvent;
-
-    public void validOS(final String os) {
-        if (os.toLowerCase().contains("win")) {
-            final Exception ex = new OSRuntimeException(); // can be a caugh exceptino
-            exceptionEvent.fire(new ExceptionToCatchEvent(ex));
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.exceptionhandling;
+
+import org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+public class OSValidator {
+
+    @Inject
+    private Event<ExceptionToCatchEvent> exceptionEvent;
+
+    public void validOS(final String os) {
+        if (os.toLowerCase().contains("win")) {
+            final Exception ex = new OSRuntimeException(); // can be a caugh exceptino
+            exceptionEvent.fire(new ExceptionToCatchEvent(ex));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java b/examples/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
index 7512a38..f585324 100644
--- a/examples/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
+++ b/examples/deltaspike-exception-handling/src/test/java/org/superbiz/deltaspike/exceptionhandling/ExceptionHandlingDemoTest.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.exceptionhandling;
-
-import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-import org.apache.ziplock.JarLocation;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class ExceptionHandlingDemoTest {
-
-    @Inject
-    private OSValidator validator;
-
-    @Deployment
-    public static WebArchive jar() {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addPackage(OSValidator.class.getPackage())
-                   .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
-                        // DeltaSpike libs (api and impl)
-                   .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
-                   .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class));
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(validator);
-        validator.validOS("Linux");
-        validator.validOS("windows"); // should throw a handled exception
-        validator.validOS("Mac OS");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.exceptionhandling;
+
+import org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class ExceptionHandlingDemoTest {
+
+    @Inject
+    private OSValidator validator;
+
+    @Deployment
+    public static WebArchive jar() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addPackage(OSValidator.class.getPackage())
+                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
+                        // DeltaSpike libs (api and impl)
+                .addAsLibraries(JarLocation.jarLocation(ConfigSourceProvider.class))
+                .addAsLibraries(JarLocation.jarLocation(DefaultConfigSourceProvider.class));
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(validator);
+        validator.validOS("Linux");
+        validator.validOS("windows"); // should throw a handled exception
+        validator.validOS("Mac OS");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/pom.xml
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/pom.xml b/examples/deltaspike-fullstack/pom.xml
index 0fd41cf..4cf0d0a 100644
--- a/examples/deltaspike-fullstack/pom.xml
+++ b/examples/deltaspike-fullstack/pom.xml
@@ -15,7 +15,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>deltaspike-fullstack</artifactId>
   <name>OpenEJB :: Examples :: JSF2/CDI/BV/JPA/DeltaSpike</name>
-  <version>1.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
 
   <packaging>war</packaging>
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
index 042507e..47a6b99 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
@@ -1,32 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.apache.deltaspike.core.api.projectstage.ProjectStageHolder;
-
-public class CustomProjectStage implements ProjectStageHolder
-{
-    public static final class Debugging extends ProjectStage
-    {
-        private static final long serialVersionUID = -8626602281649294170L;
-    }
-
-    public static final Debugging Debugging = new Debugging();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.api.projectstage.ProjectStageHolder;
+
+public class CustomProjectStage implements ProjectStageHolder {
+    public static final class Debugging extends ProjectStage {
+        private static final long serialVersionUID = -8626602281649294170L;
+    }
+
+    public static final Debugging Debugging = new Debugging();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
index d8c77c8..f17699e 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
@@ -1,53 +1,49 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike;
-
-import org.apache.deltaspike.core.api.exclude.Exclude;
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.apache.deltaspike.jsf.api.listener.phase.JsfPhaseListener;
-
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-import java.util.logging.Logger;
-
-@Exclude(exceptIfProjectStage = {ProjectStage.Development.class, CustomProjectStage.Debugging.class})
-
-@JsfPhaseListener
-public class DebugPhaseListener implements PhaseListener
-{
-    private static final long serialVersionUID = 5899542118538949019L;
-
-    private Logger logger = Logger.getLogger(Logger.class.getName());
-
-    public void beforePhase(PhaseEvent phaseEvent)
-    {
-        this.logger.info("before " + phaseEvent.getPhaseId());
-    }
-
-    public void afterPhase(PhaseEvent phaseEvent)
-    {
-        this.logger.info("after " + phaseEvent.getPhaseId());
-    }
-
-    public PhaseId getPhaseId()
-    {
-        return PhaseId.ANY_PHASE;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.jsf.api.listener.phase.JsfPhaseListener;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import java.util.logging.Logger;
+
+@Exclude(exceptIfProjectStage = {ProjectStage.Development.class, CustomProjectStage.Debugging.class})
+
+@JsfPhaseListener
+public class DebugPhaseListener implements PhaseListener {
+    private static final long serialVersionUID = 5899542118538949019L;
+
+    private Logger logger = Logger.getLogger(Logger.class.getName());
+
+    public void beforePhase(PhaseEvent phaseEvent) {
+        this.logger.info("before " + phaseEvent.getPhaseId());
+    }
+
+    public void afterPhase(PhaseEvent phaseEvent) {
+        this.logger.info("after " + phaseEvent.getPhaseId());
+    }
+
+    public PhaseId getPhaseId() {
+        return PhaseId.ANY_PHASE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
index bbe7482..6cff477 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
@@ -1,39 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike;
-
-import org.apache.deltaspike.core.api.message.MessageBundle;
-import org.apache.deltaspike.core.api.message.MessageContextConfig;
-
-@MessageBundle
-@MessageContextConfig(messageSource = "org.superbiz.deltaspike.i18n.messages")
-public interface WebappMessageBundle
-{
-    String msgAccessDenied();
-
-    String msgUserRegistered(String userName);
-
-    String msgLoginSuccessful();
-
-    String msgLoginFailed();
-
-    String msgError(String message);
-
-    String msgWelcome();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.message.MessageBundle;
+import org.apache.deltaspike.core.api.message.MessageContextConfig;
+
+@MessageBundle
+@MessageContextConfig(messageSource = "org.superbiz.deltaspike.i18n.messages")
+public interface WebappMessageBundle {
+    String msgAccessDenied();
+
+    String msgUserRegistered(String userName);
+
+    String msgLoginSuccessful();
+
+    String msgLoginFailed();
+
+    String msgError(String message);
+
+    String msgWelcome();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
index 32ffdeb..7ab899f 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-@MappedSuperclass
-public abstract class AbstractDomainObject implements Serializable
-{
-    @Id
-    @GeneratedValue
-    private Long id;
-
-    @Version
-    private Long version;
-
-    public boolean isTransient()
-    {
-        return this.version == null;
-    }
-
-    public Long getId()
-    {
-        return id;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.Version;
+import java.io.Serializable;
+
+@MappedSuperclass
+public abstract class AbstractDomainObject implements Serializable {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Version
+    private Long version;
+
+    public boolean isTransient() {
+        return this.version == null;
+    }
+
+    public Long getId() {
+        return id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
index 5d0f793..798b374 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
@@ -1,58 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class Comment extends AbstractDomainObject
-{
-    private static final long serialVersionUID = -5718296682587279635L;
-
-    @Column(length = 2048)
-    private String description;
-
-    @ManyToOne(optional = false)
-    private Feedback feedback;
-
-    void setFeedback(Feedback feedback)
-    {
-        this.feedback = feedback;
-    }
-
-    /*
-     * generated
-     */
-
-    public Comment()
-    {
-    }
-
-    public String getDescription()
-    {
-        return description;
-    }
-
-    public void setDescription(String description)
-    {
-        this.description = description;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class Comment extends AbstractDomainObject {
+    private static final long serialVersionUID = -5718296682587279635L;
+
+    @Column(length = 2048)
+    private String description;
+
+    @ManyToOne(optional = false)
+    private Feedback feedback;
+
+    void setFeedback(Feedback feedback) {
+        this.feedback = feedback;
+    }
+
+    /*
+     * generated
+     */
+
+    public Comment() {
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
index dde622a..b837dfd 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
@@ -1,76 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-import java.util.ArrayList;
-import java.util.List;
-
-@Entity
-public class Feedback extends AbstractDomainObject
-{
-    private static final long serialVersionUID = -431924785266663236L;
-
-    @Column(nullable = false, length = 32)
-    private String topic;
-
-    @Column(length = 128)
-    private String description;
-
-    @OneToMany(mappedBy = "feedback", cascade = CascadeType.ALL)
-    private List<Comment> comments = new ArrayList<Comment>();
-
-    public void addComment(Comment comment)
-    {
-        comment.setFeedback(this);
-        this.comments.add(comment);
-    }
-
-    /*
-     * generated
-     */
-
-    public List<Comment> getComments()
-    {
-        return comments;
-    }
-
-    public String getTopic()
-    {
-        return topic;
-    }
-
-    public String getDescription()
-    {
-        return description;
-    }
-
-    public void setTopic(String topic)
-    {
-        this.topic = topic;
-    }
-
-    public void setDescription(String description)
-    {
-        this.description = description;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+public class Feedback extends AbstractDomainObject {
+    private static final long serialVersionUID = -431924785266663236L;
+
+    @Column(nullable = false, length = 32)
+    private String topic;
+
+    @Column(length = 128)
+    private String description;
+
+    @OneToMany(mappedBy = "feedback", cascade = CascadeType.ALL)
+    private List<Comment> comments = new ArrayList<Comment>();
+
+    public void addComment(Comment comment) {
+        comment.setFeedback(this);
+        this.comments.add(comment);
+    }
+
+    /*
+     * generated
+     */
+
+    public List<Comment> getComments() {
+        return comments;
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setTopic(String topic) {
+        this.topic = topic;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
index fb44f89..d050b53 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
@@ -1,110 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain;
-
-import org.superbiz.deltaspike.domain.validation.*;
-
-import javax.enterprise.inject.Typed;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.NamedQuery;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-@Table(name = "T_User")
-@Entity
-@NamedQuery(name = "findUserByName", query = "select u from User u where u.userName = :currentUser")
-@DifferentName(groups = Partial.class)
-@Typed()
-public class User extends AbstractDomainObject
-{
-    private static final long serialVersionUID = 3810638653455000233L;
-
-    @UserName(groups = UniqueUserName.class)
-    @Column(nullable = false, length = 9, unique = true)
-    private String userName;
-
-    @Size(min = 2, max = 20, message = "invalid first name")
-    @NotNull
-    @Column
-    private String firstName;
-
-    @Column
-    @Name(message = "invalid last name")
-    private String lastName;
-
-    @Column
-    private String password;
-
-    /*
-     * generated
-     */
-
-    public User()
-    {
-    }
-
-    public User(String userName, String firstName, String lastName)
-    {
-        this.userName = userName;
-        this.firstName = firstName;
-        this.lastName = lastName;
-    }
-
-    public String getUserName()
-    {
-        return userName;
-    }
-
-    public void setUserName(String userName)
-    {
-        this.userName = userName;
-    }
-
-    public String getFirstName()
-    {
-        return firstName;
-    }
-
-    public void setFirstName(String firstName)
-    {
-        this.firstName = firstName;
-    }
-
-    public String getLastName()
-    {
-        return lastName;
-    }
-
-    public void setLastName(String lastName)
-    {
-        this.lastName = lastName;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import org.superbiz.deltaspike.domain.validation.DifferentName;
+import org.superbiz.deltaspike.domain.validation.Name;
+import org.superbiz.deltaspike.domain.validation.Partial;
+import org.superbiz.deltaspike.domain.validation.UniqueUserName;
+import org.superbiz.deltaspike.domain.validation.UserName;
+
+import javax.enterprise.inject.Typed;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+@Table(name = "T_User")
+@Entity
+@NamedQuery(name = "findUserByName", query = "select u from User u where u.userName = :currentUser")
+@DifferentName(groups = Partial.class)
+@Typed()
+public class User extends AbstractDomainObject {
+    private static final long serialVersionUID = 3810638653455000233L;
+
+    @UserName(groups = UniqueUserName.class)
+    @Column(nullable = false, length = 9, unique = true)
+    private String userName;
+
+    @Size(min = 2, max = 20, message = "invalid first name")
+    @NotNull
+    @Column
+    private String firstName;
+
+    @Column
+    @Name(message = "invalid last name")
+    private String lastName;
+
+    @Column
+    private String password;
+
+    /*
+     * generated
+     */
+
+    public User() {
+    }
+
+    public User(String userName, String firstName, String lastName) {
+        this.userName = userName;
+        this.firstName = firstName;
+        this.lastName = lastName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
index ccdc1fa..ff5d3d3 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
@@ -1,39 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Constraint(validatedBy = DifferentNameValidator.class)
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface DifferentName
-{
-    String message() default "invalid name";
-
-    Class<?>[] groups() default {};
-
-    Class<? extends Payload>[] payload() default {};
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Constraint(validatedBy = DifferentNameValidator.class)
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface DifferentName {
+    String message() default "invalid name";
+
+    Class<?>[] groups() default {};
+
+    Class<? extends Payload>[] payload() default {};
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
index f893f35..737186b 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
@@ -1,36 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-import org.superbiz.deltaspike.domain.User;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-public class DifferentNameValidator implements ConstraintValidator<DifferentName, User>
-{
-    public void initialize(DifferentName differentName)
-    {
-    }
-
-    public boolean isValid(User person, ConstraintValidatorContext constraintValidatorContext)
-    {
-        return person == null || !(person.getFirstName() != null && person.getFirstName().equals(person.getLastName()));
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import org.superbiz.deltaspike.domain.User;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class DifferentNameValidator implements ConstraintValidator<DifferentName, User> {
+    public void initialize(DifferentName differentName) {
+    }
+
+    public boolean isValid(User person, ConstraintValidatorContext constraintValidatorContext) {
+        return person == null || !(person.getFirstName() != null && person.getFirstName().equals(person.getLastName()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
index 4fcb0cf..cfa4b11 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
@@ -1,27 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-import javax.validation.GroupSequence;
-import javax.validation.groups.Default;
-
-@GroupSequence({Default.class, UniqueUserName.class})
-public interface Full
-{
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.GroupSequence;
+import javax.validation.groups.Default;
+
+@GroupSequence({Default.class, UniqueUserName.class})
+public interface Full {
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
index 037c224..fb96554 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
@@ -1,49 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import javax.validation.ReportAsSingleViolation;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Size(min = 2, max = 20)
-@NotNull
-
-@Constraint(validatedBy = {})
-@ReportAsSingleViolation
-
-@Target({METHOD, FIELD, ANNOTATION_TYPE})
-@Retention(RUNTIME)
-public @interface Name
-{
-    public abstract String message() default "invalid name";
-
-    public abstract Class<?>[] groups() default {};
-
-    public abstract Class<? extends Payload>[] payload() default {};
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import javax.validation.ReportAsSingleViolation;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Size(min = 2, max = 20)
+@NotNull
+
+@Constraint(validatedBy = {})
+@ReportAsSingleViolation
+
+@Target({METHOD, FIELD, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+public @interface Name {
+    public abstract String message() default "invalid name";
+
+    public abstract Class<?>[] groups() default {};
+
+    public abstract Class<? extends Payload>[] payload() default {};
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
index 68962b9..8edfa5a 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
@@ -1,23 +1,22 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-public interface Partial
-{
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+public interface Partial {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
index 4416054..6e2b4b0 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
@@ -1,23 +1,22 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-public interface UniqueUserName
-{
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+public interface UniqueUserName {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
index 3a85e2f..80f4c85 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
@@ -1,45 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.domain.validation;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import javax.validation.groups.Default;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@NotNull(groups = Default.class)
-@Size(min = 2, max = 9, message = "invalid name", groups = Default.class)
-
-@Constraint(validatedBy = UniqueUserNameValidator.class)
-@Target(FIELD)
-@Retention(RUNTIME)
-public @interface UserName
-{
-    String message() default "user-name exists already";
-
-    Class<?>[] groups() default {};
-
-    Class<? extends Payload>[] payload() default {};
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.validation.groups.Default;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@NotNull(groups = Default.class)
+@Size(min = 2, max = 9, message = "invalid name", groups = Default.class)
+
+@Constraint(validatedBy = UniqueUserNameValidator.class)
+@Target(FIELD)
+@Retention(RUNTIME)
+public @interface UserName {
+    String message() default "user-name exists already";
+
+    Class<?>[] groups() default {};
+
+    Class<? extends Payload>[] payload() default {};
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
index a3636d7..9af7889 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
@@ -1,41 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.startup;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-@Singleton
-@Startup
-public class ModuleStartupObserver
-{
-    private Logger logger = Logger.getLogger(ModuleStartupObserver.class.getName());
-
-    @PostConstruct
-    public void logStartup()
-    {
-        if (logger.isLoggable(Level.INFO))
-        {
-            logger.info("starting application module");
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.startup;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+@Singleton
+@Startup
+public class ModuleStartupObserver {
+    private Logger logger = Logger.getLogger(ModuleStartupObserver.class.getName());
+
+    @PostConstruct
+    public void logStartup() {
+        if (logger.isLoggable(Level.INFO)) {
+            logger.info("starting application module");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
index 747c7fe..69b32e4 100644
--- a/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
+++ b/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
@@ -1,80 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.view;
-
-import org.apache.deltaspike.core.api.config.view.controller.PreRenderView;
-import org.apache.deltaspike.core.api.scope.GroupedConversation;
-import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;
-import org.superbiz.deltaspike.domain.Feedback;
-import org.superbiz.deltaspike.repository.FeedbackRepository;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.Serializable;
-import java.util.List;
-
-@Named
-@GroupedConversationScoped
-public class FeedbackPage implements Serializable
-{
-    private static final long serialVersionUID = 744025508253889974L;
-
-    private List<Feedback> feedbackList;
-
-    @Inject
-    private GroupedConversation conversation;
-
-    @Inject
-    private FeedbackRepository feedbackRepository;
-
-    private Feedback feedback;
-
-    @PostConstruct
-    protected void init()
-    {
-        this.feedback = new Feedback();
-    }
-
-    @PreRenderView
-    public void reloadFeedbackList()
-    {
-        this.feedbackList = this.feedbackRepository.findAll();
-    }
-
-    public void save()
-    {
-        this.feedbackRepository.save(this.feedback);
-        this.conversation.close();
-    }
-
-    /*
-     * generated
-     */
-
-    public List<Feedback> getFeedbackList()
-    {
-        return feedbackList;
-    }
-
-    public Feedback getFeedback()
-    {
-        return feedback;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.config.view.controller.PreRenderView;
+import org.apache.deltaspike.core.api.scope.GroupedConversation;
+import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;
+import org.superbiz.deltaspike.domain.Feedback;
+import org.superbiz.deltaspike.repository.FeedbackRepository;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+import java.util.List;
+
+@Named
+@GroupedConversationScoped
+public class FeedbackPage implements Serializable {
+    private static final long serialVersionUID = 744025508253889974L;
+
+    private List<Feedback> feedbackList;
+
+    @Inject
+    private GroupedConversation conversation;
+
+    @Inject
+    private FeedbackRepository feedbackRepository;
+
+    private Feedback feedback;
+
+    @PostConstruct
+    protected void init() {
+        this.feedback = new Feedback();
+    }
+
+    @PreRenderView
+    public void reloadFeedbackList() {
+        this.feedbackList = this.feedbackRepository.findAll();
+    }
+
+    public void save() {
+        this.feedbackRepository.save(this.feedback);
+        this.conversation.close();
+    }
+
+    /*
+     * generated
+     */
+
+    public List<Feedback> getFeedbackList() {
+        return feedbackList;
+    }
+
+    public Feedback getFeedback() {
+        return feedback;
+    }
+}


[03/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/PersonService.java
----------------------------------------------------------------------
diff --git a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/PersonService.java b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/PersonService.java
index 053d732..0568526 100644
--- a/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/PersonService.java
+++ b/examples/tomee-jersey-eclipselink/src/main/java/org/superbiz/service/PersonService.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.service;
-
-import org.superbiz.dao.PersonDAO;
-import org.superbiz.domain.Person;
-
-import javax.enterprise.context.RequestScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import java.util.List;
-
-@Path("/person")
-@RequestScoped
-public class PersonService {
-
-    @Inject
-    private PersonDAO dao;
-
-    public PersonService() {
-        System.out.println();
-    }
-
-    @GET
-    @Path("/create/{name}")
-    public Person create(@PathParam("name") final String name) {
-        return dao.save(name);
-    }
-
-    @GET
-    @Path("/all")
-    public List<Person> list() {
-        return dao.findAll();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.service;
+
+import org.superbiz.dao.PersonDAO;
+import org.superbiz.domain.Person;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import java.util.List;
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+    @Inject
+    private PersonDAO dao;
+
+    public PersonService() {
+        System.out.println();
+    }
+
+    @GET
+    @Path("/create/{name}")
+    public Person create(@PathParam("name") final String name) {
+        return dao.save(name);
+    }
+
+    @GET
+    @Path("/all")
+    public List<Person> list() {
+        return dao.findAll();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/CustomRuntimeException.java
----------------------------------------------------------------------
diff --git a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/CustomRuntimeException.java b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/CustomRuntimeException.java
index 32e5537..6d1b225 100644
--- a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/CustomRuntimeException.java
+++ b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/CustomRuntimeException.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.txrollback;
-
-import javax.ejb.ApplicationException;
-
-@ApplicationException
-public class CustomRuntimeException extends RuntimeException {
-
-    public CustomRuntimeException() {
-    }
-
-    public CustomRuntimeException(String s) {
-        super(s);
-    }
-
-    public CustomRuntimeException(String s, Throwable throwable) {
-        super(s, throwable);
-    }
-
-    public CustomRuntimeException(Throwable throwable) {
-        super(throwable);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.txrollback;
+
+import javax.ejb.ApplicationException;
+
+@ApplicationException
+public class CustomRuntimeException extends RuntimeException {
+
+    public CustomRuntimeException() {
+    }
+
+    public CustomRuntimeException(String s) {
+        super(s);
+    }
+
+    public CustomRuntimeException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public CustomRuntimeException(Throwable throwable) {
+        super(throwable);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movie.java
----------------------------------------------------------------------
diff --git a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movie.java b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movie.java
index 0b98e8a..7ab8166 100644
--- a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movie.java
+++ b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movie.java
@@ -1,68 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.txrollback;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Entity(name = "Movie")
-public class Movie {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.txrollback;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity(name = "Movie")
+public class Movie {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movies.java
----------------------------------------------------------------------
diff --git a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movies.java b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movies.java
index 162e7b8..5ae3b9c 100644
--- a/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movies.java
+++ b/examples/transaction-rollback/src/main/java/org/superbiz/txrollback/Movies.java
@@ -1,62 +1,62 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.txrollback;
-
-import javax.annotation.Resource;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-//START SNIPPET: code
-@Stateless
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    @Resource
-    private SessionContext sessionContext;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-    public void callSetRollbackOnly() {
-        sessionContext.setRollbackOnly();
-    }
-
-    public void throwUncheckedException() {
-        throw new RuntimeException("Throwing unchecked exceptions will rollback a transaction");
-    }
-
-    public void throwApplicationException() {
-        throw new CustomRuntimeException("This is marked @ApplicationException, so no TX rollback");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.txrollback;
+
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+//START SNIPPET: code
+@Stateless
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    @Resource
+    private SessionContext sessionContext;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+    public void callSetRollbackOnly() {
+        sessionContext.setRollbackOnly();
+    }
+
+    public void throwUncheckedException() {
+        throw new RuntimeException("Throwing unchecked exceptions will rollback a transaction");
+    }
+
+    public void throwApplicationException() {
+        throw new CustomRuntimeException("This is marked @ApplicationException, so no TX rollback");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/transaction-rollback/src/test/java/org/superbiz/txrollback/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/transaction-rollback/src/test/java/org/superbiz/txrollback/MoviesTest.java b/examples/transaction-rollback/src/test/java/org/superbiz/txrollback/MoviesTest.java
index 7afbf86..ae2ab5f 100644
--- a/examples/transaction-rollback/src/test/java/org/superbiz/txrollback/MoviesTest.java
+++ b/examples/transaction-rollback/src/test/java/org/superbiz/txrollback/MoviesTest.java
@@ -1,221 +1,221 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.txrollback;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.transaction.RollbackException;
-import javax.transaction.UserTransaction;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    private EJBContainer ejbContainer;
-
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb" + System.currentTimeMillis());
-
-        ejbContainer = EJBContainer.createEJBContainer(p);
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        ejbContainer.close();
-    }
-
-    /**
-     * Standard successful transaction scenario.  The data created inside
-     * the transaction is visible after the transaction completes.
-     * <p/>
-     * Note that UserTransaction is only usable by Bean-Managed Transaction
-     * beans, which can be specified with @TransactionManagement(BEAN)
-     */
-    public void testCommit() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-        } finally {
-            userTransaction.commit();
-        }
-
-        // Transaction was committed
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-    }
-
-    /**
-     * Standard transaction rollback scenario.  The data created inside
-     * the transaction is not visible after the transaction completes.
-     */
-    public void testUserTransactionRollback() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-        } finally {
-            userTransaction.rollback();
-        }
-
-        // Transaction was rolled back
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 0, list.size());
-
-    }
-
-    /**
-     * Transaction is marked for rollback inside the bean via
-     * calling the javax.ejb.SessionContext.setRollbackOnly() method
-     * <p/>
-     * This is the cleanest way to make a transaction rollback.
-     */
-    public void testMarkedRollback() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            movies.callSetRollbackOnly();
-        } finally {
-            try {
-                userTransaction.commit();
-                fail("A RollbackException should have been thrown");
-            } catch (RollbackException e) {
-                // Pass
-            }
-        }
-
-        // Transaction was rolled back
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 0, list.size());
-
-    }
-
-    /**
-     * Throwing an unchecked exception from a bean will cause
-     * the container to call setRollbackOnly() and discard the
-     * bean instance from further use without calling any @PreDestroy
-     * methods on the bean instance.
-     */
-    public void testExceptionBasedRollback() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            try {
-                movies.throwUncheckedException();
-            } catch (RuntimeException e) {
-                // Good, this will cause the tx to rollback
-            }
-        } finally {
-            try {
-                userTransaction.commit();
-                fail("A RollbackException should have been thrown");
-            } catch (RollbackException e) {
-                // Pass
-            }
-        }
-
-        // Transaction was rolled back
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 0, list.size());
-
-    }
-
-    /**
-     * It is still possible to throw unchecked (runtime) exceptions
-     * without dooming the transaction by marking the exception
-     * with the @ApplicationException annotation or in the ejb-jar.xml
-     * deployment descriptor via the <application-exception> tag
-     */
-    public void testCommit2() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            try {
-                movies.throwApplicationException();
-            } catch (RuntimeException e) {
-                // This will *not* cause the tx to rollback
-                // because it is marked as an @ApplicationException
-            }
-        } finally {
-            userTransaction.commit();
-        }
-
-        // Transaction was committed
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.txrollback;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.RollbackException;
+import javax.transaction.UserTransaction;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    private EJBContainer ejbContainer;
+
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb" + System.currentTimeMillis());
+
+        ejbContainer = EJBContainer.createEJBContainer(p);
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        ejbContainer.close();
+    }
+
+    /**
+     * Standard successful transaction scenario.  The data created inside
+     * the transaction is visible after the transaction completes.
+     * <p/>
+     * Note that UserTransaction is only usable by Bean-Managed Transaction
+     * beans, which can be specified with @TransactionManagement(BEAN)
+     */
+    public void testCommit() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+        } finally {
+            userTransaction.commit();
+        }
+
+        // Transaction was committed
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+    }
+
+    /**
+     * Standard transaction rollback scenario.  The data created inside
+     * the transaction is not visible after the transaction completes.
+     */
+    public void testUserTransactionRollback() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+        } finally {
+            userTransaction.rollback();
+        }
+
+        // Transaction was rolled back
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 0, list.size());
+
+    }
+
+    /**
+     * Transaction is marked for rollback inside the bean via
+     * calling the javax.ejb.SessionContext.setRollbackOnly() method
+     * <p/>
+     * This is the cleanest way to make a transaction rollback.
+     */
+    public void testMarkedRollback() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            movies.callSetRollbackOnly();
+        } finally {
+            try {
+                userTransaction.commit();
+                fail("A RollbackException should have been thrown");
+            } catch (RollbackException e) {
+                // Pass
+            }
+        }
+
+        // Transaction was rolled back
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 0, list.size());
+
+    }
+
+    /**
+     * Throwing an unchecked exception from a bean will cause
+     * the container to call setRollbackOnly() and discard the
+     * bean instance from further use without calling any @PreDestroy
+     * methods on the bean instance.
+     */
+    public void testExceptionBasedRollback() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            try {
+                movies.throwUncheckedException();
+            } catch (RuntimeException e) {
+                // Good, this will cause the tx to rollback
+            }
+        } finally {
+            try {
+                userTransaction.commit();
+                fail("A RollbackException should have been thrown");
+            } catch (RollbackException e) {
+                // Pass
+            }
+        }
+
+        // Transaction was rolled back
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 0, list.size());
+
+    }
+
+    /**
+     * It is still possible to throw unchecked (runtime) exceptions
+     * without dooming the transaction by marking the exception
+     * with the @ApplicationException annotation or in the ejb-jar.xml
+     * deployment descriptor via the <application-exception> tag
+     */
+    public void testCommit2() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            try {
+                movies.throwApplicationException();
+            } catch (RuntimeException e) {
+                // This will *not* cause the tx to rollback
+                // because it is marked as an @ApplicationException
+            }
+        } finally {
+            userTransaction.commit();
+        }
+
+        // Transaction was committed
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movie.java
----------------------------------------------------------------------
diff --git a/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movie.java b/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movie.java
index 5d350f1..1ce3dce 100644
--- a/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movie.java
+++ b/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movie.java
@@ -1,68 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.troubleshooting;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Entity(name = "Movie")
-public class Movie {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.troubleshooting;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity(name = "Movie")
+public class Movie {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movies.java
----------------------------------------------------------------------
diff --git a/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movies.java b/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movies.java
index 8b5c6c5..bd45cba 100644
--- a/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movies.java
+++ b/examples/troubleshooting/src/main/java/org/superbiz/troubleshooting/Movies.java
@@ -1,46 +1,46 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.troubleshooting;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-//START SNIPPET: code
-@Stateless
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.troubleshooting;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+//START SNIPPET: code
+@Stateless
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/troubleshooting/src/test/java/org/superbiz/troubleshooting/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/troubleshooting/src/test/java/org/superbiz/troubleshooting/MoviesTest.java b/examples/troubleshooting/src/test/java/org/superbiz/troubleshooting/MoviesTest.java
index 2aa8997..94b8bef 100644
--- a/examples/troubleshooting/src/test/java/org/superbiz/troubleshooting/MoviesTest.java
+++ b/examples/troubleshooting/src/test/java/org/superbiz/troubleshooting/MoviesTest.java
@@ -1,101 +1,101 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.troubleshooting;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.transaction.UserTransaction;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-
-        // These two debug levels will get you the basic log information
-        // on the deployment of applications. Good first step in troubleshooting.
-        p.put("log4j.category.OpenEJB.startup", "debug");
-        p.put("log4j.category.OpenEJB.startup.config", "debug");
-
-        // This log category is a good way to see what "openejb.foo" options
-        // and flags are available and what their default values are
-        p.put("log4j.category.OpenEJB.options", "debug");
-
-        // This will output the full configuration of all containers
-        // resources and other openejb.xml configurable items.  A good
-        // way to see what the final configuration looks like after all
-        // overriding has been applied.
-        p.put("log4j.category.OpenEJB.startup.service", "debug");
-
-        // Will output a generated ejb-jar.xml file that represents
-        // 100% of the annotations used in the code.  This is a great
-        // way to figure out how to do something in xml for overriding
-        // or just to "see" all your application meta-data in one place.
-        // Look for log lines like this "Dumping Generated ejb-jar.xml to"
-        p.put("openejb.descriptors.output", "true");
-
-        // Setting the validation output level to verbose results in
-        // validation messages that attempt to provide explanations
-        // and information on what steps can be taken to remedy failures.
-        // A great tool for those learning EJB.
-        p.put("openejb.validation.output.level", "verbose");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    public void test() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-        } finally {
-            userTransaction.commit();
-        }
-
-        // Transaction was committed
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.troubleshooting;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.UserTransaction;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+
+        // These two debug levels will get you the basic log information
+        // on the deployment of applications. Good first step in troubleshooting.
+        p.put("log4j.category.OpenEJB.startup", "debug");
+        p.put("log4j.category.OpenEJB.startup.config", "debug");
+
+        // This log category is a good way to see what "openejb.foo" options
+        // and flags are available and what their default values are
+        p.put("log4j.category.OpenEJB.options", "debug");
+
+        // This will output the full configuration of all containers
+        // resources and other openejb.xml configurable items.  A good
+        // way to see what the final configuration looks like after all
+        // overriding has been applied.
+        p.put("log4j.category.OpenEJB.startup.service", "debug");
+
+        // Will output a generated ejb-jar.xml file that represents
+        // 100% of the annotations used in the code.  This is a great
+        // way to figure out how to do something in xml for overriding
+        // or just to "see" all your application meta-data in one place.
+        // Look for log lines like this "Dumping Generated ejb-jar.xml to"
+        p.put("openejb.descriptors.output", "true");
+
+        // Setting the validation output level to verbose results in
+        // validation messages that attempt to provide explanations
+        // and information on what steps can be taken to remedy failures.
+        // A great tool for those learning EJB.
+        p.put("openejb.validation.output.level", "verbose");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    public void test() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+        } finally {
+            userTransaction.commit();
+        }
+
+        // Transaction was committed
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentImpl.java
----------------------------------------------------------------------
diff --git a/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentImpl.java b/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentImpl.java
index 18f304d..9118985 100644
--- a/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentImpl.java
+++ b/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentImpl.java
@@ -1,79 +1,79 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.attachment;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * This is an EJB 3 style pojo stateless session bean
- * Every stateless session bean implementation must be annotated
- * using the annotation @Stateless
- * This EJB has a single interface: {@link AttachmentWs} a webservice interface.
- */
-@Stateless
-@WebService(
-               portName = "AttachmentPort",
-               serviceName = "AttachmentWsService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.attachment.AttachmentWs")
-@BindingType(value = SOAPBinding.SOAP12HTTP_MTOM_BINDING)
-public class AttachmentImpl implements AttachmentWs {
-
-    public String stringFromBytes(byte[] data) {
-        return new String(data);
-
-    }
-
-    public String stringFromDataSource(DataSource source) {
-
-        try {
-            InputStream inStr = source.getInputStream();
-            int size = inStr.available();
-            byte[] data = new byte[size];
-            inStr.read(data);
-            inStr.close();
-            return new String(data);
-
-        } catch (IOException e) {
-            e.printStackTrace();
-
-        }
-        return "";
-
-    }
-
-    public String stringFromDataHandler(DataHandler handler) {
-
-        try {
-            return (String) handler.getContent();
-
-        } catch (IOException e) {
-            e.printStackTrace();
-
-        }
-        return "";
-
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.attachment;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * This is an EJB 3 style pojo stateless session bean
+ * Every stateless session bean implementation must be annotated
+ * using the annotation @Stateless
+ * This EJB has a single interface: {@link AttachmentWs} a webservice interface.
+ */
+@Stateless
+@WebService(
+        portName = "AttachmentPort",
+        serviceName = "AttachmentWsService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.attachment.AttachmentWs")
+@BindingType(value = SOAPBinding.SOAP12HTTP_MTOM_BINDING)
+public class AttachmentImpl implements AttachmentWs {
+
+    public String stringFromBytes(byte[] data) {
+        return new String(data);
+
+    }
+
+    public String stringFromDataSource(DataSource source) {
+
+        try {
+            InputStream inStr = source.getInputStream();
+            int size = inStr.available();
+            byte[] data = new byte[size];
+            inStr.read(data);
+            inStr.close();
+            return new String(data);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+
+        }
+        return "";
+
+    }
+
+    public String stringFromDataHandler(DataHandler handler) {
+
+        try {
+            return (String) handler.getContent();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+
+        }
+        return "";
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentWs.java b/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentWs.java
index 164f374..b029497 100644
--- a/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentWs.java
+++ b/examples/webservice-attachments/src/main/java/org/superbiz/attachment/AttachmentWs.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.attachment;
-
-import javax.activation.DataHandler;
-import javax.jws.WebService;
-
-/**
- * This is an EJB 3 webservice interface to send attachments throughout SAOP.
- */
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface AttachmentWs {
-
-    public String stringFromBytes(byte[] data);
-
-    // Not working at the moment with SUN saaj provider and CXF
-    //public String stringFromDataSource(DataSource source);
-
-    public String stringFromDataHandler(DataHandler handler);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.attachment;
+
+import javax.activation.DataHandler;
+import javax.jws.WebService;
+
+/**
+ * This is an EJB 3 webservice interface to send attachments throughout SAOP.
+ */
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface AttachmentWs {
+
+    public String stringFromBytes(byte[] data);
+
+    // Not working at the moment with SUN saaj provider and CXF
+    //public String stringFromDataSource(DataSource source);
+
+    public String stringFromDataHandler(DataHandler handler);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java b/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
index f840d61..373ed68 100644
--- a/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
+++ b/examples/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
@@ -1,92 +1,92 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.attachment;
-
-import junit.framework.TestCase;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.mail.util.ByteArrayDataSource;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPBinding;
-import java.net.URL;
-import java.util.Properties;
-
-public class AttachmentTest extends TestCase {
-
-    //START SNIPPET: setup	
-    private InitialContext initialContext;
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    protected void setUp() throws Exception {
-
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-
-        initialContext = new InitialContext(properties);
-    }
-    //END SNIPPET: setup    
-
-    /**
-     * Create a webservice client using wsdl url
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: webservice
-    public void testAttachmentViaWsInterface() throws Exception {
-        Service service = Service.create(
-                                            new URL("http://localhost:" + port + "/webservice-attachments/AttachmentImpl?wsdl"),
-                                            new QName("http://superbiz.org/wsdl", "AttachmentWsService"));
-        assertNotNull(service);
-
-        AttachmentWs ws = service.getPort(AttachmentWs.class);
-
-        // retrieve the SOAPBinding
-        SOAPBinding binding = (SOAPBinding) ((BindingProvider) ws).getBinding();
-        binding.setMTOMEnabled(true);
-
-        String request = "tsztelak@gmail.com";
-
-        // Byte array
-        String response = ws.stringFromBytes(request.getBytes());
-        assertEquals(request, response);
-
-        // Data Source
-        DataSource source = new ByteArrayDataSource(request.getBytes(), "text/plain; charset=UTF-8");
-
-        // not yet supported !
-        //        response = ws.stringFromDataSource(source);
-        //        assertEquals(request, response);
-
-        // Data Handler
-        response = ws.stringFromDataHandler(new DataHandler(source));
-        assertEquals(request, response);
-
-    }
-    //END SNIPPET: webservice
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.attachment;
+
+import junit.framework.TestCase;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.mail.util.ByteArrayDataSource;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+import java.net.URL;
+import java.util.Properties;
+
+public class AttachmentTest extends TestCase {
+
+    //START SNIPPET: setup	
+    private InitialContext initialContext;
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    protected void setUp() throws Exception {
+
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        initialContext = new InitialContext(properties);
+    }
+    //END SNIPPET: setup    
+
+    /**
+     * Create a webservice client using wsdl url
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: webservice
+    public void testAttachmentViaWsInterface() throws Exception {
+        Service service = Service.create(
+                new URL("http://localhost:" + port + "/webservice-attachments/AttachmentImpl?wsdl"),
+                new QName("http://superbiz.org/wsdl", "AttachmentWsService"));
+        assertNotNull(service);
+
+        AttachmentWs ws = service.getPort(AttachmentWs.class);
+
+        // retrieve the SOAPBinding
+        SOAPBinding binding = (SOAPBinding) ((BindingProvider) ws).getBinding();
+        binding.setMTOMEnabled(true);
+
+        String request = "tsztelak@gmail.com";
+
+        // Byte array
+        String response = ws.stringFromBytes(request.getBytes());
+        assertEquals(request, response);
+
+        // Data Source
+        DataSource source = new ByteArrayDataSource(request.getBytes(), "text/plain; charset=UTF-8");
+
+        // not yet supported !
+        //        response = ws.stringFromDataSource(source);
+        //        assertEquals(request, response);
+
+        // Data Handler
+        response = ws.stringFromDataHandler(new DataHandler(source));
+        assertEquals(request, response);
+
+    }
+    //END SNIPPET: webservice
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Calculator.java b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Calculator.java
index 2460eba..09785ab 100644
--- a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Calculator.java
+++ b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Calculator.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.wsh;
-
-import javax.ejb.Singleton;
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-@Singleton
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.calculator.wsh.CalculatorWs")
-@HandlerChain(file = "handlers.xml")
-public class Calculator implements CalculatorWs {
-
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.wsh;
+
+import javax.ejb.Singleton;
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+@Singleton
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.calculator.wsh.CalculatorWs")
+@HandlerChain(file = "handlers.xml")
+public class Calculator implements CalculatorWs {
+
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/CalculatorWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/CalculatorWs.java b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/CalculatorWs.java
index e1a4dd6..d804023 100644
--- a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/CalculatorWs.java
+++ b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/CalculatorWs.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.wsh;
-
-import javax.jws.WebService;
-
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface CalculatorWs {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.wsh;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface CalculatorWs {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Increment.java
----------------------------------------------------------------------
diff --git a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Increment.java b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Increment.java
index 5077506..1c4e492 100644
--- a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Increment.java
+++ b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Increment.java
@@ -1,64 +1,64 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.calculator.wsh;
-
-import org.w3c.dom.Node;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-import java.util.Collections;
-import java.util.Set;
-
-public class Increment implements SOAPHandler<SOAPMessageContext> {
-
-    public boolean handleMessage(SOAPMessageContext mc) {
-        try {
-            final SOAPMessage message = mc.getMessage();
-            final SOAPBody body = message.getSOAPBody();
-            final String localName = body.getFirstChild().getLocalName();
-
-            if ("sumResponse".equals(localName) || "multiplyResponse".equals(localName)) {
-                final Node responseNode = body.getFirstChild();
-                final Node returnNode = responseNode.getFirstChild();
-                final Node intNode = returnNode.getFirstChild();
-
-                final int value = new Integer(intNode.getNodeValue());
-                intNode.setNodeValue(Integer.toString(value + 1));
-            }
-
-            return true;
-        } catch (SOAPException e) {
-            return false;
-        }
-    }
-
-    public Set<QName> getHeaders() {
-        return Collections.emptySet();
-    }
-
-    public void close(MessageContext mc) {
-    }
-
-    public boolean handleFault(SOAPMessageContext mc) {
-        return true;
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.wsh;
+
+import org.w3c.dom.Node;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.Collections;
+import java.util.Set;
+
+public class Increment implements SOAPHandler<SOAPMessageContext> {
+
+    public boolean handleMessage(SOAPMessageContext mc) {
+        try {
+            final SOAPMessage message = mc.getMessage();
+            final SOAPBody body = message.getSOAPBody();
+            final String localName = body.getFirstChild().getLocalName();
+
+            if ("sumResponse".equals(localName) || "multiplyResponse".equals(localName)) {
+                final Node responseNode = body.getFirstChild();
+                final Node returnNode = responseNode.getFirstChild();
+                final Node intNode = returnNode.getFirstChild();
+
+                final int value = new Integer(intNode.getNodeValue());
+                intNode.setNodeValue(Integer.toString(value + 1));
+            }
+
+            return true;
+        } catch (SOAPException e) {
+            return false;
+        }
+    }
+
+    public Set<QName> getHeaders() {
+        return Collections.emptySet();
+    }
+
+    public void close(MessageContext mc) {
+    }
+
+    public boolean handleFault(SOAPMessageContext mc) {
+        return true;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Inflate.java
----------------------------------------------------------------------
diff --git a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Inflate.java b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Inflate.java
index 007e1e3..26438f1 100644
--- a/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Inflate.java
+++ b/examples/webservice-handlerchain/src/main/java/org/superbiz/calculator/wsh/Inflate.java
@@ -1,64 +1,64 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.calculator.wsh;
-
-import org.w3c.dom.Node;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-import java.util.Collections;
-import java.util.Set;
-
-public class Inflate implements SOAPHandler<SOAPMessageContext> {
-
-    public boolean handleMessage(SOAPMessageContext mc) {
-        try {
-            final SOAPMessage message = mc.getMessage();
-            final SOAPBody body = message.getSOAPBody();
-            final String localName = body.getFirstChild().getLocalName();
-
-            if ("sumResponse".equals(localName) || "multiplyResponse".equals(localName)) {
-                final Node responseNode = body.getFirstChild();
-                final Node returnNode = responseNode.getFirstChild();
-                final Node intNode = returnNode.getFirstChild();
-
-                final int value = new Integer(intNode.getNodeValue());
-                intNode.setNodeValue(Integer.toString(value * 1000));
-            }
-
-            return true;
-        } catch (SOAPException e) {
-            return false;
-        }
-    }
-
-    public Set<QName> getHeaders() {
-        return Collections.emptySet();
-    }
-
-    public void close(MessageContext mc) {
-    }
-
-    public boolean handleFault(SOAPMessageContext mc) {
-        return true;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.wsh;
+
+import org.w3c.dom.Node;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.Collections;
+import java.util.Set;
+
+public class Inflate implements SOAPHandler<SOAPMessageContext> {
+
+    public boolean handleMessage(SOAPMessageContext mc) {
+        try {
+            final SOAPMessage message = mc.getMessage();
+            final SOAPBody body = message.getSOAPBody();
+            final String localName = body.getFirstChild().getLocalName();
+
+            if ("sumResponse".equals(localName) || "multiplyResponse".equals(localName)) {
+                final Node responseNode = body.getFirstChild();
+                final Node returnNode = responseNode.getFirstChild();
+                final Node intNode = returnNode.getFirstChild();
+
+                final int value = new Integer(intNode.getNodeValue());
+                intNode.setNodeValue(Integer.toString(value * 1000));
+            }
+
+            return true;
+        } catch (SOAPException e) {
+            return false;
+        }
+    }
+
+    public Set<QName> getHeaders() {
+        return Collections.emptySet();
+    }
+
+    public void close(MessageContext mc) {
+    }
+
+    public boolean handleFault(SOAPMessageContext mc) {
+        return true;
+    }
+}


[11/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java
----------------------------------------------------------------------
diff --git a/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java b/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java
index f300add..0a1c714 100644
--- a/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java
+++ b/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java
@@ -1,44 +1,44 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.reloadable.pu;
-
-import javax.ejb.Singleton;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-@Singleton
-public class PersonManager {
-
-    private static int ID = 0;
-
-    @PersistenceContext
-    private EntityManager em;
-
-    public Person createUser(String name) {
-        Person user = new Person(ID++, name);
-        em.persist(user);
-        return user;
-    }
-
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public Person search(long id) {
-        return em.find(Person.class, id);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.reloadable.pu;
+
+import javax.ejb.Singleton;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Singleton
+public class PersonManager {
+
+    private static int ID = 0;
+
+    @PersistenceContext
+    private EntityManager em;
+
+    public Person createUser(String name) {
+        Person user = new Person(ID++, name);
+        em.persist(user);
+        return user;
+    }
+
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public Person search(long id) {
+        return em.find(Person.class, id);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java
----------------------------------------------------------------------
diff --git a/examples/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java b/examples/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java
index 867d5cd..abdad52 100644
--- a/examples/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java
+++ b/examples/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java
@@ -1,110 +1,110 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.reloadable.pu;
-
-import org.apache.openejb.monitoring.LocalMBeanServer;
-import org.apache.openjpa.persistence.StoreCacheImpl;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.NamingException;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnit;
-import java.lang.management.ManagementFactory;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-public class CacheActivationTest {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(CacheActivationTest.class);
-
-    private static EJBContainer container;
-
-    @EJB
-    private PersonManager mgr;
-
-    @PersistenceUnit
-    private EntityManagerFactory emf;
-
-    @BeforeClass
-    public static void start() {
-        final Properties properties = new Properties();
-        properties.setProperty(LocalMBeanServer.OPENEJB_JMX_ACTIVE, Boolean.TRUE.toString());
-        container = EJBContainer.createEJBContainer(properties);
-    }
-
-    @Before
-    public void inject() throws NamingException {
-        container.getContext().bind("inject", this);
-    }
-
-    @AfterClass
-    public static void shutdown() {
-        if (container != null) {
-            container.close();
-        }
-    }
-
-    @Test
-    public void activeCacheAtRuntime() throws Exception {
-        LOGGER.info("TEST, data initialization");
-        final Person person = mgr.createUser("user #1");
-        final long personId = person.getId();
-        LOGGER.info("TEST, end of data initialization\n\n");
-
-        assertNull(((StoreCacheImpl) emf.getCache()).getDelegate());
-        LOGGER.info("TEST, doing some queries without cache");
-        query(personId);
-        LOGGER.info("TEST, queries without cache done\n\n");
-
-        activateCache();
-
-        assertNotNull(((StoreCacheImpl) emf.getCache()).getDelegate());
-        LOGGER.info("TEST, doing some queries with cache");
-        query(personId);
-        LOGGER.info("TEST, queries with cache done\n\n");
-    }
-
-    private void activateCache() throws Exception {
-        final ObjectName on = new ObjectName("openejb.management:ObjectType=persistence-unit,PersistenceUnit=reloadable");
-        final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
-        server.invoke(on, "setProperty", new Object[]{"openjpa.DataCache", "true"}, null);
-        server.invoke(on, "setProperty", new Object[]{"openjpa.RemoteCommitProvider", "sjvm"}, null);
-        server.invoke(on, "setSharedCacheMode", new Object[]{"ALL"}, null);
-        server.invoke(on, "reload", new Object[0], null);
-    }
-
-    private void query(final long personId) {
-        for (int i = 0; i < 3; i++) { // some multiple time to get if cache works or not
-            Person found = mgr.search(personId);
-            assertNotNull(found);
-            assertEquals(personId, found.getId());
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.reloadable.pu;
+
+import org.apache.openejb.monitoring.LocalMBeanServer;
+import org.apache.openjpa.persistence.StoreCacheImpl;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+import java.lang.management.ManagementFactory;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+public class CacheActivationTest {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(CacheActivationTest.class);
+
+    private static EJBContainer container;
+
+    @EJB
+    private PersonManager mgr;
+
+    @PersistenceUnit
+    private EntityManagerFactory emf;
+
+    @BeforeClass
+    public static void start() {
+        final Properties properties = new Properties();
+        properties.setProperty(LocalMBeanServer.OPENEJB_JMX_ACTIVE, Boolean.TRUE.toString());
+        container = EJBContainer.createEJBContainer(properties);
+    }
+
+    @Before
+    public void inject() throws NamingException {
+        container.getContext().bind("inject", this);
+    }
+
+    @AfterClass
+    public static void shutdown() {
+        if (container != null) {
+            container.close();
+        }
+    }
+
+    @Test
+    public void activeCacheAtRuntime() throws Exception {
+        LOGGER.info("TEST, data initialization");
+        final Person person = mgr.createUser("user #1");
+        final long personId = person.getId();
+        LOGGER.info("TEST, end of data initialization\n\n");
+
+        assertNull(((StoreCacheImpl) emf.getCache()).getDelegate());
+        LOGGER.info("TEST, doing some queries without cache");
+        query(personId);
+        LOGGER.info("TEST, queries without cache done\n\n");
+
+        activateCache();
+
+        assertNotNull(((StoreCacheImpl) emf.getCache()).getDelegate());
+        LOGGER.info("TEST, doing some queries with cache");
+        query(personId);
+        LOGGER.info("TEST, queries with cache done\n\n");
+    }
+
+    private void activateCache() throws Exception {
+        final ObjectName on = new ObjectName("openejb.management:ObjectType=persistence-unit,PersistenceUnit=reloadable");
+        final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+        server.invoke(on, "setProperty", new Object[]{"openjpa.DataCache", "true"}, null);
+        server.invoke(on, "setProperty", new Object[]{"openjpa.RemoteCommitProvider", "sjvm"}, null);
+        server.invoke(on, "setSharedCacheMode", new Object[]{"ALL"}, null);
+        server.invoke(on, "reload", new Object[0], null);
+    }
+
+    private void query(final long personId) {
+        for (int i = 0; i < 3; i++) { // some multiple time to get if cache works or not
+            Person found = mgr.search(personId);
+            assertNotNull(found);
+            assertEquals(personId, found.getId());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/README.md
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/README.md b/examples/resources-jmx-example/README.md
index b49678b..29b6a69 100644
--- a/examples/resources-jmx-example/README.md
+++ b/examples/resources-jmx-example/README.md
@@ -373,15 +373,15 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:09 PM org.apache.openejb.arquillian.common.Setup findHome
 	INFO: Unable to find home in: /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote
 	Apr 15, 2015 12:40:09 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
-	INFO: Downloading org.apache.openejb:apache-tomee:1.7.2-SNAPSHOT:zip:plus please wait...
+	INFO: Downloading org.apache.openejb:apache-tomee:7.0.0-SNAPSHOT:zip:plus please wait...
 	Apr 15, 2015 12:40:10 PM org.apache.openejb.arquillian.common.Zips unzip
-	INFO: Extracting '/Users/jgallimore/.m2/repository/org/apache/openejb/apache-tomee/1.7.2-SNAPSHOT/apache-tomee-1.7.2-SNAPSHOT-plus.zip' to '/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote'
+	INFO: Extracting '/Users/jgallimore/.m2/repository/org/apache/openejb/apache-tomee/7.0.0-SNAPSHOT/apache-tomee-7.0.0-SNAPSHOT-plus.zip' to '/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote'
 	Apr 15, 2015 12:40:12 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
-	INFO: Downloaded container to: /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: Downloaded container to: /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Started server process on port: 61309
 	objc[20102]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Server version:        Apache Tomcat (TomEE)/7.0.61 (1.7.2-SNAPSHOT)
+	INFO: Server version:        Apache Tomcat (TomEE)/7.0.61 (7.0.0-SNAPSHOT)
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: Server built:          Mar 27 2015 12:03:56 UTC
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
@@ -399,9 +399,9 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: JVM Vendor:            Oracle Corporation
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: CATALINA_BASE:         /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: CATALINA_BASE:         /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: CATALINA_HOME:         /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: CATALINA_HOME:         /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: Command line argument: -XX:+HeapDumpOnOutOfMemoryError
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
@@ -421,21 +421,21 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: Command line argument: -Dorg.apache.openejb.servlet.filters=org.apache.openejb.arquillian.common.ArquillianFilterRunner=/ArquillianServletRunner
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Djava.util.logging.config.file=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/conf/logging.properties
+	INFO: Command line argument: -Djava.util.logging.config.file=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/conf/logging.properties
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -javaagent:/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/lib/openejb-javaagent.jar
+	INFO: Command line argument: -javaagent:/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/lib/openejb-javaagent.jar
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Djava.io.tmpdir=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/temp
+	INFO: Command line argument: -Djava.io.tmpdir=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/temp
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Djava.endorsed.dirs=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/endorsed
+	INFO: Command line argument: -Djava.endorsed.dirs=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/endorsed
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Dcatalina.base=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: Command line argument: -Dcatalina.base=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Dcatalina.home=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: Command line argument: -Dcatalina.home=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
-	INFO: Command line argument: -Dcatalina.ext.dirs=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/lib
+	INFO: Command line argument: -Dcatalina.ext.dirs=/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/lib
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
 	INFO: Command line argument: -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=true
 	Apr 15, 2015 12:40:14 PM org.apache.catalina.startup.VersionLoggerListener log
@@ -457,7 +457,7 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
 	INFO: Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
-	INFO: Version: 4.7.2-SNAPSHOT
+	INFO: Version: 7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
 	INFO: Build date: 20150415
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
@@ -465,15 +465,15 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
 	INFO: ********************************************************************************
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
-	INFO: openejb.home = /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: openejb.home = /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.OpenEJB$Instance <init>
-	INFO: openejb.base = /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT
+	INFO: openejb.base = /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
 	INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@4a00b74b
 	Apr 15, 2015 12:40:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
 	INFO: Succeeded in installing singleton service
 	Apr 15, 2015 12:40:17 PM org.apache.openejb.config.ConfigurationFactory init
-	INFO: openejb configuration file is '/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/conf/tomee.xml'
+	INFO: openejb configuration file is '/Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/conf/tomee.xml'
 	Apr 15, 2015 12:40:17 PM org.apache.openejb.config.ConfigurationFactory configureService
 	INFO: Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
 	Apr 15, 2015 12:40:17 PM org.apache.openejb.config.ConfigurationFactory configureService
@@ -563,7 +563,7 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:20 PM org.apache.catalina.core.StandardService startInternal
 	INFO: Starting service Catalina
 	Apr 15, 2015 12:40:20 PM org.apache.catalina.core.StandardEngine startInternal
-	INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/7.0.61 (1.7.2-SNAPSHOT)
+	INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/7.0.61 (7.0.0-SNAPSHOT)
 	Apr 15, 2015 12:40:21 PM org.apache.coyote.AbstractProtocol start
 	INFO: Starting ProtocolHandler ["http-bio-61309"]
 	Apr 15, 2015 12:40:21 PM org.apache.coyote.AbstractProtocol start
@@ -609,7 +609,7 @@ When run you should see output similar to the following.
 	Apr 15, 2015 12:40:24 PM org.apache.openejb.assembler.classic.Assembler createRecipe
 	INFO: Creating Container(id=Default Managed Container)
 	Apr 15, 2015 12:40:24 PM org.apache.openejb.core.managed.SimplePassivater init
-	INFO: Using directory /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-1.7.2-SNAPSHOT/temp for stateful session passivation
+	INFO: Using directory /Users/jgallimore/tmp/tomee-1.7.x/examples/resources-jmx-example/resources-jmx-ejb/target/apache-tomee-remote/apache-tomee-plus-7.0.0-SNAPSHOT/temp for stateful session passivation
 	Apr 15, 2015 12:40:24 PM org.apache.openejb.config.AutoConfig processResourceRef
 	INFO: Auto-linking resource-ref 'java:comp/env/jmx/Hello' in bean jmx-ejb.Comp1256115069 to Resource(id=jmx/Hello)
 	Apr 15, 2015 12:40:24 PM org.apache.openejb.config.AutoConfig processResourceRef

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/pom.xml
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/pom.xml b/examples/resources-jmx-example/pom.xml
index 1545336..16f563b 100644
--- a/examples/resources-jmx-example/pom.xml
+++ b/examples/resources-jmx-example/pom.xml
@@ -25,7 +25,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>resources-jmx</artifactId>
   <packaging>pom</packaging>
-  <version>1.1.1-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: Resources/JMX Example</name>
 
   <properties>
@@ -84,7 +84,7 @@
       <dependency>
         <groupId>org.superbiz</groupId>
         <artifactId>resources-jmx-ejb</artifactId>
-        <version>1.1.1-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
         <type>ejb</type>
         <scope>compile</scope>
       </dependency>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ear/pom.xml b/examples/resources-jmx-example/resources-jmx-ear/pom.xml
index f7350c9..a9fd2de 100644
--- a/examples/resources-jmx-example/resources-jmx-ear/pom.xml
+++ b/examples/resources-jmx-example/resources-jmx-ear/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.superbiz</groupId>
     <artifactId>resources-jmx</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
   </parent>
   <artifactId>resources-jmx-ear</artifactId>
   <packaging>ear</packaging>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/pom.xml
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/pom.xml b/examples/resources-jmx-example/resources-jmx-ejb/pom.xml
index fc8fdfe..207d968 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/pom.xml
+++ b/examples/resources-jmx-example/resources-jmx-ejb/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.superbiz</groupId>
     <artifactId>resources-jmx</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
   </parent>
   <artifactId>resources-jmx-ejb</artifactId>
   <packaging>ejb</packaging>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Converter.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Converter.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Converter.java
index e540f4e..b8e2440 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Converter.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Converter.java
@@ -49,7 +49,7 @@ public class Converter {
         final Class<? extends Object> actualType = value.getClass();
 
         if (targetType.isPrimitive()) {
-            targetType =  PrimitiveTypes.valueOf(targetType.toString().toUpperCase()).getWraper();
+            targetType = PrimitiveTypes.valueOf(targetType.toString().toUpperCase()).getWraper();
         }
 
         if (targetType.isAssignableFrom(actualType)) {
@@ -117,7 +117,9 @@ public class Converter {
         }
 
         for (final Method method : type.getMethods()) {
-            if (isInvalidMethod(type, method)) { continue; }
+            if (isInvalidMethod(type, method)) {
+                continue;
+            }
 
             try {
                 return method.invoke(null, value);
@@ -135,8 +137,7 @@ public class Converter {
                 !Modifier.isPublic(method.getModifiers()) ||
                 !method.getReturnType().equals(type) ||
                 !method.getParameterTypes()[0].equals(String.class) ||
-                method.getParameterTypes().length != 1)
-        {
+                method.getParameterTypes().length != 1) {
             return true;
         }
         return false;

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Editors.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Editors.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Editors.java
index c39cf7e..6988a7b 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Editors.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/Editors.java
@@ -31,7 +31,9 @@ public class Editors {
     public static PropertyEditor get(final Class<?> type) {
         final PropertyEditor editor = PropertyEditorManager.findEditor(type);
 
-        if (editor != null) return editor;
+        if (editor != null) {
+            return editor;
+        }
 
         final Class<Editors> c = Editors.class;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
index 2571fc4..3341184 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/JMXBeanCreator.java
@@ -69,7 +69,7 @@ public class JMXBeanCreator {
                 final Object value = properties.remove(attributeName);
 
                 if (prefix != null) {
-                    if (! attributeName.startsWith(prefix + ".")) {
+                    if (!attributeName.startsWith(prefix + ".")) {
                         continue;
                     } else {
                         attributeName = attributeName.substring(prefix.length() + 1);

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/PrimitiveTypes.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/PrimitiveTypes.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/PrimitiveTypes.java
index 9377409..2acdd49 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/PrimitiveTypes.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/factory/PrimitiveTypes.java
@@ -121,5 +121,6 @@ public enum PrimitiveTypes {
     };
 
     public abstract String getDefaultValue();
+
     public abstract Class<?> getWraper();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
index 00adecc..3a748391 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/main/java/org/superbiz/resource/jmx/resources/Alternative.java
@@ -95,7 +95,7 @@ public class Alternative implements AlternativeMBean {
                 final Object value = properties.remove(attributeName);
 
                 if (prefix != null) {
-                    if (! attributeName.startsWith(prefix + ".")) {
+                    if (!attributeName.startsWith(prefix + ".")) {
                         continue;
                     } else {
                         attributeName = attributeName.substring(prefix.length() + 1);

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/resources-jmx-example/resources-jmx-ejb/src/test/java/org/superbiz/resource/jmx/JMXTest.java
----------------------------------------------------------------------
diff --git a/examples/resources-jmx-example/resources-jmx-ejb/src/test/java/org/superbiz/resource/jmx/JMXTest.java b/examples/resources-jmx-example/resources-jmx-ejb/src/test/java/org/superbiz/resource/jmx/JMXTest.java
index 9476cda..b5f1c60 100644
--- a/examples/resources-jmx-example/resources-jmx-ejb/src/test/java/org/superbiz/resource/jmx/JMXTest.java
+++ b/examples/resources-jmx-example/resources-jmx-ejb/src/test/java/org/superbiz/resource/jmx/JMXTest.java
@@ -71,14 +71,14 @@ public class JMXTest {
         final ObjectName objectName = new ObjectName("superbiz.test:name=Hello");
 
         Assert.assertNotNull(ejb);
-        
+
         Assert.assertEquals(20, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(20, ejb.getCount());
-        
+
         mbs.invoke(objectName, "increment", new Object[0], new String[0]);
         Assert.assertEquals(21, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(21, ejb.getCount());
-        
+
         ejb.increment();
         Assert.assertEquals(22, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(22, ejb.getCount());
@@ -87,12 +87,12 @@ public class JMXTest {
         mbs.setAttribute(objectName, attribute);
         Assert.assertEquals(12345, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(12345, ejb.getCount());
-        
+
         ejb.setCount(23456);
         Assert.assertEquals(23456, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(23456, ejb.getCount());
 
-        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[] { "world" }, new String[] { String.class.getName() }));
+        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[]{"world"}, new String[]{String.class.getName()}));
         Assert.assertEquals("Hello, world", ejb.greet("world"));
     }
 
@@ -110,7 +110,7 @@ public class JMXTest {
         mbs.setAttribute(objectName, attribute);
         Assert.assertEquals(12345, mbs.getAttribute(objectName, "Count"));
 
-        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[] { "world" }, new String[] { String.class.getName() }));
+        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[]{"world"}, new String[]{String.class.getName()}));
     }
 
     @Test
@@ -140,7 +140,7 @@ public class JMXTest {
         Assert.assertEquals(23456, mbs.getAttribute(objectName, "Count"));
         Assert.assertEquals(23456, alternativeEjb.getCount());
 
-        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[] { "world" }, new String[] { String.class.getName() }));
+        Assert.assertEquals("Hello, world", mbs.invoke(objectName, "greet", new Object[]{"world"}, new String[]{String.class.getName()}));
         Assert.assertEquals("Hello, world", alternativeEjb.greet("world"));
     }
 
@@ -148,7 +148,7 @@ public class JMXTest {
     @Lock(LockType.READ)
     public static class TestEjb {
 
-        @Resource(name="jmx/Hello")
+        @Resource(name = "jmx/Hello")
         private HelloMBean helloMBean;
 
         public String greet(String name) {
@@ -172,7 +172,7 @@ public class JMXTest {
     @Lock(LockType.READ)
     public static class AlternativeEjb {
 
-        @Resource(name="jmx/Alternative")
+        @Resource(name = "jmx/Alternative")
         private AlternativeMBean alternativeMBean;
 
         public String greet(String name) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java b/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
index f5cffc4..f086e60 100644
--- a/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
+++ b/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Singleton
-@Path("/greeting")
-public class GreetingService {
-
-    @Inject
-    private Messager messager;
-
-    @GET
-    public String message() {
-        return messager.message();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Singleton
+@Path("/greeting")
+public class GreetingService {
+
+    @Inject
+    private Messager messager;
+
+    @GET
+    public String message() {
+        return messager.message();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java b/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
index 64d5cd7..2716250 100644
--- a/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
+++ b/examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
@@ -1,22 +1,22 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-public interface Messager {
-
-    String message();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+public interface Messager {
+
+    String message();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java b/examples/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
index d66832a..e975acc 100644
--- a/examples/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
+++ b/examples/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
@@ -1,67 +1,67 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-import org.apache.openejb.OpenEjbContainer;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.loader.IO;
-import org.apache.openejb.mockito.MockitoInjector;
-import org.apache.openejb.testing.Configuration;
-import org.apache.openejb.testing.MockInjector;
-import org.apache.openejb.testing.Module;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.when;
-
-@RunWith(ApplicationComposer.class)
-public class GreetingServiceTest {
-
-    @Mock
-    private Messager messager;
-
-    @Configuration
-    public Properties configuration() {
-        return new Properties() {{
-            setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString());
-        }};
-    }
-
-    @MockInjector
-    public Class<?> mockitoInjector() {
-        return MockitoInjector.class;
-    }
-
-    @Module
-    public Class<?>[] app() {
-        return new Class<?>[]{GreetingService.class, Messager.class};
-    }
-
-    @Test
-    public void checkMockIsUsed() throws IOException {
-        when(messager.message()).thenReturn("mockito");
-
-        final String message = IO.slurp(new URL("http://localhost:4204/GreetingServiceTest/greeting/"));
-        assertEquals("mockito", message);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+import org.apache.openejb.OpenEjbContainer;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.loader.IO;
+import org.apache.openejb.mockito.MockitoInjector;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.MockInjector;
+import org.apache.openejb.testing.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+
+    @Mock
+    private Messager messager;
+
+    @Configuration
+    public Properties configuration() {
+        return new Properties() {{
+            setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString());
+        }};
+    }
+
+    @MockInjector
+    public Class<?> mockitoInjector() {
+        return MockitoInjector.class;
+    }
+
+    @Module
+    public Class<?>[] app() {
+        return new Class<?>[]{GreetingService.class, Messager.class};
+    }
+
+    @Test
+    public void checkMockIsUsed() throws IOException {
+        when(messager.message()).thenReturn("mockito");
+
+        final String message = IO.slurp(new URL("http://localhost:4204/GreetingServiceTest/greeting/"));
+        assertEquals("mockito", message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/GreetingService.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/GreetingService.java b/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/GreetingService.java
index 8435e7d..dbddd50 100644
--- a/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/GreetingService.java
+++ b/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/GreetingService.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Path("/greeting")
-public class GreetingService {
-
-    @GET
-    public String message() {
-        throw new IllegalArgumentException("this exception is handled by an exception mapper");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/greeting")
+public class GreetingService {
+
+    @GET
+    public String message() {
+        throw new IllegalArgumentException("this exception is handled by an exception mapper");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/IllegalArgumentExceptionMapper.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/IllegalArgumentExceptionMapper.java b/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/IllegalArgumentExceptionMapper.java
index d7d35f0..18f660f 100644
--- a/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/IllegalArgumentExceptionMapper.java
+++ b/examples/rest-applicationcomposer/src/main/java/org/superbiz/composed/rest/IllegalArgumentExceptionMapper.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-public class IllegalArgumentExceptionMapper implements ExceptionMapper<java.lang.IllegalArgumentException> {
-
-    @Override
-    public Response toResponse(final java.lang.IllegalArgumentException throwable) {
-        return Response.ok(throwable.getMessage()).build();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class IllegalArgumentExceptionMapper implements ExceptionMapper<java.lang.IllegalArgumentException> {
+
+    @Override
+    public Response toResponse(final java.lang.IllegalArgumentException throwable) {
+        return Response.ok(throwable.getMessage()).build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-applicationcomposer/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/rest-applicationcomposer/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java b/examples/rest-applicationcomposer/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
index 2e86e3b..8880e39 100644
--- a/examples/rest-applicationcomposer/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
+++ b/examples/rest-applicationcomposer/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
@@ -1,77 +1,77 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed.rest;
-
-import org.apache.openejb.OpenEjbContainer;
-import org.apache.openejb.config.EjbModule;
-import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.SingletonBean;
-import org.apache.openejb.jee.oejb3.EjbDeployment;
-import org.apache.openejb.jee.oejb3.OpenejbJar;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.loader.IO;
-import org.apache.openejb.testing.Configuration;
-import org.apache.openejb.testing.Module;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-
-@RunWith(ApplicationComposer.class)
-public class GreetingServiceTest {
-
-    @Configuration
-    public Properties configuration() {
-        return new Properties() {{
-            setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString());
-        }};
-    }
-
-    @Module
-    public EjbModule app() {
-        final SingletonBean bean = (SingletonBean) new SingletonBean(GreetingService.class).localBean();
-        bean.setRestService(true);
-
-        // now create an ejbjar and an openejb-jar to hold the provider config
-
-        final EjbJar ejbJar = new EjbJar();
-        ejbJar.addEnterpriseBean(bean);
-
-        final OpenejbJar openejbJar = new OpenejbJar();
-        openejbJar.addEjbDeployment(new EjbDeployment(ejbJar.getEnterpriseBeans()[0]));
-
-        final Properties properties = openejbJar.getEjbDeployment().iterator().next().getProperties();
-        properties.setProperty("cxf.jaxrs.providers", IllegalArgumentExceptionMapper.class.getName());
-
-        // link all and return this module
-
-        final EjbModule module = new EjbModule(ejbJar);
-        module.setOpenejbJar(openejbJar);
-
-        return module;
-    }
-
-    @Test
-    public void checkProviderIsUsed() throws IOException {
-        final String message = IO.slurp(new URL("http://localhost:4204/GreetingServiceTest/greeting/"));
-        assertEquals("this exception is handled by an exception mapper", message);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed.rest;
+
+import org.apache.openejb.OpenEjbContainer;
+import org.apache.openejb.config.EjbModule;
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.SingletonBean;
+import org.apache.openejb.jee.oejb3.EjbDeployment;
+import org.apache.openejb.jee.oejb3.OpenejbJar;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.loader.IO;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+
+    @Configuration
+    public Properties configuration() {
+        return new Properties() {{
+            setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString());
+        }};
+    }
+
+    @Module
+    public EjbModule app() {
+        final SingletonBean bean = (SingletonBean) new SingletonBean(GreetingService.class).localBean();
+        bean.setRestService(true);
+
+        // now create an ejbjar and an openejb-jar to hold the provider config
+
+        final EjbJar ejbJar = new EjbJar();
+        ejbJar.addEnterpriseBean(bean);
+
+        final OpenejbJar openejbJar = new OpenejbJar();
+        openejbJar.addEjbDeployment(new EjbDeployment(ejbJar.getEnterpriseBeans()[0]));
+
+        final Properties properties = openejbJar.getEjbDeployment().iterator().next().getProperties();
+        properties.setProperty("cxf.jaxrs.providers", IllegalArgumentExceptionMapper.class.getName());
+
+        // link all and return this module
+
+        final EjbModule module = new EjbModule(ejbJar);
+        module.setOpenejbJar(openejbJar);
+
+        return module;
+    }
+
+    @Test
+    public void checkProviderIsUsed() throws IOException {
+        final String message = IO.slurp(new URL("http://localhost:4204/GreetingServiceTest/greeting/"));
+        assertEquals("this exception is handled by an exception mapper", message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-cdi/src/main/java/org/superbiz/rest/Greeting.java
----------------------------------------------------------------------
diff --git a/examples/rest-cdi/src/main/java/org/superbiz/rest/Greeting.java b/examples/rest-cdi/src/main/java/org/superbiz/rest/Greeting.java
index f6c4379..54fce42 100644
--- a/examples/rest-cdi/src/main/java/org/superbiz/rest/Greeting.java
+++ b/examples/rest-cdi/src/main/java/org/superbiz/rest/Greeting.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-cdi/src/main/java/org/superbiz/rest/GreetingService.java
----------------------------------------------------------------------
diff --git a/examples/rest-cdi/src/main/java/org/superbiz/rest/GreetingService.java b/examples/rest-cdi/src/main/java/org/superbiz/rest/GreetingService.java
index 8e71c84..6d75116 100644
--- a/examples/rest-cdi/src/main/java/org/superbiz/rest/GreetingService.java
+++ b/examples/rest-cdi/src/main/java/org/superbiz/rest/GreetingService.java
@@ -1,66 +1,66 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.inject.Inject;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Path("/greeting")
-@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-public class GreetingService {
-
-    @Inject
-    Greeting greeting;
-
-    @GET
-    public Greet message() {
-        return new Greet("Hi REST!");
-    }
-
-    @POST
-    public Greet lowerCase(final Request message) {
-        return new Greet(greeting.doSomething(message.getValue()));
-    }
-
-    @XmlRootElement // for xml only, useless for json (johnzon is the default)
-    public static class Greet {
-        private String message;
-
-        public Greet(final String message) {
-            this.message = message;
-        }
-
-        public Greet() {
-            this(null);
-        }
-
-        public String getMessage() {
-            return message;
-        }
-
-        public void setMessage(final String message) {
-            this.message = message;
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Path("/greeting")
+@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+public class GreetingService {
+
+    @Inject
+    Greeting greeting;
+
+    @GET
+    public Greet message() {
+        return new Greet("Hi REST!");
+    }
+
+    @POST
+    public Greet lowerCase(final Request message) {
+        return new Greet(greeting.doSomething(message.getValue()));
+    }
+
+    @XmlRootElement // for xml only, useless for json (johnzon is the default)
+    public static class Greet {
+        private String message;
+
+        public Greet(final String message) {
+            this.message = message;
+        }
+
+        public Greet() {
+            this(null);
+        }
+
+        public String getMessage() {
+            return message;
+        }
+
+        public void setMessage(final String message) {
+            this.message = message;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-cdi/src/main/java/org/superbiz/rest/Request.java
----------------------------------------------------------------------
diff --git a/examples/rest-cdi/src/main/java/org/superbiz/rest/Request.java b/examples/rest-cdi/src/main/java/org/superbiz/rest/Request.java
index cac8e74..679d439 100644
--- a/examples/rest-cdi/src/main/java/org/superbiz/rest/Request.java
+++ b/examples/rest-cdi/src/main/java/org/superbiz/rest/Request.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Request {
-
-    private String value;
-
-    public Request() {
-        //no-op
-    }
-
-    public Request(final String s) {
-        value = s;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Request {
+
+    private String value;
+
+    public Request() {
+        //no-op
+    }
+
+    public Request(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-cdi/src/main/java/org/superbiz/rest/Response.java
----------------------------------------------------------------------
diff --git a/examples/rest-cdi/src/main/java/org/superbiz/rest/Response.java b/examples/rest-cdi/src/main/java/org/superbiz/rest/Response.java
index 4c2319d..4cb0818 100644
--- a/examples/rest-cdi/src/main/java/org/superbiz/rest/Response.java
+++ b/examples/rest-cdi/src/main/java/org/superbiz/rest/Response.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Response {
-
-    private String value;
-
-    public Response() {
-        // no-op
-    }
-
-    public Response(final String s) {
-        value = s;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Response {
+
+    private String value;
+
+    public Response() {
+        // no-op
+    }
+
+    public Response(final String s) {
+        value = s;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java b/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
index 6149db5..3b1fb17 100644
--- a/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
+++ b/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
@@ -1,87 +1,87 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.rest;
-
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.johnzon.jaxrs.JohnzonProvider;
-import org.apache.openejb.jee.WebApp;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.testing.Classes;
-import org.apache.openejb.testing.Configuration;
-import org.apache.openejb.testing.EnableServices;
-import org.apache.openejb.testing.Module;
-import org.apache.openejb.testng.PropertiesBuilder;
-import org.apache.openejb.util.NetworkUtil;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.ws.rs.core.MediaType;
-import java.io.IOException;
-import java.util.Properties;
-
-import static java.util.Arrays.asList;
-import static org.junit.Assert.assertEquals;
-
-@EnableServices(value = "jaxrs", httpDebug = true)
-@RunWith(ApplicationComposer.class)
-public class GreetingServiceTest {
-    private int port;
-
-    @Configuration
-    public Properties randomPort() {
-        port = NetworkUtil.getNextAvailablePort();
-        return new PropertiesBuilder().p("httpejbd.port", Integer.toString(port)).build();
-    }
-
-    @Module
-    @Classes(value = {GreetingService.class, Greeting.class}, cdi = true) // This enables the CDI magic
-    public WebApp app() {
-        return new WebApp().contextRoot("test");
-    }
-
-    @Test
-    public void getXml() throws IOException {
-        final String message = WebClient.create("http://localhost:" + port).path("/test/greeting/")
-                .accept(MediaType.APPLICATION_XML_TYPE)
-                .get(GreetingService.Greet.class).getMessage();
-        assertEquals("Hi REST!", message);
-    }
-
-    @Test
-    public void postXml() throws IOException {
-        final String message = WebClient.create("http://localhost:" + port).path("/test/greeting/")
-                .accept(MediaType.APPLICATION_XML_TYPE)
-                .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
-        assertEquals("hi rest!", message);
-    }
-
-    @Test
-    public void getJson() throws IOException {
-        final String message = WebClient.create("http://localhost:" + port, asList(new JohnzonProvider<GreetingService.Greet>())).path("/test/greeting/")
-                .accept(MediaType.APPLICATION_JSON_TYPE)
-                .get(GreetingService.Greet.class).getMessage();
-        assertEquals("Hi REST!", message);
-    }
-
-    @Test
-    public void postJson() throws IOException {
-        final String message = WebClient.create("http://localhost:" + port, asList(new JohnzonProvider<GreetingService.Greet>())).path("/test/greeting/")
-                .accept(MediaType.APPLICATION_JSON_TYPE)
-                .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
-        assertEquals("hi rest!", message);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest;
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.johnzon.jaxrs.JohnzonProvider;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Classes;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.EnableServices;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.testng.PropertiesBuilder;
+import org.apache.openejb.util.NetworkUtil;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+import java.util.Properties;
+
+import static java.util.Arrays.asList;
+import static org.junit.Assert.assertEquals;
+
+@EnableServices(value = "jaxrs", httpDebug = true)
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+    private int port;
+
+    @Configuration
+    public Properties randomPort() {
+        port = NetworkUtil.getNextAvailablePort();
+        return new PropertiesBuilder().p("httpejbd.port", Integer.toString(port)).build();
+    }
+
+    @Module
+    @Classes(value = {GreetingService.class, Greeting.class}, cdi = true) // This enables the CDI magic
+    public WebApp app() {
+        return new WebApp().contextRoot("test");
+    }
+
+    @Test
+    public void getXml() throws IOException {
+        final String message = WebClient.create("http://localhost:" + port).path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .get(GreetingService.Greet.class).getMessage();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postXml() throws IOException {
+        final String message = WebClient.create("http://localhost:" + port).path("/test/greeting/")
+                .accept(MediaType.APPLICATION_XML_TYPE)
+                .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
+        assertEquals("hi rest!", message);
+    }
+
+    @Test
+    public void getJson() throws IOException {
+        final String message = WebClient.create("http://localhost:" + port, asList(new JohnzonProvider<GreetingService.Greet>())).path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .get(GreetingService.Greet.class).getMessage();
+        assertEquals("Hi REST!", message);
+    }
+
+    @Test
+    public void postJson() throws IOException {
+        final String message = WebClient.create("http://localhost:" + port, asList(new JohnzonProvider<GreetingService.Greet>())).path("/test/greeting/")
+                .accept(MediaType.APPLICATION_JSON_TYPE)
+                .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
+        assertEquals("hi rest!", message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/rest-example/src/main/java/org/superbiz/rest/batcher/SampleDataManager.java
----------------------------------------------------------------------
diff --git a/examples/rest-example/src/main/java/org/superbiz/rest/batcher/SampleDataManager.java b/examples/rest-example/src/main/java/org/superbiz/rest/batcher/SampleDataManager.java
index 1bcfc15..2cc623c 100644
--- a/examples/rest-example/src/main/java/org/superbiz/rest/batcher/SampleDataManager.java
+++ b/examples/rest-example/src/main/java/org/superbiz/rest/batcher/SampleDataManager.java
@@ -1,80 +1,80 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.rest.batcher;
-
-import org.superbiz.rest.dao.CommentDAO;
-import org.superbiz.rest.dao.PostDAO;
-import org.superbiz.rest.dao.UserDAO;
-import org.superbiz.rest.model.Post;
-import org.superbiz.rest.model.User;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.DependsOn;
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Schedule;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import java.util.logging.Logger;
-
-@Startup
-@DependsOn({"CommentDAO", "PostDAO", "UserDAO"})
-@Singleton
-@Lock(LockType.READ)
-public class SampleDataManager {
-
-    private static final Logger LOGGER = Logger.getLogger(SampleDataManager.class.getName());
-
-    @PersistenceContext(unitName = "blog")
-    private EntityManager em;
-
-    @Inject
-    private CommentDAO comments;
-
-    @Inject
-    private PostDAO posts;
-
-    @Inject
-    private UserDAO users;
-
-    @PostConstruct
-    public void createSomeData() {
-        final User tomee = users.create("tomee", "tomee", "tomee@apache.org");
-        final User openejb = users.create("openejb", "openejb", "openejb@apache.org");
-        final Post tomeePost = posts.create("TomEE", "TomEE is a cool JEE App Server", tomee.getId());
-        posts.create("OpenEJB", "OpenEJB is a cool embedded container", openejb.getId());
-        comments.create("visitor", "nice post!", tomeePost.getId());
-    }
-
-    // a bit ugly but at least we clean data
-    @Schedule(second = "0", minute = "30", hour = "*", persistent = false)
-    private void cleanData() {
-        LOGGER.info("Cleaning data");
-        deleteAll();
-        createSomeData();
-        LOGGER.info("Data reset");
-    }
-
-    private void deleteAll() {
-        em.createQuery("delete From Comment").executeUpdate();
-        em.createQuery("delete From Post").executeUpdate();
-        em.createQuery("delete From User").executeUpdate();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.rest.batcher;
+
+import org.superbiz.rest.dao.CommentDAO;
+import org.superbiz.rest.dao.PostDAO;
+import org.superbiz.rest.dao.UserDAO;
+import org.superbiz.rest.model.Post;
+import org.superbiz.rest.model.User;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.DependsOn;
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Schedule;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.util.logging.Logger;
+
+@Startup
+@DependsOn({"CommentDAO", "PostDAO", "UserDAO"})
+@Singleton
+@Lock(LockType.READ)
+public class SampleDataManager {
+
+    private static final Logger LOGGER = Logger.getLogger(SampleDataManager.class.getName());
+
+    @PersistenceContext(unitName = "blog")
+    private EntityManager em;
+
+    @Inject
+    private CommentDAO comments;
+
+    @Inject
+    private PostDAO posts;
+
+    @Inject
+    private UserDAO users;
+
+    @PostConstruct
+    public void createSomeData() {
+        final User tomee = users.create("tomee", "tomee", "tomee@apache.org");
+        final User openejb = users.create("openejb", "openejb", "openejb@apache.org");
+        final Post tomeePost = posts.create("TomEE", "TomEE is a cool JEE App Server", tomee.getId());
+        posts.create("OpenEJB", "OpenEJB is a cool embedded container", openejb.getId());
+        comments.create("visitor", "nice post!", tomeePost.getId());
+    }
+
+    // a bit ugly but at least we clean data
+    @Schedule(second = "0", minute = "30", hour = "*", persistent = false)
+    private void cleanData() {
+        LOGGER.info("Cleaning data");
+        deleteAll();
+        createSomeData();
+        LOGGER.info("Data reset");
+    }
+
+    private void deleteAll() {
+        em.createQuery("delete From Comment").executeUpdate();
+        em.createQuery("delete From Post").executeUpdate();
+        em.createQuery("delete From User").executeUpdate();
+    }
+}


[09/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
index 91d663b..c8c82b6 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface Hourly {
-
-    public static interface $ {
-
-        @Hourly
-        @Schedule(second = "0", minute = "0", hour = "*")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Hourly {
+
+    public static interface $ {
+
+        @Hourly
+        @Schedule(second = "0", minute = "0", hour = "*")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
index edac298..5f7f2cd 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.ANNOTATION_TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Metatype {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.ANNOTATION_TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Metatype {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
index e90f6b2..ded755a 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import javax.ejb.Schedules;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface PlantingTime {
-
-    public static interface $ {
-
-        @PlantingTime
-        @Schedules({
-                       @Schedule(month = "5", dayOfMonth = "20-Last", minute = "0", hour = "8"),
-                       @Schedule(month = "6", dayOfMonth = "1-10", minute = "0", hour = "8")
-                   })
-        public void method();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface PlantingTime {
+
+    public static interface $ {
+
+        @PlantingTime
+        @Schedules({
+                @Schedule(month = "5", dayOfMonth = "20-Last", minute = "0", hour = "8"),
+                @Schedule(month = "6", dayOfMonth = "1-10", minute = "0", hour = "8")
+        })
+        public void method();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
index 2c29c8b..320e8cc 100644
--- a/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
+++ b/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta.api;
-
-import javax.ejb.Schedule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface Secondly {
-
-    public static interface $ {
-
-        @Secondly
-        @Schedule(second = "*", minute = "*", hour = "*")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Secondly {
+
+    public static interface $ {
+
+        @Secondly
+        @Schedule(second = "*", minute = "*", hour = "*")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java b/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
index 7cc531a..446e2a9 100644
--- a/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
+++ b/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn.meta;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-
-/**
- * @version $Revision$ $Date$
- */
-public class FarmerBrownTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-methods-meta/FarmerBrown");
-
-        // Give Farmer brown a chance to do some work
-        Thread.sleep(SECONDS.toMillis(5));
-
-        assertTrue(farmerBrown.getChecks() > 4);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn.meta;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class FarmerBrownTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-methods-meta/FarmerBrown");
+
+        // Give Farmer brown a chance to do some work
+        Thread.sleep(SECONDS.toMillis(5));
+
+        assertTrue(farmerBrown.getChecks() > 4);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods/src/main/java/org/superbiz/corn/FarmerBrown.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods/src/main/java/org/superbiz/corn/FarmerBrown.java b/examples/schedule-methods/src/main/java/org/superbiz/corn/FarmerBrown.java
index 20a2de6..6c036e3 100644
--- a/examples/schedule-methods/src/main/java/org/superbiz/corn/FarmerBrown.java
+++ b/examples/schedule-methods/src/main/java/org/superbiz/corn/FarmerBrown.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Schedule;
-import javax.ejb.Schedules;
-import javax.ejb.Singleton;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * This is where we schedule all of Farmer Brown's corn jobs
- *
- * @version $Revision$ $Date$
- */
-@Singleton
-@Lock(LockType.READ) // allows timers to execute in parallel
-public class FarmerBrown {
-
-    private final AtomicInteger checks = new AtomicInteger();
-
-    @Schedules({
-                   @Schedule(month = "5", dayOfMonth = "20-Last", minute = "0", hour = "8"),
-                   @Schedule(month = "6", dayOfMonth = "1-10", minute = "0", hour = "8")
-               })
-    private void plantTheCorn() {
-        // Dig out the planter!!!
-    }
-
-    @Schedules({
-                   @Schedule(month = "9", dayOfMonth = "20-Last", minute = "0", hour = "8"),
-                   @Schedule(month = "10", dayOfMonth = "1-10", minute = "0", hour = "8")
-               })
-    private void harvestTheCorn() {
-        // Dig out the combine!!!
-    }
-
-    @Schedule(second = "*", minute = "*", hour = "*")
-    private void checkOnTheDaughters() {
-        checks.incrementAndGet();
-    }
-
-    public int getChecks() {
-        return checks.get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import javax.ejb.Singleton;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * This is where we schedule all of Farmer Brown's corn jobs
+ *
+ * @version $Revision$ $Date$
+ */
+@Singleton
+@Lock(LockType.READ) // allows timers to execute in parallel
+public class FarmerBrown {
+
+    private final AtomicInteger checks = new AtomicInteger();
+
+    @Schedules({
+            @Schedule(month = "5", dayOfMonth = "20-Last", minute = "0", hour = "8"),
+            @Schedule(month = "6", dayOfMonth = "1-10", minute = "0", hour = "8")
+    })
+    private void plantTheCorn() {
+        // Dig out the planter!!!
+    }
+
+    @Schedules({
+            @Schedule(month = "9", dayOfMonth = "20-Last", minute = "0", hour = "8"),
+            @Schedule(month = "10", dayOfMonth = "1-10", minute = "0", hour = "8")
+    })
+    private void harvestTheCorn() {
+        // Dig out the combine!!!
+    }
+
+    @Schedule(second = "*", minute = "*", hour = "*")
+    private void checkOnTheDaughters() {
+        checks.incrementAndGet();
+    }
+
+    public int getChecks() {
+        return checks.get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/schedule-methods/src/test/java/org/superbiz/corn/FarmerBrownTest.java
----------------------------------------------------------------------
diff --git a/examples/schedule-methods/src/test/java/org/superbiz/corn/FarmerBrownTest.java b/examples/schedule-methods/src/test/java/org/superbiz/corn/FarmerBrownTest.java
index 76d8ca4..0f0dcff 100644
--- a/examples/schedule-methods/src/test/java/org/superbiz/corn/FarmerBrownTest.java
+++ b/examples/schedule-methods/src/test/java/org/superbiz/corn/FarmerBrownTest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.corn;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-
-/**
- * @version $Revision$ $Date$
- */
-public class FarmerBrownTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-methods/FarmerBrown");
-
-        // Give Farmer brown a chance to do some work
-        Thread.sleep(SECONDS.toMillis(5));
-
-        assertTrue(farmerBrown.getChecks() > 4);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.corn;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class FarmerBrownTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final FarmerBrown farmerBrown = (FarmerBrown) context.lookup("java:global/schedule-methods/FarmerBrown");
+
+        // Give Farmer brown a chance to do some work
+        Thread.sleep(SECONDS.toMillis(5));
+
+        assertTrue(farmerBrown.getChecks() > 4);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/server-events/src/test/java/org/superbiz/event/ListenerTest.java
----------------------------------------------------------------------
diff --git a/examples/server-events/src/test/java/org/superbiz/event/ListenerTest.java b/examples/server-events/src/test/java/org/superbiz/event/ListenerTest.java
index 4ec1eb9..c94bfc9 100644
--- a/examples/server-events/src/test/java/org/superbiz/event/ListenerTest.java
+++ b/examples/server-events/src/test/java/org/superbiz/event/ListenerTest.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.event;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-@RunWith(Arquillian.class)
-public class ListenerTest {
-
-    @Deployment
-    public static JavaArchive jar() {
-        return ShrinkWrap.create(JavaArchive.class, "listener-test.jar")
-                         .addClasses(MyListener.class, AutoDiscoveredListener.class)
-                         .addAsManifestResource(new StringAsset(AutoDiscoveredListener.class.getName()), ArchivePaths.create("org.apache.openejb.extension"));
-    }
-
-    @Test
-    public void check() {
-        assertEquals("listener-test", AutoDiscoveredListener.getAppName());
-        assertTrue(MyListener.isLogAllEvent());
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.event;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Arquillian.class)
+public class ListenerTest {
+
+    @Deployment
+    public static JavaArchive jar() {
+        return ShrinkWrap.create(JavaArchive.class, "listener-test.jar")
+                .addClasses(MyListener.class, AutoDiscoveredListener.class)
+                .addAsManifestResource(new StringAsset(AutoDiscoveredListener.class.getName()), ArchivePaths.create("org.apache.openejb.extension"));
+    }
+
+    @Test
+    public void check() {
+        assertEquals("listener-test", AutoDiscoveredListener.getAppName());
+        assertTrue(MyListener.isLogAllEvent());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/beans/BookShow.java
----------------------------------------------------------------------
diff --git a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/beans/BookShow.java b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/beans/BookShow.java
index 464075d..e1864d3 100755
--- a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/beans/BookShow.java
+++ b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/beans/BookShow.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.beans;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-
-import javax.ejb.Stateful;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-@Log
-@Stateful
-public class BookShow implements Serializable {
-
-    private static final long serialVersionUID = 6350400892234496909L;
-
-    public List<String> getMoviesList() {
-        List<String> moviesAvailable = new ArrayList<String>();
-        moviesAvailable.add("12 Angry Men");
-        moviesAvailable.add("Kings speech");
-        return moviesAvailable;
-    }
-
-    public Integer getDiscountedPrice(int ticketPrice) {
-        return ticketPrice - 50;
-    }
-    // assume more methods are present
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.beans;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+
+import javax.ejb.Stateful;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Log
+@Stateful
+public class BookShow implements Serializable {
+
+    private static final long serialVersionUID = 6350400892234496909L;
+
+    public List<String> getMoviesList() {
+        List<String> moviesAvailable = new ArrayList<String>();
+        moviesAvailable.add("12 Angry Men");
+        moviesAvailable.add("Kings speech");
+        return moviesAvailable;
+    }
+
+    public Integer getDiscountedPrice(int ticketPrice) {
+        return ticketPrice - 50;
+    }
+    // assume more methods are present
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
----------------------------------------------------------------------
diff --git a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
index 6516dbc..cdaf8d7 100755
--- a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
+++ b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptorbinding/Log.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptorbinding;
-
-import javax.interceptor.InterceptorBinding;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@InterceptorBinding
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface Log {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptorbinding;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface Log {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptors/LoggingInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptors/LoggingInterceptor.java b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptors/LoggingInterceptor.java
index cbafcc3..af9aa79 100755
--- a/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptors/LoggingInterceptor.java
+++ b/examples/simple-cdi-interceptor/src/main/java/org/superbiz/cdi/bookshow/interceptors/LoggingInterceptor.java
@@ -1,53 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-import java.io.Serializable;
-
-@Interceptor
-@Log
-public class LoggingInterceptor implements Serializable {
-
-    private static final long serialVersionUID = 8139854519874743530L;
-
-    @AroundInvoke
-    public Object logMethodEntry(InvocationContext ctx) throws Exception {
-        System.out.println("Entering method: " + ctx.getMethod().getName());
-        return ctx.proceed();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * <p/>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+import java.io.Serializable;
+
+@Interceptor
+@Log
+public class LoggingInterceptor implements Serializable {
+
+    private static final long serialVersionUID = 8139854519874743530L;
+
+    @AroundInvoke
+    public Object logMethodEntry(InvocationContext ctx) throws Exception {
+        System.out.println("Entering method: " + ctx.getMethod().getName());
+        return ctx.proceed();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cdi-interceptor/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-cdi-interceptor/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowTest.java b/examples/simple-cdi-interceptor/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowTest.java
index 77af133..1b19ef8 100755
--- a/examples/simple-cdi-interceptor/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowTest.java
+++ b/examples/simple-cdi-interceptor/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowTest.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import junit.framework.TestCase;
-import org.superbiz.cdi.bookshow.beans.BookShow;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-public class BookShowTest extends TestCase {
-
-    @EJB
-    private BookShow bookForAShowBean;
-    EJBContainer ejbContainer;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    @Override
-    protected void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    /**
-     * Test basic interception
-     */
-    public void testMethodShouldBeIntercepted() {
-
-        bookForAShowBean.getMoviesList();
-
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import junit.framework.TestCase;
+import org.superbiz.cdi.bookshow.beans.BookShow;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+public class BookShowTest extends TestCase {
+
+    @EJB
+    private BookShow bookForAShowBean;
+    EJBContainer ejbContainer;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    @Override
+    protected void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    /**
+     * Test basic interception
+     */
+    public void testMethodShouldBeIntercepted() {
+
+        bookForAShowBean.getMoviesList();
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movie.java
----------------------------------------------------------------------
diff --git a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movie.java b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movie.java
index a79d4a3..f172bc0 100644
--- a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movie.java
+++ b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movie.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cmp2;
-
-/**
- * @version $Revision$ $Date$
- */
-public interface Movie extends javax.ejb.EJBLocalObject {
-
-    java.lang.Integer getId();
-
-    void setId(java.lang.Integer id);
-
-    String getDirector();
-
-    void setDirector(String director);
-
-    String getTitle();
-
-    void setTitle(String title);
-
-    int getYear();
-
-    void setYear(int year);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cmp2;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface Movie extends javax.ejb.EJBLocalObject {
+
+    java.lang.Integer getId();
+
+    void setId(java.lang.Integer id);
+
+    String getDirector();
+
+    void setDirector(String director);
+
+    String getTitle();
+
+    void setTitle(String title);
+
+    int getYear();
+
+    void setYear(int year);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/MovieBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/MovieBean.java b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/MovieBean.java
index 0597fb1..8c743e7 100644
--- a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/MovieBean.java
+++ b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/MovieBean.java
@@ -1,49 +1,49 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cmp2;
-
-import javax.ejb.EntityBean;
-
-public abstract class MovieBean implements EntityBean {
-
-    public MovieBean() {
-    }
-
-    public Integer ejbCreate(final String director, String title, final int year) {
-        this.setDirector(director);
-        this.setTitle(title);
-        this.setYear(year);
-        return null;
-    }
-
-    public abstract java.lang.Integer getId();
-
-    public abstract void setId(java.lang.Integer id);
-
-    public abstract String getDirector();
-
-    public abstract void setDirector(String director);
-
-    public abstract String getTitle();
-
-    public abstract void setTitle(String title);
-
-    public abstract int getYear();
-
-    public abstract void setYear(int year);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cmp2;
+
+import javax.ejb.EntityBean;
+
+public abstract class MovieBean implements EntityBean {
+
+    public MovieBean() {
+    }
+
+    public Integer ejbCreate(final String director, String title, final int year) {
+        this.setDirector(director);
+        this.setTitle(title);
+        this.setYear(year);
+        return null;
+    }
+
+    public abstract java.lang.Integer getId();
+
+    public abstract void setId(java.lang.Integer id);
+
+    public abstract String getDirector();
+
+    public abstract void setDirector(String director);
+
+    public abstract String getTitle();
+
+    public abstract void setTitle(String title);
+
+    public abstract int getYear();
+
+    public abstract void setYear(int year);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movies.java
----------------------------------------------------------------------
diff --git a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movies.java b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movies.java
index 8877449..2229322 100644
--- a/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movies.java
+++ b/examples/simple-cmp2/src/main/java/org/superbiz/cmp2/Movies.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cmp2;
-
-import javax.ejb.CreateException;
-import javax.ejb.FinderException;
-import java.util.Collection;
-
-/**
- * @version $Revision$ $Date$
- */
-interface Movies extends javax.ejb.EJBLocalHome {
-
-    Movie create(String director, String title, int year) throws CreateException;
-
-    Movie findByPrimaryKey(Integer primarykey) throws FinderException;
-
-    Collection<Movie> findAll() throws FinderException;
-
-    Collection<Movie> findByDirector(String director) throws FinderException;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cmp2;
+
+import javax.ejb.CreateException;
+import javax.ejb.FinderException;
+import java.util.Collection;
+
+/**
+ * @version $Revision$ $Date$
+ */
+interface Movies extends javax.ejb.EJBLocalHome {
+
+    Movie create(String director, String title, int year) throws CreateException;
+
+    Movie findByPrimaryKey(Integer primarykey) throws FinderException;
+
+    Collection<Movie> findAll() throws FinderException;
+
+    Collection<Movie> findByDirector(String director) throws FinderException;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java b/examples/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java
index 04333dc..cbbc711 100644
--- a/examples/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java
+++ b/examples/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java
@@ -1,60 +1,60 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cmp2;
-
-import junit.framework.TestCase;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Collection;
-import java.util.Properties;
-
-/**
- * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
- */
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
-        p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
-
-        Context context = new InitialContext(p);
-
-        Movies movies = (Movies) context.lookup("MovieBeanLocalHome");
-
-        movies.create("Quentin Tarantino", "Reservoir Dogs", 1992);
-        movies.create("Joel Coen", "Fargo", 1996);
-        movies.create("Joel Coen", "The Big Lebowski", 1998);
-
-        Collection<Movie> list = movies.findAll();
-        assertEquals("Collection.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.remove(movie.getPrimaryKey());
-        }
-
-        assertEquals("Movies.findAll()", 0, movies.findAll().size());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cmp2;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Collection;
+import java.util.Properties;
+
+/**
+ * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
+ */
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
+        p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
+
+        Context context = new InitialContext(p);
+
+        Movies movies = (Movies) context.lookup("MovieBeanLocalHome");
+
+        movies.create("Quentin Tarantino", "Reservoir Dogs", 1992);
+        movies.create("Joel Coen", "Fargo", 1996);
+        movies.create("Joel Coen", "The Big Lebowski", 1998);
+
+        Collection<Movie> list = movies.findAll();
+        assertEquals("Collection.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.remove(movie.getPrimaryKey());
+        }
+
+        assertEquals("Movies.findAll()", 0, movies.findAll().size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatBean.java b/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatBean.java
index e4b3ee1..9bac2ea 100644
--- a/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatBean.java
+++ b/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatBean.java
@@ -1,93 +1,93 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdb;
-
-import javax.annotation.Resource;
-import javax.ejb.MessageDriven;
-import javax.inject.Inject;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-@MessageDriven
-public class ChatBean implements MessageListener {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource(name = "AnswerQueue")
-    private Queue answerQueue;
-
-    @Inject
-    private ChatRespondCreator responder;
-
-    public void onMessage(Message message) {
-        try {
-
-            final TextMessage textMessage = (TextMessage) message;
-            final String question = textMessage.getText();
-            final String response = responder.respond(question);
-
-            if (response != null) {
-                respond(response);
-            }
-        } catch (JMSException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private void respond(String text) throws JMSException {
-
-        Connection connection = null;
-        Session session = null;
-
-        try {
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create a Session
-            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-            // Create a MessageProducer from the Session to the Topic or Queue
-            MessageProducer producer = session.createProducer(answerQueue);
-            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-            // Create a message
-            TextMessage message = session.createTextMessage(text);
-
-            // Tell the producer to send the message
-            producer.send(message);
-        } finally {
-            // Clean up
-            if (session != null) {
-                session.close();
-            }
-            if (connection != null) {
-                connection.close();
-            }
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdb;
+
+import javax.annotation.Resource;
+import javax.ejb.MessageDriven;
+import javax.inject.Inject;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+@MessageDriven
+public class ChatBean implements MessageListener {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource(name = "AnswerQueue")
+    private Queue answerQueue;
+
+    @Inject
+    private ChatRespondCreator responder;
+
+    public void onMessage(Message message) {
+        try {
+
+            final TextMessage textMessage = (TextMessage) message;
+            final String question = textMessage.getText();
+            final String response = responder.respond(question);
+
+            if (response != null) {
+                respond(response);
+            }
+        } catch (JMSException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    private void respond(String text) throws JMSException {
+
+        Connection connection = null;
+        Session session = null;
+
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            // Create a Session
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Create a MessageProducer from the Session to the Topic or Queue
+            MessageProducer producer = session.createProducer(answerQueue);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+            // Create a message
+            TextMessage message = session.createTextMessage(text);
+
+            // Tell the producer to send the message
+            producer.send(message);
+        } finally {
+            // Clean up
+            if (session != null) {
+                session.close();
+            }
+            if (connection != null) {
+                connection.close();
+            }
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java b/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java
index 739d0cd..9507fab 100644
--- a/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java
+++ b/examples/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.mdb;
-
-public class ChatRespondCreator {
-
-    public String respond(String question) {
-        if ("Hello World!".equals(question)) {
-            return "Hello, Test Case!";
-        } else if ("How are you?".equals(question)) {
-            return "I'm doing well.";
-        } else if ("Still spinning?".equals(question)) {
-            return "Once every day, as usual.";
-        }
-        return null;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.mdb;
+
+public class ChatRespondCreator {
+
+    public String respond(String question) {
+        if ("Hello World!".equals(question)) {
+            return "Hello, Test Case!";
+        } else if ("How are you?".equals(question)) {
+            return "I'm doing well.";
+        } else if ("Still spinning?".equals(question)) {
+            return "Once every day, as usual.";
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb-and-cdi/src/test/java/org/superbiz/mdb/ChatBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb-and-cdi/src/test/java/org/superbiz/mdb/ChatBeanTest.java b/examples/simple-mdb-and-cdi/src/test/java/org/superbiz/mdb/ChatBeanTest.java
index a360d10..700cc96 100644
--- a/examples/simple-mdb-and-cdi/src/test/java/org/superbiz/mdb/ChatBeanTest.java
+++ b/examples/simple-mdb-and-cdi/src/test/java/org/superbiz/mdb/ChatBeanTest.java
@@ -1,84 +1,84 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdb;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.embeddable.EJBContainer;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class ChatBeanTest extends TestCase {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource(name = "ChatBean")
-    private Queue questionQueue;
-
-    @Resource(name = "AnswerQueue")
-    private Queue answerQueue;
-
-    public void test() throws Exception {
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-
-        final Connection connection = connectionFactory.createConnection();
-
-        connection.start();
-
-        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        final MessageProducer questions = session.createProducer(questionQueue);
-
-        final MessageConsumer answers = session.createConsumer(answerQueue);
-
-        sendText("Hello World!", questions, session);
-
-        assertEquals("Hello, Test Case!", receiveText(answers));
-
-        sendText("How are you?", questions, session);
-
-        assertEquals("I'm doing well.", receiveText(answers));
-
-        sendText("Still spinning?", questions, session);
-
-        assertEquals("Once every day, as usual.", receiveText(answers));
-
-    }
-
-    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
-
-        questions.send(session.createTextMessage(text));
-
-    }
-
-    private String receiveText(MessageConsumer answers) throws JMSException {
-
-        return ((TextMessage) answers.receive(1000)).getText();
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdb;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.embeddable.EJBContainer;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class ChatBeanTest extends TestCase {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource(name = "ChatBean")
+    private Queue questionQueue;
+
+    @Resource(name = "AnswerQueue")
+    private Queue answerQueue;
+
+    public void test() throws Exception {
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+
+        final Connection connection = connectionFactory.createConnection();
+
+        connection.start();
+
+        final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        final MessageProducer questions = session.createProducer(questionQueue);
+
+        final MessageConsumer answers = session.createConsumer(answerQueue);
+
+        sendText("Hello World!", questions, session);
+
+        assertEquals("Hello, Test Case!", receiveText(answers));
+
+        sendText("How are you?", questions, session);
+
+        assertEquals("I'm doing well.", receiveText(answers));
+
+        sendText("Still spinning?", questions, session);
+
+        assertEquals("Once every day, as usual.", receiveText(answers));
+
+    }
+
+    private void sendText(String text, MessageProducer questions, Session session) throws JMSException {
+
+        questions.send(session.createTextMessage(text));
+
+    }
+
+    private String receiveText(MessageConsumer answers) throws JMSException {
+
+        return ((TextMessage) answers.receive(1000)).getText();
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-mdb-with-descriptor/src/main/java/org/superbiz/mdbdesc/ChatBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-mdb-with-descriptor/src/main/java/org/superbiz/mdbdesc/ChatBean.java b/examples/simple-mdb-with-descriptor/src/main/java/org/superbiz/mdbdesc/ChatBean.java
index 138c35f..3c481ca 100644
--- a/examples/simple-mdb-with-descriptor/src/main/java/org/superbiz/mdbdesc/ChatBean.java
+++ b/examples/simple-mdb-with-descriptor/src/main/java/org/superbiz/mdbdesc/ChatBean.java
@@ -1,93 +1,93 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.mdbdesc;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class ChatBean implements MessageListener {
-
-    private ConnectionFactory connectionFactory;
-
-    private Queue answerQueue;
-
-    public void onMessage(Message message) {
-        try {
-
-            final TextMessage textMessage = (TextMessage) message;
-            final String question = textMessage.getText();
-
-            if ("Hello World!".equals(question)) {
-
-                respond("Hello, Test Case!");
-
-            } else if ("How are you?".equals(question)) {
-
-                respond("I'm doing well.");
-
-            } else if ("Still spinning?".equals(question)) {
-
-                respond("Once every day, as usual.");
-
-            }
-        } catch (JMSException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private void respond(String text) throws JMSException {
-
-        Connection connection = null;
-        Session session = null;
-
-        try {
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create a Session
-            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-            // Create a MessageProducer from the Session to the Topic or Queue
-            MessageProducer producer = session.createProducer(answerQueue);
-            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-            // Create a message
-            TextMessage message = session.createTextMessage(text);
-
-            // Tell the producer to send the message
-            producer.send(message);
-        } finally {
-            // Clean up
-            if (session != null) {
-                session.close();
-            }
-            if (connection != null) {
-                connection.close();
-            }
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.mdbdesc;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class ChatBean implements MessageListener {
+
+    private ConnectionFactory connectionFactory;
+
+    private Queue answerQueue;
+
+    public void onMessage(Message message) {
+        try {
+
+            final TextMessage textMessage = (TextMessage) message;
+            final String question = textMessage.getText();
+
+            if ("Hello World!".equals(question)) {
+
+                respond("Hello, Test Case!");
+
+            } else if ("How are you?".equals(question)) {
+
+                respond("I'm doing well.");
+
+            } else if ("Still spinning?".equals(question)) {
+
+                respond("Once every day, as usual.");
+
+            }
+        } catch (JMSException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    private void respond(String text) throws JMSException {
+
+        Connection connection = null;
+        Session session = null;
+
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            // Create a Session
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Create a MessageProducer from the Session to the Topic or Queue
+            MessageProducer producer = session.createProducer(answerQueue);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+            // Create a message
+            TextMessage message = session.createTextMessage(text);
+
+            // Tell the producer to send the message
+            producer.send(message);
+        } finally {
+            // Clean up
+            if (session != null) {
+                session.close();
+            }
+            if (connection != null) {
+                connection.close();
+            }
+        }
+    }
+}
+//END SNIPPET: code


[33/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
Align SNAPSHOT versions & reformat examples


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f9f1b8ad
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f9f1b8ad
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f9f1b8ad

Branch: refs/heads/master
Commit: f9f1b8ad0fdec6b9f9455573b48ddad825846b22
Parents: 9abcc39
Author: andygumbrecht@apache.org <an...@gmx.de>
Authored: Fri Sep 25 12:42:02 2015 +0200
Committer: andygumbrecht@apache.org <an...@gmx.de>
Committed: Fri Sep 25 12:42:02 2015 +0200

----------------------------------------------------------------------
 .../org/superbiz/accesstimeout/BusyBee.java     | 132 ++--
 .../accesstimeout/api/AwaitBriefly.java         |  64 +-
 .../accesstimeout/api/AwaitForever.java         |  64 +-
 .../superbiz/accesstimeout/api/AwaitNever.java  |  62 +-
 .../org/superbiz/accesstimeout/BusyBeeTest.java | 164 ++--
 .../org/superbiz/accesstimeout/BusyBee.java     | 128 +--
 .../org/superbiz/accesstimeout/BusyBeeTest.java | 164 ++--
 .../src/main/java/org/superbiz/altdd/Movie.java | 122 +--
 .../main/java/org/superbiz/altdd/Movies.java    | 100 +--
 .../java/org/superbiz/altdd/MoviesTest.java     | 198 ++---
 .../java/org/superbiz/applet/Calculator.java    |  51 +-
 .../org/superbiz/applet/CalculatorApplet.java   | 201 +++--
 .../org/superbiz/applet/CalculatorImpl.java     |  57 +-
 .../test/java/org/superbiz/JNDILookupTest.java  |  93 ++-
 .../main/java/org/superbiz/composed/Movie.java  | 122 +--
 .../main/java/org/superbiz/composed/Movies.java |  62 +-
 .../java/org/superbiz/composed/MoviesImpl.java  | 100 +--
 .../java/org/superbiz/composed/MoviesTest.java  | 200 ++---
 examples/applicationcomposer-jaxws-cdi/pom.xml  |   2 +-
 .../java/org/superbiz/example/jaxws/Agenda.java |  46 +-
 .../org/superbiz/example/jaxws/LazyAgenda.java  |  52 +-
 .../superbiz/example/jaxws/MeetingPlanner.java  |  50 +-
 .../example/jaxws/MeetingPlannerImpl.java       |  64 +-
 .../example/jaxws/MeetingPlannerTest.java       | 131 ++--
 .../appexception/BusinessException.java         |  54 +-
 .../appexception/ThrowBusinessException.java    |  66 +-
 .../ThrowBusinessExceptionImpl.java             |  60 +-
 .../appexception/ValueRequiredException.java    |  48 +-
 .../ThrowBusinessExceptionImplTest.java         | 122 +--
 examples/arquillian-jpa/README.md               | 338 ++++----
 examples/arquillian-jpa/pom.xml                 |   2 +-
 .../superbiz/arquillian/persistence/User.java   |  86 +--
 .../test/persistence/PersistenceTest.java       | 129 ++--
 examples/async-methods/README.md                | 308 ++++----
 .../java/org/superbiz/async/JobProcessor.java   | 110 +--
 .../org/superbiz/async/JobProcessorTest.java    | 132 ++--
 examples/async-postconstruct/pom.xml            |   2 +-
 .../designbycontract/OlympicGamesManager.java   |  64 +-
 .../designbycontract/PoleVaultingManager.java   |  52 +-
 .../PoleVaultingManagerBean.java                |  56 +-
 .../WebApp1/pom.xml                             |   1 -
 .../org/superbiz/webapp1/ejb/BusinessBean.java  |  58 +-
 .../superbiz/webapp1/messages/ErrorList.java    |  74 +-
 .../webapp1/messages/ErrorResponse.java         | 154 ++--
 .../ConstraintViolationExceptionMapper.java     | 122 +--
 .../webapp1/service/WebApp1Service.java         |  78 +-
 .../WebApp2/pom.xml                             |   1 -
 .../superbiz/webapp2/messages/ErrorList.java    |  74 +-
 .../webapp2/messages/ErrorResponse.java         | 154 ++--
 .../ConstraintViolationExceptionMapper.java     | 122 +--
 .../webapp2/service/WebApp2Service.java         |  78 +-
 .../runner/src/test/java/RedeploymentTest.java  | 174 ++---
 .../cdi-alternative-and-stereotypes/README.md   | 252 +++---
 .../org/superbiz/cdi/stereotype/Journey.java    |  76 +-
 .../cdi/stereotype/LowCostCompanie.java         |  52 +-
 .../org/superbiz/cdi/stereotype/Society.java    |  46 +-
 .../org/superbiz/cdi/stereotype/Vehicle.java    |  46 +-
 .../org/superbiz/cdi/stereotype/AirOpenEJB.java |  78 +-
 .../java/org/superbiz/cdi/stereotype/Mock.java  |  76 +-
 .../superbiz/cdi/stereotype/StereotypeTest.java | 112 +--
 .../org/superbiz/cdi/stereotype/SuperCar.java   |  54 +-
 examples/cdi-application-scope/README.md        | 266 +++----
 .../org/superbiz/cdi/applicationscope/Soup.java |  78 +-
 .../superbiz/cdi/applicationscope/Waiter.java   |  76 +-
 .../cdi/applicationscope/RestaurantTest.java    | 110 +--
 .../java/org/superbiz/cdi/basic/Course.java     | 108 +--
 .../java/org/superbiz/cdi/basic/Faculty.java    |  90 +--
 .../java/org/superbiz/cdi/basic/CourseTest.java | 142 ++--
 .../superbiz/cdi/ejbcontext/LogginServlet.java  |  78 +-
 .../superbiz/cdi/ejbcontext/PrinciaplEjb.java   |  64 +-
 .../java/org/superbiz/cdi/events/Notifier.java  |  70 +-
 .../java/org/superbiz/cdi/events/EventTest.java | 146 ++--
 .../java/org/superbiz/cdi/events/Observer.java  |  86 +--
 .../org/superbiz/cdi/AccessDeniedException.java |  64 +-
 .../BookForAShowOldStyleInterceptorBinding.java | 106 +--
 .../BookForAShowOneInterceptorApplied.java      |  86 +--
 .../BookForAShowTwoInterceptorsApplied.java     |  90 +--
 ...owInterceptorBindingInheritanceExplored.java |  86 +--
 .../cdi/bookshow/interceptorbinding/Log.java    |  64 +-
 .../interceptorbinding/TimeRestrictAndLog.java  |  78 +-
 .../interceptorbinding/TimeRestricted.java      |  64 +-
 .../BookForAShowLoggingInterceptor.java         | 131 ++--
 .../TimeBasedRestrictingInterceptor.java        | 102 +--
 .../tracker/InterceptionOrderTracker.java       |  98 +--
 ...kForAShowOldStyleInterceptorBindingTest.java | 116 +--
 .../BookForAShowOneInterceptorAppliedTest.java  | 116 +--
 .../BookForAShowTwoInterceptorsAppiledTest.java | 140 ++--
 ...okShowInterceptorBindingInheritanceTest.java | 116 +--
 .../cdi/produces/disposes/ConsoleHandler.java   |  74 +-
 .../cdi/produces/disposes/DatabaseHandler.java  |  76 +-
 .../cdi/produces/disposes/FileHandler.java      |  76 +-
 .../cdi/produces/disposes/LogFactory.java       | 108 +--
 .../cdi/produces/disposes/LogHandler.java       |  50 +-
 .../superbiz/cdi/produces/disposes/Logger.java  |  50 +-
 .../cdi/produces/disposes/LoggerImpl.java       |  74 +-
 .../cdi/produces/disposes/LoggerTest.java       | 134 ++--
 examples/cdi-produces-field/README.md           |   2 +-
 .../cdi/produces/field/ConsoleHandler.java      |  16 +-
 .../cdi/produces/field/DatabaseHandler.java     |  16 +-
 .../cdi/produces/field/FileHandler.java         |  16 +-
 .../superbiz/cdi/produces/field/LogFactory.java |  16 +-
 .../superbiz/cdi/produces/field/LogHandler.java |  16 +-
 .../org/superbiz/cdi/produces/field/Logger.java |  16 +-
 .../superbiz/cdi/produces/field/LoggerImpl.java |  16 +-
 .../superbiz/cdi/produces/field/LoggerTest.java |  18 +-
 examples/cdi-realm/pom.xml                      |   2 +-
 .../src/main/java/org/superbiz/AuthBean.java    |  96 +--
 .../main/java/org/superbiz/SecuredServlet.java  |  64 +-
 .../test/java/org/superbiz/AuthBeanTest.java    | 204 ++---
 examples/cdi-request-scope/README.md            | 300 +++----
 .../org/superbiz/cdi/requestscope/Chef.java     |  62 +-
 .../org/superbiz/cdi/requestscope/Soup.java     |  78 +-
 .../org/superbiz/cdi/requestscope/Waiter.java   |  74 +-
 .../cdi/requestscope/RestaurantTest.java        | 110 +--
 .../org/superbiz/cdi/session/AnswerBean.java    |  80 +-
 .../org/superbiz/cdi/session/InputServlet.java  |  88 +--
 .../org/superbiz/cdi/session/OutputServlet.java |  84 +-
 .../org/superbiz/cdi/session/SessionBean.java   |  68 +-
 .../test/java/org/superbiz/jaxws/Rot13Test.java | 102 +--
 .../java/org/superbiz/client/SenderTest.java    | 110 +--
 .../main/java/org/superbiz/FriendlyPerson.java  | 252 +++---
 .../org/superbiz/FriendlyPersonEjbHome.java     |  58 +-
 .../superbiz/FriendlyPersonEjbLocalHome.java    |  58 +-
 .../superbiz/FriendlyPersonEjbLocalObject.java  |  70 +-
 .../org/superbiz/FriendlyPersonEjbObject.java   |  78 +-
 .../java/org/superbiz/FriendlyPersonLocal.java  |  78 +-
 .../java/org/superbiz/FriendlyPersonRemote.java |  76 +-
 .../java/org/superbiz/FriendlyPersonTest.java   | 360 ++++-----
 .../java/org/superbiz/enventries/Pickup.java    |  70 +-
 .../org/superbiz/enventries/PickupEditor.java   |  90 +--
 .../org/superbiz/enventries/Stratocaster.java   | 152 ++--
 .../java/org/superbiz/enventries/Style.java     |  60 +-
 .../superbiz/enventries/StratocasterTest.java   | 126 +--
 .../main/java/org/superbiz/dsdef/Persister.java |  20 +-
 .../dsdef/DataSourceDefinitionTest.java         |   6 +-
 examples/datasource-versioning/README.md        | 772 +++++++++----------
 .../org/superbiz/AlternateDataSourceTest.java   |   4 +-
 .../cdi/decorators/AccessDeniedException.java   |  60 +-
 .../org/superbiz/cdi/decorators/Calculator.java |  66 +-
 .../superbiz/cdi/decorators/CalculatorBean.java |  84 +-
 .../cdi/decorators/CalculatorLogging.java       | 120 +--
 .../cdi/decorators/CalculatorSecurity.java      | 130 ++--
 .../superbiz/cdi/decorators/CalculatorTest.java | 232 +++---
 .../org/superbiz/deltaspike/config/Counter.java |  74 +-
 .../deltaspike/config/MyConfigSource.java       | 158 ++--
 .../config/MyConfigSourceProvider.java          |  60 +-
 .../superbiz/deltaspike/config/ConfigTest.java  | 118 +--
 .../exceptionhandling/OSExceptionHandler.java   |  68 +-
 .../exceptionhandling/OSRuntimeException.java   |  42 +-
 .../exceptionhandling/OSValidator.java          |  70 +-
 .../ExceptionHandlingDemoTest.java              | 116 +--
 examples/deltaspike-fullstack/pom.xml           |   2 +-
 .../superbiz/deltaspike/CustomProjectStage.java |  62 +-
 .../superbiz/deltaspike/DebugPhaseListener.java | 102 ++-
 .../deltaspike/WebappMessageBundle.java         |  77 +-
 .../deltaspike/domain/AbstractDomainObject.java |  86 +--
 .../org/superbiz/deltaspike/domain/Comment.java | 111 ++-
 .../superbiz/deltaspike/domain/Feedback.java    | 145 ++--
 .../org/superbiz/deltaspike/domain/User.java    | 213 +++--
 .../domain/validation/DifferentName.java        |  77 +-
 .../validation/DifferentNameValidator.java      |  69 +-
 .../deltaspike/domain/validation/Full.java      |  53 +-
 .../deltaspike/domain/validation/Name.java      |  95 ++-
 .../deltaspike/domain/validation/Partial.java   |  43 +-
 .../domain/validation/UniqueUserName.java       |  43 +-
 .../deltaspike/domain/validation/UserName.java  |  89 ++-
 .../startup/ModuleStartupObserver.java          |  79 +-
 .../superbiz/deltaspike/view/FeedbackPage.java  | 154 ++--
 .../org/superbiz/deltaspike/view/InfoPage.java  |  73 +-
 .../org/superbiz/deltaspike/view/MenuBean.java  | 128 ++-
 .../deltaspike/view/RegistrationPage.java       | 191 +++--
 .../superbiz/deltaspike/view/UserHolder.java    | 112 ++-
 .../superbiz/deltaspike/view/config/Pages.java  | 106 +--
 .../view/security/LoginAccessDecisionVoter.java |  99 ++-
 .../superbiz/deltaspike/view/util/InfoBean.java | 284 ++++---
 .../superbiz/deltaspike/test/PageBeanTest.java  | 258 +++----
 .../superbiz/deltaspike/i18n/MessageHelper.java |  54 +-
 .../deltaspike/i18n/MessageHelperTest.java      | 112 +--
 .../main/java/org/superbiz/dynamic/User.java    | 122 +--
 .../BoostrapUtility.java                        | 102 +--
 .../DeterminedRouter.java                       | 214 ++---
 .../dynamicdatasourcerouting/Person.java        | 106 +--
 .../RoutedPersister.java                        |  74 +-
 .../org/superbiz/dynamic/SocialInterceptor.java |  80 +-
 .../dynamic/mbean/DynamicMBeanHandler.java      | 520 ++++++-------
 .../org/superbiz/dynamic/mbean/ObjectName.java  |  78 +-
 .../dynamic/mbean/DynamicMBeanClient.java       |  72 +-
 .../dynamic/mbean/DynamicMBeanClientTest.java   | 216 +++---
 .../dynamic/mbean/DynamicRemoteMBeanClient.java |  80 +-
 .../superbiz/dynamic/mbean/simple/Simple.java   |  82 +-
 .../dynamic/mbean/simple/SimpleMBean.java       |  54 +-
 examples/ear-testing/README.md                  | 424 +++++-----
 .../main/java/org/superbiz/logic/Movies.java    |  66 +-
 .../java/org/superbiz/logic/MoviesImpl.java     | 100 +--
 .../java/org/superbiz/logic/MoviesTest.java     | 128 +--
 .../src/main/java/org/superbiz/model/Movie.java | 124 +--
 .../java/org/superbiz/servlet/AnnotatedEJB.java | 105 ++-
 .../org/superbiz/servlet/AnnotatedEJBLocal.java |  65 +-
 .../superbiz/servlet/AnnotatedEJBRemote.java    |  55 +-
 .../org/superbiz/servlet/AnnotatedServlet.java  | 175 +++--
 .../org/superbiz/servlet/ClientHandler.java     |  73 +-
 .../java/org/superbiz/servlet/HelloEjb.java     |  51 +-
 .../org/superbiz/servlet/HelloEjbService.java   |  81 +-
 .../java/org/superbiz/servlet/HelloPojo.java    |  51 +-
 .../org/superbiz/servlet/HelloPojoService.java  |  77 +-
 .../java/org/superbiz/servlet/JndiServlet.java  | 169 ++--
 .../main/java/org/superbiz/servlet/JpaBean.java | 101 ++-
 .../java/org/superbiz/servlet/JpaServlet.java   | 145 ++--
 .../java/org/superbiz/servlet/ResourceBean.java |  69 +-
 .../java/org/superbiz/servlet/RunAsServlet.java | 185 +++--
 .../java/org/superbiz/servlet/SecureEJB.java    | 123 ++-
 .../org/superbiz/servlet/SecureEJBLocal.java    |  73 +-
 .../org/superbiz/servlet/SecureServlet.java     | 185 +++--
 .../org/superbiz/servlet/ServerHandler.java     |  75 +-
 .../org/superbiz/servlet/WebserviceClient.java  | 159 ++--
 .../org/superbiz/servlet/WebserviceServlet.java | 139 ++--
 .../main/java/org/superbiz/ws/Calculator.java   |  74 +-
 .../main/java/org/superbiz/hello/HelloBean.java |  66 +-
 .../java/org/superbiz/hello/HelloEjbLocal.java  |  56 +-
 .../org/superbiz/hello/HelloEjbLocalHome.java   |  56 +-
 .../test/java/org/superbiz/hello/HelloTest.java |  84 +-
 .../org/superbiz/injection/jms/Messages.java    | 212 ++---
 .../injection/jms/MessagingBeanTest.java        |  84 +-
 .../main/java/org/superbiz/injection/Movie.java | 122 +--
 .../java/org/superbiz/injection/Movies.java     | 212 ++---
 .../java/org/superbiz/injection/MoviesTest.java | 108 +--
 .../java/org/superbiz/injection/DataReader.java | 118 +--
 .../java/org/superbiz/injection/DataStore.java  |  78 +-
 .../org/superbiz/injection/DataStoreLocal.java  |  68 +-
 .../org/superbiz/injection/DataStoreRemote.java |  66 +-
 .../superbiz/injection/EjbDependencyTest.java   |  84 +-
 .../java/org/superbiz/injection/jpa/Movie.java  | 152 ++--
 .../java/org/superbiz/injection/jpa/Movies.java |  96 +--
 .../org/superbiz/injection/jpa/MoviesTest.java  | 114 +--
 .../injection/enventry/Configuration.java       | 126 +--
 .../org/superbiz/injection/enventry/Widget.java |  54 +-
 .../injection/enventry/ConfigurationTest.java   |  90 +--
 .../interceptors/ClassLevelInterceptorOne.java  |  64 +-
 .../ClassLevelInterceptorSuperClassOne.java     |  64 +-
 .../ClassLevelInterceptorSuperClassTwo.java     |  64 +-
 .../interceptors/ClassLevelInterceptorTwo.java  |  64 +-
 .../interceptors/DefaultInterceptorOne.java     |  74 +-
 .../interceptors/DefaultInterceptorTwo.java     |  64 +-
 .../superbiz/interceptors/FullyIntercepted.java |  60 +-
 .../interceptors/FullyInterceptedBean.java      | 106 +--
 .../FullyInterceptedSuperClass.java             |  54 +-
 .../interceptors/MethodLevelInterceptorOne.java |  62 +-
 .../MethodLevelInterceptorOnlyIntf.java         |  50 +-
 .../MethodLevelInterceptorOnlyParent.java       |  48 +-
 .../MethodLevelInterceptorOnlySLSBean.java      |  70 +-
 .../interceptors/MethodLevelInterceptorTwo.java |  62 +-
 .../SecondStatelessInterceptedBean.java         |  90 +--
 .../SecondStatelessInterceptedLocal.java        |  54 +-
 .../SuperClassOfClassLevelInterceptor.java      |  74 +-
 .../org/superbiz/interceptors/ThirdSLSBean.java | 110 +--
 .../interceptors/ThirdSLSBeanLocal.java         |  58 +-
 .../java/org/superbiz/interceptors/Utils.java   |  76 +-
 .../interceptors/FullyInterceptedTest.java      | 188 ++---
 .../MethodLevelInterceptorOnlyTest.java         | 114 +--
 .../SecondStatelessInterceptedTest.java         | 126 +--
 .../superbiz/interceptors/ThirdSLSBeanTest.java | 156 ++--
 .../java/org/superbiz/rest/EmailService.java    |  16 +-
 .../org/superbiz/rest/EmailServiceTest.java     |  16 +-
 .../java/org/superbiz/eclipselink/Movie.java    | 136 ++--
 .../java/org/superbiz/eclipselink/Movies.java   |  90 +--
 .../org/superbiz/eclipselink/MoviesTest.java    | 108 +--
 .../main/java/org/superbiz/jpa/enums/Movie.java | 158 ++--
 .../java/org/superbiz/jpa/enums/Movies.java     | 108 +--
 .../java/org/superbiz/jpa/enums/MoviesTest.java | 108 +--
 .../org/superbiz/injection/h3jpa/Movie.java     | 136 ++--
 .../org/superbiz/injection/h3jpa/Movies.java    |  90 +--
 .../superbiz/injection/h3jpa/MoviesTest.java    | 106 +--
 .../main/java/org/superbiz/jsf/Calculator.java  |  57 +-
 .../main/java/org/superbiz/jsf/Calculator.java  |  51 +-
 .../java/org/superbiz/jsf/CalculatorImpl.java   |  57 +-
 .../java/org/superbiz/ejblookup/BlueBean.java   |  78 +-
 .../java/org/superbiz/ejblookup/Friend.java     |  68 +-
 .../java/org/superbiz/ejblookup/RedBean.java    |  76 +-
 .../superbiz/ejblookup/EjbDependencyTest.java   | 108 +--
 .../java/org/superbiz/ejblookup/BlueBean.java   |  86 +--
 .../java/org/superbiz/ejblookup/Friend.java     |  74 +-
 .../java/org/superbiz/ejblookup/RedBean.java    |  84 +-
 .../superbiz/ejblookup/EjbDependencyTest.java   | 108 +--
 .../org/superbiz/mbean/GuessHowManyMBean.java   |  96 +--
 .../superbiz/mbean/GuessHowManyMBeanTest.java   | 102 +--
 examples/moviefun-rest/pom.xml                  |   2 +-
 .../main/java/org/superbiz/moviefun/Movie.java  | 202 ++---
 .../java/org/superbiz/moviefun/MoviesBean.java  | 180 ++---
 .../moviefun/rest/ApplicationConfig.java        |  64 +-
 .../org/superbiz/moviefun/rest/LoadRest.java    |  82 +-
 .../org/superbiz/moviefun/rest/MoviesRest.java  | 158 ++--
 .../org/superbiz/moviefun/MoviesEJBTest.java    | 154 ++--
 .../moviefun/MoviesEmbeddedEJBTest.java         | 148 ++--
 .../java/org/superbiz/moviefun/MoviesTest.java  | 148 ++--
 examples/moviefun/pom.xml                       |   2 +-
 .../org/superbiz/moviefun/ActionServlet.java    | 276 +++----
 .../main/java/org/superbiz/moviefun/Movie.java  | 206 ++---
 .../java/org/superbiz/moviefun/MoviesBean.java  | 228 +++---
 .../java/org/superbiz/moviefun/Basedir.java     |  68 +-
 .../moviefun/MoviesArquillianHtmlUnitTest.java  | 218 +++---
 .../org/superbiz/moviefun/MoviesEJBTest.java    | 156 ++--
 .../moviefun/MoviesEmbeddedEJBTest.java         | 148 ++--
 .../superbiz/moviefun/MoviesHtmlUnitTest.java   | 206 ++---
 .../java/org/superbiz/moviefun/MoviesTest.java  | 148 ++--
 .../superbiz/injection/tx/AddInterceptor.java   |  62 +-
 .../injection/tx/DeleteInterceptor.java         |  64 +-
 .../java/org/superbiz/injection/tx/Movie.java   | 122 +--
 .../java/org/superbiz/injection/tx/Movies.java  | 104 +--
 .../org/superbiz/injection/tx/api/Metatype.java |  58 +-
 .../superbiz/injection/tx/api/MovieUnit.java    |  66 +-
 .../org/superbiz/injection/tx/MoviesTest.java   | 284 +++----
 .../superbiz/injection/tx/AddInterceptor.java   |  62 +-
 .../injection/tx/DeleteInterceptor.java         |  64 +-
 .../java/org/superbiz/injection/tx/Movie.java   | 122 +--
 .../java/org/superbiz/injection/tx/Movies.java  | 119 ++-
 .../org/superbiz/injection/tx/MoviesTest.java   | 284 +++----
 .../java/org/superbiz/mtom/AbstractService.java |  16 +-
 .../main/java/org/superbiz/mtom/EjbService.java |  16 +-
 .../java/org/superbiz/mtom/PojoService.java     |  16 +-
 .../main/java/org/superbiz/mtom/Request.java    |  16 +-
 .../main/java/org/superbiz/mtom/Response.java   |  16 +-
 .../main/java/org/superbiz/mtom/Service.java    |  16 +-
 .../org/superbiz/mtom/AbstractServiceTest.java  |  16 +-
 .../java/org/superbiz/mtom/EjbServiceTest.java  |  16 +-
 .../java/org/superbiz/mtom/PojoServiceTest.java |  16 +-
 .../main/java/org/superbiz/model/Person.java    |  86 +--
 .../src/test/java/org/superbiz/JPATest.java     | 118 +--
 .../enricher/jpa/HibernateEnricher.java         |  58 +-
 .../org/superbiz/enricher/jpa/JPAEnrichers.java |  78 +-
 .../superbiz/enricher/jpa/OpenJPAEnricher.java  |  58 +-
 .../org/superbiz/enricher/maven/Enrichers.java  | 123 ++-
 .../src/main/java/org/superbiz/SomeEJB.java     |  54 +-
 .../src/main/java/org/superbiz/SomeRest.java    |  64 +-
 .../embedded/remote/EmbeddedRemote.java         |  42 +-
 .../remote/OpenEJBEmbeddedRemoteTest.java       |  96 +--
 .../superbiz/embedded/standalone/Embedded.java  |  42 +-
 .../standalone/OpenEJBEmbeddedTest.java         | 100 +--
 .../superbiz/tomee/embedded/TomEEEmbedded.java  |  42 +-
 .../tomee/embedded/TomEEEmbeddedTest.java       | 100 +--
 .../org/superbiz/tomee/remote/TomEERemote.java  |  42 +-
 .../superbiz/tomee/remote/TomEERemoteTest.java  | 106 +--
 .../arquillian/multiple/MultipleTomEETest.java  | 132 ++--
 examples/myfaces-codi-demo/pom.xml              |   2 +-
 .../jpa/AbstractGenericJpaRepository.java       | 192 ++---
 .../myfaces/startup/ExtValLifecycleFactory.java |  48 +-
 .../superbiz/myfaces/view/RegistrationPage.java | 200 ++---
 .../org/superbiz/myfaces/view/config/Pages.java | 132 ++--
 .../superbiz/myfaces/view/util/InfoBean.java    | 256 +++---
 .../java/org/superbiz/injection/jpa/Movie.java  | 140 ++--
 .../org/superbiz/injection/jpa/MoviesTest.java  | 100 +--
 .../main/java/org/superbiz/ws/pojo/PojoWS.java  |  90 +--
 .../src/main/java/org/superbiz/ws/pojo/WS.java  |  50 +-
 .../src/main/java/jug/client/Client.java        | 168 ++--
 .../jug/client/command/api/AbstractCommand.java | 176 ++---
 .../java/jug/client/command/api/Command.java    |  68 +-
 .../client/command/impl/BestPollCommand.java    |  62 +-
 .../jug/client/command/impl/ExitCommand.java    |  74 +-
 .../jug/client/command/impl/HelpCommand.java    | 106 +--
 .../jug/client/command/impl/NewPollCommand.java |  66 +-
 .../client/command/impl/PollResultCommand.java  |  80 +-
 .../jug/client/command/impl/PollsCommand.java   |  62 +-
 .../command/impl/QueryAndPostCommand.java       |  96 +--
 .../client/command/impl/ShowPollCommand.java    |  80 +-
 .../command/impl/SwitchClientCommand.java       |  94 +--
 .../jug/client/command/impl/VoteCommand.java    |  90 +--
 .../java/jug/client/util/ClientNameHolder.java  |  60 +-
 .../java/jug/client/util/CommandManager.java    | 148 ++--
 .../util/ConfigurableClasspathArchive.java      | 392 +++++-----
 .../src/main/java/jug/dao/SubjectDao.java       | 230 +++---
 .../src/main/java/jug/dao/VoteDao.java          |  84 +-
 .../src/test/java/jug/dao/SubjectDaoTest.java   | 198 ++---
 .../src/main/java/jug/domain/Result.java        | 134 ++--
 .../src/main/java/jug/domain/Subject.java       | 212 ++---
 .../src/main/java/jug/domain/Value.java         |  44 +-
 .../src/main/java/jug/domain/Vote.java          | 104 +--
 .../main/java/jug/monitoring/VoteCounter.java   | 120 +--
 .../main/java/jug/rest/PollingApplication.java  |  64 +-
 .../src/main/java/jug/rest/SubjectService.java  | 224 +++---
 .../java/jug/routing/DataSourceInitializer.java |  96 +--
 .../main/java/jug/routing/PollingRouter.java    | 158 ++--
 .../main/java/jug/routing/RoutingFilter.java    | 144 ++--
 .../test/java/jug/rest/SubjectServiceTest.java  | 160 ++--
 .../arquillian/SubjectServiceTomEETest.java     | 167 ++--
 examples/pom.xml                                |   9 +-
 examples/projectstage-demo/pom.xml              |   2 +-
 .../src/main/java/org/superbiz/Manager.java     |  60 +-
 .../main/java/org/superbiz/ManagerFactory.java  |  76 +-
 .../projectstage/BaseTestForProjectStage.java   | 114 +--
 .../projectstage/DevProjectStageTest.java       |  76 +-
 .../ProductionProjectStageTest.java             |  58 +-
 .../projectstage/TestingProjectStageTest.java   |  76 +-
 .../projectstage/util/ProjectStageProducer.java | 156 ++--
 examples/quartz-app/quartz-beans/pom.xml        |   2 +-
 .../main/java/org/superbiz/quartz/JobBean.java  | 130 ++--
 .../java/org/superbiz/quartz/QuartzMdb.java     |  70 +-
 .../java/org/superbiz/quartz/QuartzMdbTest.java | 134 ++--
 .../java/org/superbiz/reloadable/pu/Person.java | 108 +--
 .../superbiz/reloadable/pu/PersonManager.java   |  88 +--
 .../reloadable/pu/CacheActivationTest.java      | 220 +++---
 examples/resources-jmx-example/README.md        |  38 +-
 examples/resources-jmx-example/pom.xml          |   4 +-
 .../resources-jmx-ear/pom.xml                   |   2 +-
 .../resources-jmx-ejb/pom.xml                   |   2 +-
 .../resource/jmx/factory/Converter.java         |   9 +-
 .../superbiz/resource/jmx/factory/Editors.java  |   4 +-
 .../resource/jmx/factory/JMXBeanCreator.java    |   2 +-
 .../resource/jmx/factory/PrimitiveTypes.java    |   1 +
 .../resource/jmx/resources/Alternative.java     |   2 +-
 .../java/org/superbiz/resource/jmx/JMXTest.java |  18 +-
 .../superbiz/composed/rest/GreetingService.java |  70 +-
 .../org/superbiz/composed/rest/Messager.java    |  44 +-
 .../composed/rest/GreetingServiceTest.java      | 134 ++--
 .../superbiz/composed/rest/GreetingService.java |  58 +-
 .../rest/IllegalArgumentExceptionMapper.java    |  60 +-
 .../composed/rest/GreetingServiceTest.java      | 154 ++--
 .../main/java/org/superbiz/rest/Greeting.java   |   6 +-
 .../java/org/superbiz/rest/GreetingService.java | 132 ++--
 .../main/java/org/superbiz/rest/Request.java    |  82 +-
 .../main/java/org/superbiz/rest/Response.java   |  82 +-
 .../org/superbiz/rest/GreetingServiceTest.java  | 174 ++---
 .../rest/batcher/SampleDataManager.java         | 160 ++--
 .../java/org/superbiz/rest/dao/PostDAO.java     | 144 ++--
 .../java/org/superbiz/rest/dao/UserDAO.java     | 130 ++--
 .../java/org/superbiz/rest/model/Comment.java   | 150 ++--
 .../main/java/org/superbiz/rest/model/Post.java | 182 ++---
 .../main/java/org/superbiz/rest/model/User.java | 138 ++--
 .../org/superbiz/rest/dao/UserServiceTest.java  | 182 ++---
 .../jaxrs/jaas/JAASSecuredRestEndpoint.java     |  84 +-
 .../src/main/java/org/superbiz/rest/User.java   | 200 ++---
 .../java/org/superbiz/rest/GreetingService.java |  80 +-
 .../main/java/org/superbiz/rest/Request.java    |  82 +-
 .../main/java/org/superbiz/rest/Response.java   |  82 +-
 .../org/superbiz/rest/GreetingServiceTest.java  |  16 +-
 .../superbiz/schedule/events/SchedulerTest.java | 156 ++--
 .../java/org/superbiz/corn/FarmerBrown.java     | 174 ++---
 .../java/org/superbiz/corn/FarmerBrownTest.java |  86 +--
 .../org/superbiz/corn/meta/FarmerBrown.java     | 108 +--
 .../org/superbiz/corn/meta/api/BiAnnually.java  |  72 +-
 .../org/superbiz/corn/meta/api/BiMonthly.java   |  72 +-
 .../java/org/superbiz/corn/meta/api/Daily.java  |  72 +-
 .../org/superbiz/corn/meta/api/HarvestTime.java |  80 +-
 .../java/org/superbiz/corn/meta/api/Hourly.java |  72 +-
 .../org/superbiz/corn/meta/api/Metatype.java    |  58 +-
 .../superbiz/corn/meta/api/PlantingTime.java    |  82 +-
 .../org/superbiz/corn/meta/api/Secondly.java    |  72 +-
 .../org/superbiz/corn/meta/FarmerBrownTest.java |  84 +-
 .../java/org/superbiz/corn/FarmerBrown.java     | 122 +--
 .../java/org/superbiz/corn/FarmerBrownTest.java |  84 +-
 .../java/org/superbiz/event/ListenerTest.java   |  92 +--
 .../superbiz/cdi/bookshow/beans/BookShow.java   |  86 +--
 .../cdi/bookshow/interceptorbinding/Log.java    |  64 +-
 .../interceptors/LoggingInterceptor.java        | 121 +--
 .../cdi/bookshow/interceptors/BookShowTest.java | 102 +--
 .../src/main/java/org/superbiz/cmp2/Movie.java  |  78 +-
 .../main/java/org/superbiz/cmp2/MovieBean.java  |  98 +--
 .../src/main/java/org/superbiz/cmp2/Movies.java |  70 +-
 .../test/java/org/superbiz/cmp2/MoviesTest.java | 120 +--
 .../main/java/org/superbiz/mdb/ChatBean.java    | 186 ++---
 .../org/superbiz/mdb/ChatRespondCreator.java    |  64 +-
 .../java/org/superbiz/mdb/ChatBeanTest.java     | 168 ++--
 .../java/org/superbiz/mdbdesc/ChatBean.java     | 186 ++---
 .../java/org/superbiz/mdbdesc/ChatBeanTest.java | 170 ++--
 .../main/java/org/superbiz/mdb/ChatBean.java    | 196 ++---
 .../java/org/superbiz/mdb/ChatBeanTest.java     | 168 ++--
 .../java/org/superbiz/rest/GreetingService.java |  70 +-
 .../org/superbiz/rest/GreetingServiceTest.java  | 106 +--
 examples/simple-singleton/README.md             | 688 ++++++++---------
 .../superbiz/registry/ComponentRegistry.java    | 106 +--
 .../org/superbiz/registry/PropertyRegistry.java | 124 +--
 .../registry/ComponentRegistryTest.java         | 144 ++--
 .../registry/PropertiesRegistryTest.java        | 118 +--
 .../org/superbiz/counter/CallbackCounter.java   | 146 ++--
 .../org/superbiz/counter/ExecutionChannel.java  |  82 +-
 .../org/superbiz/counter/ExecutionObserver.java |  46 +-
 .../superbiz/counter/CounterCallbacksTest.java  | 250 +++---
 .../main/java/org/superbiz/counter/Counter.java | 108 +--
 .../java/org/superbiz/counter/CounterTest.java  | 108 +--
 .../stateless/basic/CalculatorBean.java         | 126 +--
 .../stateless/basic/ExecutionChannel.java       |  82 +-
 .../stateless/basic/ExecutionObserver.java      |  46 +-
 .../stateless/basic/CalculatorTest.java         | 178 ++---
 .../org/superbiz/calculator/CalculatorImpl.java |  74 +-
 .../superbiz/calculator/CalculatorLocal.java    |  60 +-
 .../superbiz/calculator/CalculatorRemote.java   |  62 +-
 .../org/superbiz/calculator/CalculatorTest.java | 144 ++--
 .../stateless/basic/CalculatorBean.java         |  96 +--
 .../stateless/basic/CalculatorTest.java         | 214 ++---
 .../org/superbiz/calculator/Calculator.java     |  72 +-
 .../org/superbiz/calculator/CalculatorTest.java | 140 ++--
 .../org/superbiz/calculator/ws/Calculator.java  |  74 +-
 .../superbiz/calculator/ws/CalculatorWs.java    |  54 +-
 .../superbiz/calculator/ws/CalculatorTest.java  | 124 +--
 .../java/org/superbiz/dynamic/api/Metatype.java |  60 +-
 .../superbiz/dynamic/api/SpringRepository.java  |  72 +-
 .../dynamic/framework/SpringDataProxy.java      | 100 +--
 .../org/superbiz/dynamic/SpringDataProxy.java   | 100 +--
 .../main/java/org/superbiz/struts/AddUser.java  | 160 ++--
 .../main/java/org/superbiz/struts/FindUser.java | 142 ++--
 .../java/org/superbiz/struts/ListAllUsers.java  | 144 ++--
 .../java/org/superbiz/telephone/Telephone.java  |  52 +-
 .../org/superbiz/telephone/TelephoneBean.java   | 114 +--
 .../org/superbiz/telephone/TelephoneTest.java   | 230 +++---
 .../java/org/superbiz/testinjection/Movie.java  | 122 +--
 .../java/org/superbiz/testinjection/Movies.java | 100 +--
 .../org/superbiz/testinjection/MoviesTest.java  | 150 ++--
 .../org/superbiz/injection/secure/Movie.java    | 122 +--
 .../org/superbiz/injection/secure/Movies.java   | 110 +--
 .../superbiz/injection/secure/MovieTest.java    | 306 ++++----
 .../org/superbiz/injection/secure/UserInfo.java |  72 +-
 .../org/superbiz/injection/secure/Movie.java    | 122 +--
 .../org/superbiz/injection/secure/Movies.java   | 110 +--
 .../injection/secure/MyLoginProvider.java       |  78 +-
 .../superbiz/injection/secure/MovieTest.java    | 314 ++++----
 .../superbiz/injection/secure/LoginBean.java    |  78 +-
 .../org/superbiz/injection/secure/Movie.java    | 122 +--
 .../org/superbiz/injection/secure/Movies.java   | 110 +--
 .../superbiz/injection/secure/MovieTest.java    | 322 ++++----
 .../org/superbiz/injection/secure/Movie.java    | 122 +--
 .../org/superbiz/injection/secure/Movies.java   | 106 +--
 .../injection/secure/api/AddPermission.java     |  72 +-
 .../injection/secure/api/DeletePermission.java  |  72 +-
 .../superbiz/injection/secure/api/Metatype.java |  58 +-
 .../injection/secure/api/MovieUnit.java         |  66 +-
 .../injection/secure/api/ReadPermission.java    |  78 +-
 .../injection/secure/api/RunAsEmployee.java     |  62 +-
 .../injection/secure/api/RunAsManager.java      |  62 +-
 .../superbiz/injection/secure/MovieTest.java    | 316 ++++----
 .../org/superbiz/injection/secure/Movie.java    | 122 +--
 .../org/superbiz/injection/secure/Movies.java   | 110 +--
 .../superbiz/injection/secure/MovieTest.java    | 334 ++++----
 .../java/org/superbiz/injection/tx/Movie.java   | 148 ++--
 .../java/org/superbiz/injection/tx/Movies.java  | 124 +--
 .../org/superbiz/injection/tx/MoviesTest.java   | 100 +--
 .../java/org/superbiz/injection/tx/Movie.java   | 122 +--
 .../java/org/superbiz/injection/tx/Movies.java  | 100 +--
 .../org/superbiz/injection/tx/MoviesTest.java   | 214 ++---
 .../main/java/org/superbiz/dao/PersonDAO.java   |  90 +--
 .../main/java/org/superbiz/domain/Person.java   | 100 +--
 .../java/org/superbiz/init/Initializer.java     |  76 +-
 .../org/superbiz/service/JerseyApplication.java |  62 +-
 .../org/superbiz/service/PersonService.java     | 102 +--
 .../txrollback/CustomRuntimeException.java      |  76 +-
 .../java/org/superbiz/txrollback/Movie.java     | 136 ++--
 .../java/org/superbiz/txrollback/Movies.java    | 124 +--
 .../org/superbiz/txrollback/MoviesTest.java     | 442 +++++------
 .../org/superbiz/troubleshooting/Movie.java     | 136 ++--
 .../org/superbiz/troubleshooting/Movies.java    |  92 +--
 .../superbiz/troubleshooting/MoviesTest.java    | 202 ++---
 .../org/superbiz/attachment/AttachmentImpl.java | 158 ++--
 .../org/superbiz/attachment/AttachmentWs.java   |  70 +-
 .../org/superbiz/attachment/AttachmentTest.java | 184 ++---
 .../org/superbiz/calculator/wsh/Calculator.java |  78 +-
 .../superbiz/calculator/wsh/CalculatorWs.java   |  54 +-
 .../org/superbiz/calculator/wsh/Increment.java  | 126 +--
 .../org/superbiz/calculator/wsh/Inflate.java    | 128 +--
 .../superbiz/calculator/wsh/CalculatorTest.java | 126 +--
 .../java/org/superbiz/ws/out/Calculator.java    |  76 +-
 .../java/org/superbiz/ws/out/CalculatorWs.java  |  52 +-
 .../org/superbiz/ws/out/CalculatorTest.java     | 136 ++--
 .../java/org/superbiz/inheritance/Item.java     | 138 ++--
 .../java/org/superbiz/inheritance/Tower.java    |  98 +--
 .../org/superbiz/inheritance/WakeRiderImpl.java | 112 +--
 .../org/superbiz/inheritance/WakeRiderWs.java   |  70 +-
 .../org/superbiz/inheritance/Wakeboard.java     |  48 +-
 .../superbiz/inheritance/WakeboardBinding.java  |  48 +-
 .../java/org/superbiz/inheritance/Wearable.java |  66 +-
 .../superbiz/inheritance/InheritanceTest.java   | 314 ++++----
 .../org/superbiz/calculator/CalculatorImpl.java | 100 +--
 .../superbiz/calculator/CalculatorRemote.java   |  56 +-
 .../org/superbiz/calculator/CalculatorWs.java   |  70 +-
 .../org/superbiz/calculator/CalculatorTest.java | 138 ++--
 .../org/superbiz/calculator/CalculatorImpl.java | 104 +--
 .../superbiz/calculator/CalculatorRemote.java   |  56 +-
 .../org/superbiz/calculator/CalculatorWs.java   |  70 +-
 .../org/superbiz/calculator/CalculatorTest.java | 636 +++++++--------
 .../calculator/CustomPasswordHandler.java       |  88 +--
 .../org/superbiz/ws/security/Calculator.java    |  50 +-
 .../superbiz/ws/security/CalculatorBean.java    |  60 +-
 .../ws/security/PasswordCallbackHandler.java    |  88 +--
 579 files changed, 30766 insertions(+), 30862 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/BusyBee.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/BusyBee.java b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/BusyBee.java
index 833d4d0..420bcc3 100644
--- a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/BusyBee.java
+++ b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/BusyBee.java
@@ -1,66 +1,66 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout;
-
-import org.superbiz.accesstimeout.api.AwaitBriefly;
-import org.superbiz.accesstimeout.api.AwaitForever;
-import org.superbiz.accesstimeout.api.AwaitNever;
-
-import javax.ejb.Asynchronous;
-import javax.ejb.Lock;
-import javax.ejb.Singleton;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
-
-import static javax.ejb.LockType.WRITE;
-
-/**
- * @version $Revision$ $Date$
- */
-@Singleton
-@Lock(WRITE)
-public class BusyBee {
-
-    @Asynchronous
-    public Future stayBusy(CountDownLatch ready) {
-        ready.countDown();
-
-        try {
-            new CountDownLatch(1).await();
-        } catch (InterruptedException e) {
-            Thread.interrupted();
-        }
-
-        return null;
-    }
-
-    @AwaitNever
-    public void doItNow() {
-        // do something
-    }
-
-    @AwaitBriefly
-    public void doItSoon() {
-        // do something
-    }
-
-    @AwaitForever
-    public void justDoIt() {
-        // do something
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout;
+
+import org.superbiz.accesstimeout.api.AwaitBriefly;
+import org.superbiz.accesstimeout.api.AwaitForever;
+import org.superbiz.accesstimeout.api.AwaitNever;
+
+import javax.ejb.Asynchronous;
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
+
+import static javax.ejb.LockType.WRITE;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Singleton
+@Lock(WRITE)
+public class BusyBee {
+
+    @Asynchronous
+    public Future stayBusy(CountDownLatch ready) {
+        ready.countDown();
+
+        try {
+            new CountDownLatch(1).await();
+        } catch (InterruptedException e) {
+            Thread.interrupted();
+        }
+
+        return null;
+    }
+
+    @AwaitNever
+    public void doItNow() {
+        // do something
+    }
+
+    @AwaitBriefly
+    public void doItSoon() {
+        // do something
+    }
+
+    @AwaitForever
+    public void justDoIt() {
+        // do something
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitBriefly.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitBriefly.java b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitBriefly.java
index e9540b0..f42494a 100644
--- a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitBriefly.java
+++ b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitBriefly.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout.api;
-
-import javax.ejb.AccessTimeout;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.concurrent.TimeUnit;
-
-@Metatype
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-
-@AccessTimeout(value = 5, unit = TimeUnit.SECONDS)
-public @interface AwaitBriefly {
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout.api;
+
+import javax.ejb.AccessTimeout;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+@Metatype
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+
+@AccessTimeout(value = 5, unit = TimeUnit.SECONDS)
+public @interface AwaitBriefly {
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitForever.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitForever.java b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitForever.java
index 1be4545..f40d43c 100644
--- a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitForever.java
+++ b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitForever.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout.api;
-
-import javax.ejb.AccessTimeout;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-
-@AccessTimeout(-1)
-public @interface AwaitForever {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout.api;
+
+import javax.ejb.AccessTimeout;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+
+@AccessTimeout(-1)
+public @interface AwaitForever {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitNever.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitNever.java b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitNever.java
index ed0085b..d3ad371 100644
--- a/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitNever.java
+++ b/examples/access-timeout-meta/src/main/java/org/superbiz/accesstimeout/api/AwaitNever.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout.api;
-
-import javax.ejb.AccessTimeout;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-
-@AccessTimeout(1)
-public @interface AwaitNever {
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout.api;
+
+import javax.ejb.AccessTimeout;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+
+@AccessTimeout(1)
+public @interface AwaitNever {
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout-meta/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout-meta/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java b/examples/access-timeout-meta/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
index 910dd09..7d0e498 100644
--- a/examples/access-timeout-meta/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
+++ b/examples/access-timeout-meta/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
@@ -1,82 +1,82 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @version $Revision$ $Date$
- */
-public class BusyBeeTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final CountDownLatch ready = new CountDownLatch(1);
-
-        final BusyBee busyBee = (BusyBee) context.lookup("java:global/access-timeout-meta/BusyBee");
-
-        // This asynchronous method will never exit 
-        busyBee.stayBusy(ready);
-
-        // Are you working yet little bee?
-        ready.await();
-
-        // OK, Bee is busy
-
-        { // Timeout Immediately
-            final long start = System.nanoTime();
-
-            try {
-                busyBee.doItNow();
-
-                fail("The bee should be busy");
-            } catch (Exception e) {
-                // the bee is still too busy as expected
-            }
-
-            assertEquals(0, seconds(start));
-        }
-
-        { // Timeout in 5 seconds
-            final long start = System.nanoTime();
-
-            try {
-                busyBee.doItSoon();
-
-                fail("The bee should be busy");
-            } catch (Exception e) {
-                // the bee is still too busy as expected
-            }
-
-            assertEquals(5, seconds(start));
-        }
-
-        // This will wait forever, give it a try if you have that long
-        //busyBee.justDoIt();
-    }
-
-    private long seconds(long start) {
-        return TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class BusyBeeTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final CountDownLatch ready = new CountDownLatch(1);
+
+        final BusyBee busyBee = (BusyBee) context.lookup("java:global/access-timeout-meta/BusyBee");
+
+        // This asynchronous method will never exit 
+        busyBee.stayBusy(ready);
+
+        // Are you working yet little bee?
+        ready.await();
+
+        // OK, Bee is busy
+
+        { // Timeout Immediately
+            final long start = System.nanoTime();
+
+            try {
+                busyBee.doItNow();
+
+                fail("The bee should be busy");
+            } catch (Exception e) {
+                // the bee is still too busy as expected
+            }
+
+            assertEquals(0, seconds(start));
+        }
+
+        { // Timeout in 5 seconds
+            final long start = System.nanoTime();
+
+            try {
+                busyBee.doItSoon();
+
+                fail("The bee should be busy");
+            } catch (Exception e) {
+                // the bee is still too busy as expected
+            }
+
+            assertEquals(5, seconds(start));
+        }
+
+        // This will wait forever, give it a try if you have that long
+        //busyBee.justDoIt();
+    }
+
+    private long seconds(long start) {
+        return TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout/src/main/java/org/superbiz/accesstimeout/BusyBee.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout/src/main/java/org/superbiz/accesstimeout/BusyBee.java b/examples/access-timeout/src/main/java/org/superbiz/accesstimeout/BusyBee.java
index 4fb14d9..e9c00f1 100644
--- a/examples/access-timeout/src/main/java/org/superbiz/accesstimeout/BusyBee.java
+++ b/examples/access-timeout/src/main/java/org/superbiz/accesstimeout/BusyBee.java
@@ -1,64 +1,64 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout;
-
-import javax.ejb.AccessTimeout;
-import javax.ejb.Asynchronous;
-import javax.ejb.Lock;
-import javax.ejb.Singleton;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import static javax.ejb.LockType.WRITE;
-
-/**
- * @version $Revision$ $Date$
- */
-@Singleton
-@Lock(WRITE)
-public class BusyBee {
-
-    @Asynchronous
-    public Future stayBusy(CountDownLatch ready) {
-        ready.countDown();
-
-        try {
-            new CountDownLatch(1).await();
-        } catch (InterruptedException e) {
-            Thread.interrupted();
-        }
-
-        return null;
-    }
-
-    @AccessTimeout(0)
-    public void doItNow() {
-        // do something
-    }
-
-    @AccessTimeout(value = 5, unit = TimeUnit.SECONDS)
-    public void doItSoon() {
-        // do something
-    }
-
-    @AccessTimeout(-1)
-    public void justDoIt() {
-        // do something
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout;
+
+import javax.ejb.AccessTimeout;
+import javax.ejb.Asynchronous;
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import static javax.ejb.LockType.WRITE;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Singleton
+@Lock(WRITE)
+public class BusyBee {
+
+    @Asynchronous
+    public Future stayBusy(CountDownLatch ready) {
+        ready.countDown();
+
+        try {
+            new CountDownLatch(1).await();
+        } catch (InterruptedException e) {
+            Thread.interrupted();
+        }
+
+        return null;
+    }
+
+    @AccessTimeout(0)
+    public void doItNow() {
+        // do something
+    }
+
+    @AccessTimeout(value = 5, unit = TimeUnit.SECONDS)
+    public void doItSoon() {
+        // do something
+    }
+
+    @AccessTimeout(-1)
+    public void justDoIt() {
+        // do something
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/access-timeout/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
----------------------------------------------------------------------
diff --git a/examples/access-timeout/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java b/examples/access-timeout/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
index 4c88b11..2201b6f 100644
--- a/examples/access-timeout/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
+++ b/examples/access-timeout/src/test/java/org/superbiz/accesstimeout/BusyBeeTest.java
@@ -1,82 +1,82 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.accesstimeout;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @version $Revision$ $Date$
- */
-public class BusyBeeTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final CountDownLatch ready = new CountDownLatch(1);
-
-        final BusyBee busyBee = (BusyBee) context.lookup("java:global/access-timeout/BusyBee");
-
-        // This asynchronous method will never exit 
-        busyBee.stayBusy(ready);
-
-        // Are you working yet little bee?
-        ready.await();
-
-        // OK, Bee is busy
-
-        { // Timeout Immediately
-            final long start = System.nanoTime();
-
-            try {
-                busyBee.doItNow();
-
-                fail("The bee should be busy");
-            } catch (Exception e) {
-                // the bee is still too busy as expected
-            }
-
-            assertEquals(0, seconds(start));
-        }
-
-        { // Timeout in 5 seconds
-            final long start = System.nanoTime();
-
-            try {
-                busyBee.doItSoon();
-
-                fail("The bee should be busy");
-            } catch (Exception e) {
-                // the bee is still too busy as expected
-            }
-
-            assertEquals(5, seconds(start));
-        }
-
-        // This will wait forever, give it a try if you have that long
-        //busyBee.justDoIt();
-    }
-
-    private long seconds(long start) {
-        return TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.accesstimeout;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class BusyBeeTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final CountDownLatch ready = new CountDownLatch(1);
+
+        final BusyBee busyBee = (BusyBee) context.lookup("java:global/access-timeout/BusyBee");
+
+        // This asynchronous method will never exit 
+        busyBee.stayBusy(ready);
+
+        // Are you working yet little bee?
+        ready.await();
+
+        // OK, Bee is busy
+
+        { // Timeout Immediately
+            final long start = System.nanoTime();
+
+            try {
+                busyBee.doItNow();
+
+                fail("The bee should be busy");
+            } catch (Exception e) {
+                // the bee is still too busy as expected
+            }
+
+            assertEquals(0, seconds(start));
+        }
+
+        { // Timeout in 5 seconds
+            final long start = System.nanoTime();
+
+            try {
+                busyBee.doItSoon();
+
+                fail("The bee should be busy");
+            } catch (Exception e) {
+                // the bee is still too busy as expected
+            }
+
+            assertEquals(5, seconds(start));
+        }
+
+        // This will wait forever, give it a try if you have that long
+        //busyBee.justDoIt();
+    }
+
+    private long seconds(long start) {
+        return TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movie.java
----------------------------------------------------------------------
diff --git a/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movie.java b/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movie.java
index 2da2b47..bcc375a 100644
--- a/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movie.java
+++ b/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.altdd;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.altdd;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movies.java
----------------------------------------------------------------------
diff --git a/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movies.java b/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movies.java
index 0a864c7..61e72ad 100644
--- a/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movies.java
+++ b/examples/alternate-descriptors/src/main/java/org/superbiz/altdd/Movies.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.altdd;
-
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-import static javax.ejb.TransactionAttributeType.MANDATORY;
-
-//START SNIPPET: code
-@Stateful
-@TransactionAttribute(MANDATORY)
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.altdd;
+
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+
+//START SNIPPET: code
+@Stateful
+@TransactionAttribute(MANDATORY)
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/alternate-descriptors/src/test/java/org/superbiz/altdd/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/alternate-descriptors/src/test/java/org/superbiz/altdd/MoviesTest.java b/examples/alternate-descriptors/src/test/java/org/superbiz/altdd/MoviesTest.java
index edfc9fa..29a94e5 100644
--- a/examples/alternate-descriptors/src/test/java/org/superbiz/altdd/MoviesTest.java
+++ b/examples/alternate-descriptors/src/test/java/org/superbiz/altdd/MoviesTest.java
@@ -1,99 +1,99 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.altdd;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.SessionContext;
-import javax.ejb.embeddable.EJBContainer;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.transaction.RollbackException;
-import javax.transaction.UserTransaction;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        p.put("openejb.altdd.prefix", "test");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    public void test() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-
-        } finally {
-            try {
-                userTransaction.commit();
-                fail("Transaction should have been rolled back");
-            } catch (RollbackException e) {
-                // Good, we don't want to clean up the db
-            }
-        }
-    }
-
-    public static class Interceptor {
-
-        @Resource
-        private SessionContext sessionContext;
-
-        @AroundInvoke
-        public Object invoke(InvocationContext context) throws Exception {
-
-            sessionContext.setRollbackOnly();
-
-            return context.proceed();
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.altdd;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.ejb.SessionContext;
+import javax.ejb.embeddable.EJBContainer;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.RollbackException;
+import javax.transaction.UserTransaction;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        p.put("openejb.altdd.prefix", "test");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    public void test() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+        } finally {
+            try {
+                userTransaction.commit();
+                fail("Transaction should have been rolled back");
+            } catch (RollbackException e) {
+                // Good, we don't want to clean up the db
+            }
+        }
+    }
+
+    public static class Interceptor {
+
+        @Resource
+        private SessionContext sessionContext;
+
+        @AroundInvoke
+        public Object invoke(InvocationContext context) throws Exception {
+
+            sessionContext.setRollbackOnly();
+
+            return context.proceed();
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applet/src/main/java/org/superbiz/applet/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/applet/src/main/java/org/superbiz/applet/Calculator.java b/examples/applet/src/main/java/org/superbiz/applet/Calculator.java
index 73cd714..bb34178 100644
--- a/examples/applet/src/main/java/org/superbiz/applet/Calculator.java
+++ b/examples/applet/src/main/java/org/superbiz/applet/Calculator.java
@@ -1,26 +1,25 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.applet;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface Calculator {
-
-    public double add(double x, double y);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.applet;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface Calculator {
+
+    public double add(double x, double y);
+}


[28/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowLoggingInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowLoggingInterceptor.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowLoggingInterceptor.java
index c467dc1..cc2cce3 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowLoggingInterceptor.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowLoggingInterceptor.java
@@ -1,58 +1,73 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import org.superbiz.cdi.bookshow.interceptorbinding.Log;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-import java.io.Serializable;
-import java.util.logging.Logger;
-
-@Interceptor
-@Log
-public class BookForAShowLoggingInterceptor implements Serializable {
-
-    private static final long serialVersionUID = 8139854519874743530L;
-    private Logger logger = Logger.getLogger("BookForAShowApplicationLogger");
-
-    @AroundInvoke
-    public Object logMethodEntry(InvocationContext ctx) throws Exception {
-        logger.info("Before entering method:" + ctx.getMethod().getName());
-        InterceptionOrderTracker.getMethodsInterceptedList().add(ctx.getMethod().getName());
-        InterceptionOrderTracker.getInterceptedByList().add(this.getClass().getSimpleName());
-        return ctx.proceed();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * <p/>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import org.superbiz.cdi.bookshow.interceptorbinding.Log;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+import java.io.Serializable;
+import java.util.logging.Logger;
+
+@Interceptor
+@Log
+public class BookForAShowLoggingInterceptor implements Serializable {
+
+    private static final long serialVersionUID = 8139854519874743530L;
+    private Logger logger = Logger.getLogger("BookForAShowApplicationLogger");
+
+    @AroundInvoke
+    public Object logMethodEntry(InvocationContext ctx) throws Exception {
+        logger.info("Before entering method:" + ctx.getMethod().getName());
+        InterceptionOrderTracker.getMethodsInterceptedList().add(ctx.getMethod().getName());
+        InterceptionOrderTracker.getInterceptedByList().add(this.getClass().getSimpleName());
+        return ctx.proceed();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/TimeBasedRestrictingInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/TimeBasedRestrictingInterceptor.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/TimeBasedRestrictingInterceptor.java
index cc64771..07695bb 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/TimeBasedRestrictingInterceptor.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/interceptors/TimeBasedRestrictingInterceptor.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import org.superbiz.cdi.AccessDeniedException;
-import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestricted;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-import java.io.Serializable;
-
-@Interceptor
-@TimeRestricted
-public class TimeBasedRestrictingInterceptor implements Serializable {
-
-    private static final long serialVersionUID = 8139854519874743530L;
-
-    @AroundInvoke
-    public Object restrictAccessBasedOnTime(InvocationContext ctx) throws Exception {
-        InterceptionOrderTracker.getMethodsInterceptedList().add(ctx.getMethod().getName());
-        InterceptionOrderTracker.getInterceptedByList().add(this.getClass().getSimpleName());
-        if (!isWorkingHours()) {
-            throw new AccessDeniedException("You are not allowed to access the method at this time");
-        }
-        return ctx.proceed();
-    }
-
-    private boolean isWorkingHours() {
-        /*
-         * int hourOfDay = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); if (hourOfDay >= 9 && hourOfDay <= 21) {
-         * return true; } else { return false; }
-         */
-        return true; // Let's assume
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import org.superbiz.cdi.AccessDeniedException;
+import org.superbiz.cdi.bookshow.interceptorbinding.TimeRestricted;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+import java.io.Serializable;
+
+@Interceptor
+@TimeRestricted
+public class TimeBasedRestrictingInterceptor implements Serializable {
+
+    private static final long serialVersionUID = 8139854519874743530L;
+
+    @AroundInvoke
+    public Object restrictAccessBasedOnTime(InvocationContext ctx) throws Exception {
+        InterceptionOrderTracker.getMethodsInterceptedList().add(ctx.getMethod().getName());
+        InterceptionOrderTracker.getInterceptedByList().add(this.getClass().getSimpleName());
+        if (!isWorkingHours()) {
+            throw new AccessDeniedException("You are not allowed to access the method at this time");
+        }
+        return ctx.proceed();
+    }
+
+    private boolean isWorkingHours() {
+        /*
+         * int hourOfDay = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); if (hourOfDay >= 9 && hourOfDay <= 21) {
+         * return true; } else { return false; }
+         */
+        return true; // Let's assume
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/tracker/InterceptionOrderTracker.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/tracker/InterceptionOrderTracker.java b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/tracker/InterceptionOrderTracker.java
index 81fabb8..834c215 100644
--- a/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/tracker/InterceptionOrderTracker.java
+++ b/examples/cdi-interceptors/src/main/java/org/superbiz/cdi/bookshow/tracker/InterceptionOrderTracker.java
@@ -1,49 +1,49 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.tracker;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A helper class for the test.
- * Keeps track of methods intercepted during one testXXX run
- * Keeps track of interceptors applied during one textXXX run
- */
-public class InterceptionOrderTracker {
-
-    /*
-     * Contains method names that were intercepted by the interceptors
-     */
-    private static List<String> methodsInterceptedList = new ArrayList<String>();
-    /*
-     * Contains the name of the interceptor class that intercepted a method
-     */
-    private static List<String> interceptedByList = new ArrayList<String>();
-
-    public static List<String> getInterceptedByList() {
-        return interceptedByList;
-    }
-
-    public static void setInterceptedByList(List<String> interceptedByList) {
-        InterceptionOrderTracker.interceptedByList = interceptedByList;
-    }
-
-    public static List<String> getMethodsInterceptedList() {
-        return methodsInterceptedList;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.tracker;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A helper class for the test.
+ * Keeps track of methods intercepted during one testXXX run
+ * Keeps track of interceptors applied during one textXXX run
+ */
+public class InterceptionOrderTracker {
+
+    /*
+     * Contains method names that were intercepted by the interceptors
+     */
+    private static List<String> methodsInterceptedList = new ArrayList<String>();
+    /*
+     * Contains the name of the interceptor class that intercepted a method
+     */
+    private static List<String> interceptedByList = new ArrayList<String>();
+
+    public static List<String> getInterceptedByList() {
+        return interceptedByList;
+    }
+
+    public static void setInterceptedByList(List<String> interceptedByList) {
+        InterceptionOrderTracker.interceptedByList = interceptedByList;
+    }
+
+    public static List<String> getMethodsInterceptedList() {
+        return methodsInterceptedList;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOldStyleInterceptorBindingTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOldStyleInterceptorBindingTest.java b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOldStyleInterceptorBindingTest.java
index 82f79c0..c86fa40 100644
--- a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOldStyleInterceptorBindingTest.java
+++ b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOldStyleInterceptorBindingTest.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import junit.framework.TestCase;
-import org.superbiz.cdi.bookshow.beans.BookForAShowOldStyleInterceptorBinding;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-public class BookForAShowOldStyleInterceptorBindingTest extends TestCase {
-
-    @EJB
-    private BookForAShowOldStyleInterceptorBinding bookForAShowBean;
-    EJBContainer ejbContainer;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    protected void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    /**
-     * Test basic interception
-     */
-    public void testMethodShouldBeIntercepted() {
-        // action
-        bookForAShowBean.getMoviesList();
-        // verify
-        assertTrue(InterceptionOrderTracker.getMethodsInterceptedList().contains("getMoviesList"));
-    }
-
-    protected void tearDown() {
-        // clear the lists after each test
-        InterceptionOrderTracker.getInterceptedByList().clear();
-        InterceptionOrderTracker.getMethodsInterceptedList().clear();
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import junit.framework.TestCase;
+import org.superbiz.cdi.bookshow.beans.BookForAShowOldStyleInterceptorBinding;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+public class BookForAShowOldStyleInterceptorBindingTest extends TestCase {
+
+    @EJB
+    private BookForAShowOldStyleInterceptorBinding bookForAShowBean;
+    EJBContainer ejbContainer;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    protected void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    /**
+     * Test basic interception
+     */
+    public void testMethodShouldBeIntercepted() {
+        // action
+        bookForAShowBean.getMoviesList();
+        // verify
+        assertTrue(InterceptionOrderTracker.getMethodsInterceptedList().contains("getMoviesList"));
+    }
+
+    protected void tearDown() {
+        // clear the lists after each test
+        InterceptionOrderTracker.getInterceptedByList().clear();
+        InterceptionOrderTracker.getMethodsInterceptedList().clear();
+        ejbContainer.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOneInterceptorAppliedTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOneInterceptorAppliedTest.java b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOneInterceptorAppliedTest.java
index 3d2319e..db40612 100644
--- a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOneInterceptorAppliedTest.java
+++ b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowOneInterceptorAppliedTest.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import junit.framework.TestCase;
-import org.superbiz.cdi.bookshow.beans.BookForAShowOneInterceptorApplied;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-public class BookForAShowOneInterceptorAppliedTest extends TestCase {
-
-    @EJB
-    private BookForAShowOneInterceptorApplied bookForAShowBean;
-    EJBContainer ejbContainer;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    protected void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    /**
-     * Test basic interception
-     */
-    public void testMethodShouldBeIntercepted() {
-        // action
-        bookForAShowBean.getMoviesList();
-        // verify
-        assertTrue(InterceptionOrderTracker.getMethodsInterceptedList().contains("getMoviesList"));
-    }
-
-    protected void tearDown() {
-        // clear the list after each test
-        InterceptionOrderTracker.getInterceptedByList().clear();
-        InterceptionOrderTracker.getMethodsInterceptedList().clear();
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import junit.framework.TestCase;
+import org.superbiz.cdi.bookshow.beans.BookForAShowOneInterceptorApplied;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+public class BookForAShowOneInterceptorAppliedTest extends TestCase {
+
+    @EJB
+    private BookForAShowOneInterceptorApplied bookForAShowBean;
+    EJBContainer ejbContainer;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    protected void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    /**
+     * Test basic interception
+     */
+    public void testMethodShouldBeIntercepted() {
+        // action
+        bookForAShowBean.getMoviesList();
+        // verify
+        assertTrue(InterceptionOrderTracker.getMethodsInterceptedList().contains("getMoviesList"));
+    }
+
+    protected void tearDown() {
+        // clear the list after each test
+        InterceptionOrderTracker.getInterceptedByList().clear();
+        InterceptionOrderTracker.getMethodsInterceptedList().clear();
+        ejbContainer.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowTwoInterceptorsAppiledTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowTwoInterceptorsAppiledTest.java b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowTwoInterceptorsAppiledTest.java
index 192e2bc..0c0093d 100644
--- a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowTwoInterceptorsAppiledTest.java
+++ b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookForAShowTwoInterceptorsAppiledTest.java
@@ -1,70 +1,70 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import junit.framework.TestCase;
-import org.superbiz.cdi.bookshow.beans.BookForAShowTwoInterceptorsApplied;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-public class BookForAShowTwoInterceptorsAppiledTest extends TestCase {
-
-    @EJB
-    private BookForAShowTwoInterceptorsApplied bookForAShowBean;
-    EJBContainer ejbContainer;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    protected void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    /**
-     * Interceptors should be applied in order as defined in beans.xml
-     */
-    public void testInterceptorsShouldBeAppliedInOrder() {
-        // action
-        bookForAShowBean.getDiscountedPrice(100);
-        // verify
-        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
-        int indexOfLogger = interceptedByList.indexOf("BookForAShowLoggingInterceptor");
-        int indexOfTimeBasedRestrictor = interceptedByList.indexOf("TimeBasedRestrictingInterceptor");
-        assertTrue(indexOfLogger < indexOfTimeBasedRestrictor);
-    }
-
-    public void testTwoInterceptorsWereInvoked() {
-        // action
-        bookForAShowBean.getDiscountedPrice(100);
-        // verify
-        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
-        assertTrue(interceptedByList.contains("BookForAShowLoggingInterceptor") && interceptedByList.contains("TimeBasedRestrictingInterceptor"));
-    }
-
-    protected void tearDown() {
-        // clear the lists after each test
-        InterceptionOrderTracker.getInterceptedByList().clear();
-        InterceptionOrderTracker.getMethodsInterceptedList().clear();
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import junit.framework.TestCase;
+import org.superbiz.cdi.bookshow.beans.BookForAShowTwoInterceptorsApplied;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+public class BookForAShowTwoInterceptorsAppiledTest extends TestCase {
+
+    @EJB
+    private BookForAShowTwoInterceptorsApplied bookForAShowBean;
+    EJBContainer ejbContainer;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    protected void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    /**
+     * Interceptors should be applied in order as defined in beans.xml
+     */
+    public void testInterceptorsShouldBeAppliedInOrder() {
+        // action
+        bookForAShowBean.getDiscountedPrice(100);
+        // verify
+        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
+        int indexOfLogger = interceptedByList.indexOf("BookForAShowLoggingInterceptor");
+        int indexOfTimeBasedRestrictor = interceptedByList.indexOf("TimeBasedRestrictingInterceptor");
+        assertTrue(indexOfLogger < indexOfTimeBasedRestrictor);
+    }
+
+    public void testTwoInterceptorsWereInvoked() {
+        // action
+        bookForAShowBean.getDiscountedPrice(100);
+        // verify
+        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
+        assertTrue(interceptedByList.contains("BookForAShowLoggingInterceptor") && interceptedByList.contains("TimeBasedRestrictingInterceptor"));
+    }
+
+    protected void tearDown() {
+        // clear the lists after each test
+        InterceptionOrderTracker.getInterceptedByList().clear();
+        InterceptionOrderTracker.getMethodsInterceptedList().clear();
+        ejbContainer.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowInterceptorBindingInheritanceTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowInterceptorBindingInheritanceTest.java b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowInterceptorBindingInheritanceTest.java
index 20ca275..95b854a 100644
--- a/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowInterceptorBindingInheritanceTest.java
+++ b/examples/cdi-interceptors/src/test/java/org/superbiz/cdi/bookshow/interceptors/BookShowInterceptorBindingInheritanceTest.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.bookshow.interceptors;
-
-import junit.framework.TestCase;
-import org.superbiz.cdi.bookshow.beans.BookShowInterceptorBindingInheritanceExplored;
-import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-public class BookShowInterceptorBindingInheritanceTest extends TestCase {
-
-    @EJB
-    private BookShowInterceptorBindingInheritanceExplored bookForAShowBean;
-    EJBContainer ejbContainer;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    protected void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-        ejbContainer.getContext().bind("inject", this);
-    }
-
-    public void testInterceptorBindingCanInheritFromAnotherBinding() {
-        // action
-        bookForAShowBean.getDiscountedPrice(100);
-        // verify both interceptors were invoked
-        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
-        System.out.println("Intercepted by:" + interceptedByList);
-        assertTrue(interceptedByList.contains("BookForAShowLoggingInterceptor") && interceptedByList.contains("TimeBasedRestrictingInterceptor"));
-    }
-
-    protected void tearDown() {
-        // clear the list after each test
-        InterceptionOrderTracker.getInterceptedByList().clear();
-        InterceptionOrderTracker.getMethodsInterceptedList().clear();
-        ejbContainer.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.bookshow.interceptors;
+
+import junit.framework.TestCase;
+import org.superbiz.cdi.bookshow.beans.BookShowInterceptorBindingInheritanceExplored;
+import org.superbiz.cdi.bookshow.tracker.InterceptionOrderTracker;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+public class BookShowInterceptorBindingInheritanceTest extends TestCase {
+
+    @EJB
+    private BookShowInterceptorBindingInheritanceExplored bookForAShowBean;
+    EJBContainer ejbContainer;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    protected void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+        ejbContainer.getContext().bind("inject", this);
+    }
+
+    public void testInterceptorBindingCanInheritFromAnotherBinding() {
+        // action
+        bookForAShowBean.getDiscountedPrice(100);
+        // verify both interceptors were invoked
+        List<String> interceptedByList = InterceptionOrderTracker.getInterceptedByList();
+        System.out.println("Intercepted by:" + interceptedByList);
+        assertTrue(interceptedByList.contains("BookForAShowLoggingInterceptor") && interceptedByList.contains("TimeBasedRestrictingInterceptor"));
+    }
+
+    protected void tearDown() {
+        // clear the list after each test
+        InterceptionOrderTracker.getInterceptedByList().clear();
+        InterceptionOrderTracker.getMethodsInterceptedList().clear();
+        ejbContainer.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/ConsoleHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/ConsoleHandler.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/ConsoleHandler.java
index 25d9231..d60ffe0 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/ConsoleHandler.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/ConsoleHandler.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-public class ConsoleHandler implements LogHandler {
-
-    private String name;
-
-    public ConsoleHandler(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public void writeLog(String s) {
-        System.out.printf("##### Handler: %s, Writing to the console!\n", getName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+public class ConsoleHandler implements LogHandler {
+
+    private String name;
+
+    public ConsoleHandler(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void writeLog(String s) {
+        System.out.printf("##### Handler: %s, Writing to the console!\n", getName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/DatabaseHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/DatabaseHandler.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/DatabaseHandler.java
index 790f216..4b3a12c 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/DatabaseHandler.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/DatabaseHandler.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-public class DatabaseHandler implements LogHandler {
-
-    private String name;
-
-    public DatabaseHandler(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public void writeLog(String s) {
-        System.out.printf("##### Handler: %s, Writing to the database!\n", getName());
-        // Use connection to write log to database
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+public class DatabaseHandler implements LogHandler {
+
+    private String name;
+
+    public DatabaseHandler(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void writeLog(String s) {
+        System.out.printf("##### Handler: %s, Writing to the database!\n", getName());
+        // Use connection to write log to database
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/FileHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/FileHandler.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/FileHandler.java
index afd20b9..ba319c2 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/FileHandler.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/FileHandler.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-public class FileHandler implements LogHandler {
-
-    private String name;
-
-    public FileHandler(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public void writeLog(String s) {
-        System.out.printf("##### Handler: %s, Writing to the file!\n", getName());
-        // Write to log file
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+public class FileHandler implements LogHandler {
+
+    private String name;
+
+    public FileHandler(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void writeLog(String s) {
+        System.out.printf("##### Handler: %s, Writing to the file!\n", getName());
+        // Write to log file
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogFactory.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogFactory.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogFactory.java
index 94b8f43..baf798c 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogFactory.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogFactory.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Produces;
-
-public class LogFactory {
-
-    private int type = 2;
-
-    @Produces
-    public LogHandler getLogHandler() {
-        switch (type) {
-            case 1:
-                return new FileHandler("@Produces created FileHandler!");
-            case 2:
-                return new DatabaseHandler("@Produces created DatabaseHandler!");
-            case 3:
-            default:
-                return new ConsoleHandler("@Produces created ConsoleHandler!");
-        }
-
-    }
-
-    public void closeLogHandler(@Disposes LogHandler handler) {
-        switch (type) {
-            case 1:
-                System.out.println("Closing File handler!");
-                break;
-            case 2:
-                System.out.println("Closing DB handler!");
-                break;
-            case 3:
-            default:
-                System.out.println("Closing Console handler!");
-        }
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+public class LogFactory {
+
+    private int type = 2;
+
+    @Produces
+    public LogHandler getLogHandler() {
+        switch (type) {
+            case 1:
+                return new FileHandler("@Produces created FileHandler!");
+            case 2:
+                return new DatabaseHandler("@Produces created DatabaseHandler!");
+            case 3:
+            default:
+                return new ConsoleHandler("@Produces created ConsoleHandler!");
+        }
+
+    }
+
+    public void closeLogHandler(@Disposes LogHandler handler) {
+        switch (type) {
+            case 1:
+                System.out.println("Closing File handler!");
+                break;
+            case 2:
+                System.out.println("Closing DB handler!");
+                break;
+            case 3:
+            default:
+                System.out.println("Closing Console handler!");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogHandler.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogHandler.java
index 87faca5..adc22b7 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogHandler.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LogHandler.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-public interface LogHandler {
-
-    public String getName();
-
-    public void writeLog(String s);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+public interface LogHandler {
+
+    public String getName();
+
+    public void writeLog(String s);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/Logger.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/Logger.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/Logger.java
index a8f4193..b46975a 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/Logger.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/Logger.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-public interface Logger {
-
-    public void log(String s);
-
-    public LogHandler getHandler();
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+public interface Logger {
+
+    public void log(String s);
+
+    public LogHandler getHandler();
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LoggerImpl.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LoggerImpl.java b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LoggerImpl.java
index 39a6045..69cc006 100644
--- a/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LoggerImpl.java
+++ b/examples/cdi-produces-disposes/src/main/java/org/superbiz/cdi/produces/disposes/LoggerImpl.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-@Named("logger")
-public class LoggerImpl implements Logger {
-
-    @Inject
-    private LogHandler handler;
-
-    @Override
-    public void log(String s) {
-        getHandler().writeLog(s);
-    }
-
-    public LogHandler getHandler() {
-        return handler;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("logger")
+public class LoggerImpl implements Logger {
+
+    @Inject
+    private LogHandler handler;
+
+    @Override
+    public void log(String s) {
+        getHandler().writeLog(s);
+    }
+
+    public LogHandler getHandler() {
+        return handler;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-disposes/src/test/java/org/superbiz/cdi/produces/disposes/LoggerTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-disposes/src/test/java/org/superbiz/cdi/produces/disposes/LoggerTest.java b/examples/cdi-produces-disposes/src/test/java/org/superbiz/cdi/produces/disposes/LoggerTest.java
index 10f24bf..4fcc086 100644
--- a/examples/cdi-produces-disposes/src/test/java/org/superbiz/cdi/produces/disposes/LoggerTest.java
+++ b/examples/cdi-produces-disposes/src/test/java/org/superbiz/cdi/produces/disposes/LoggerTest.java
@@ -1,67 +1,67 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.produces.disposes;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class LoggerTest {
-
-    @Inject
-    Logger logger;
-
-    private EJBContainer container;
-
-    @Before
-    public void setUp() {
-        try {
-            container = EJBContainer.createEJBContainer();
-            container.getContext().bind("inject", this);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @After
-    public void cleanUp() {
-        try {
-            container.getContext().unbind("inject");
-            container.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testLogHandler() {
-        assertNotNull(logger);
-        assertFalse("Handler should not be a ConsoleHandler", logger.getHandler() instanceof ConsoleHandler);
-        assertFalse("Handler should not be a FileHandler", logger.getHandler() instanceof FileHandler);
-        assertTrue("Handler should be a DatabaseHandler", logger.getHandler() instanceof DatabaseHandler);
-        logger.log("##### Testing write\n");
-        logger = null;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.produces.disposes;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+public class LoggerTest {
+
+    @Inject
+    Logger logger;
+
+    private EJBContainer container;
+
+    @Before
+    public void setUp() {
+        try {
+            container = EJBContainer.createEJBContainer();
+            container.getContext().bind("inject", this);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @After
+    public void cleanUp() {
+        try {
+            container.getContext().unbind("inject");
+            container.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testLogHandler() {
+        assertNotNull(logger);
+        assertFalse("Handler should not be a ConsoleHandler", logger.getHandler() instanceof ConsoleHandler);
+        assertFalse("Handler should not be a FileHandler", logger.getHandler() instanceof FileHandler);
+        assertTrue("Handler should be a DatabaseHandler", logger.getHandler() instanceof DatabaseHandler);
+        logger.log("##### Testing write\n");
+        logger = null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/README.md
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/README.md b/examples/cdi-produces-field/README.md
index 7deb6d5..c2f61d9 100644
--- a/examples/cdi-produces-field/README.md
+++ b/examples/cdi-produces-field/README.md
@@ -227,7 +227,7 @@ inject resources, such as persistence contexts. One caveat to using producer fie
 	INFO - OpenEJB http://tomee.apache.org/
 	INFO - Startup: Thu May 10 01:28:19 CDT 2012
 	INFO - Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights Reserved.
-	INFO - Version: 4.0.0-beta-3-SNAPSHOT
+	INFO - Version: 7.0.0-SNAPSHOT
 	INFO - Build date: 20120510
 	INFO - Build time: 04:06
 	INFO - ********************************************************************************

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/ConsoleHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/ConsoleHandler.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/ConsoleHandler.java
index ad4bfc0..f8852e1 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/ConsoleHandler.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/ConsoleHandler.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/DatabaseHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/DatabaseHandler.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/DatabaseHandler.java
index e5ecd81..ef9a658 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/DatabaseHandler.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/DatabaseHandler.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/FileHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/FileHandler.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/FileHandler.java
index 5930293..3681058 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/FileHandler.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/FileHandler.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogFactory.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogFactory.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogFactory.java
index 5926392..87e9410 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogFactory.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogFactory.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogHandler.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogHandler.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogHandler.java
index a72b7f2..b0c892a 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogHandler.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LogHandler.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/Logger.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/Logger.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/Logger.java
index 85e625c..8dd628e 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/Logger.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/Logger.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LoggerImpl.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LoggerImpl.java b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LoggerImpl.java
index 073b93f..ca039fe 100644
--- a/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LoggerImpl.java
+++ b/examples/cdi-produces-field/src/main/java/org/superbiz/cdi/produces/field/LoggerImpl.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-produces-field/src/test/java/org/superbiz/cdi/produces/field/LoggerTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-produces-field/src/test/java/org/superbiz/cdi/produces/field/LoggerTest.java b/examples/cdi-produces-field/src/test/java/org/superbiz/cdi/produces/field/LoggerTest.java
index 8d1fc21..6a7b434 100644
--- a/examples/cdi-produces-field/src/test/java/org/superbiz/cdi/produces/field/LoggerTest.java
+++ b/examples/cdi-produces-field/src/test/java/org/superbiz/cdi/produces/field/LoggerTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.cdi.produces.field;
 
@@ -23,8 +23,8 @@ import org.junit.Test;
 import javax.ejb.embeddable.EJBContainer;
 import javax.inject.Inject;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 public class LoggerTest {

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-realm/pom.xml
----------------------------------------------------------------------
diff --git a/examples/cdi-realm/pom.xml b/examples/cdi-realm/pom.xml
index fc3fae7..a05c411 100644
--- a/examples/cdi-realm/pom.xml
+++ b/examples/cdi-realm/pom.xml
@@ -23,7 +23,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>cdi-realm</artifactId>
   <packaging>war</packaging>
-  <version>1.1.1-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: CDI Realm</name>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-realm/src/main/java/org/superbiz/AuthBean.java
----------------------------------------------------------------------
diff --git a/examples/cdi-realm/src/main/java/org/superbiz/AuthBean.java b/examples/cdi-realm/src/main/java/org/superbiz/AuthBean.java
index bee66b9..d74f34d 100644
--- a/examples/cdi-realm/src/main/java/org/superbiz/AuthBean.java
+++ b/examples/cdi-realm/src/main/java/org/superbiz/AuthBean.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import javax.enterprise.context.RequestScoped;
-import java.security.Principal;
-
-@RequestScoped // just to show we can be bound to the request but @ApplicationScoped is what makes sense
-public class AuthBean {
-    public Principal authenticate(final String username, String password) {
-        if (("userA".equals(username) || "userB".equals(username)) && "test".equals(password)) {
-            return new Principal() {
-                @Override
-                public String getName() {
-                    return username;
-                }
-
-                @Override
-                public String toString() {
-                    return username;
-                }
-            };
-        }
-        return null;
-    }
-
-    public boolean hasRole(final Principal principal, final String role) {
-        return principal != null && (
-                principal.getName().equals("userA") && (role.equals("admin")
-                || role.equals("user"))
-                || principal.getName().equals("userB") && (role.equals("user"))
-            );
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.enterprise.context.RequestScoped;
+import java.security.Principal;
+
+@RequestScoped // just to show we can be bound to the request but @ApplicationScoped is what makes sense
+public class AuthBean {
+    public Principal authenticate(final String username, String password) {
+        if (("userA".equals(username) || "userB".equals(username)) && "test".equals(password)) {
+            return new Principal() {
+                @Override
+                public String getName() {
+                    return username;
+                }
+
+                @Override
+                public String toString() {
+                    return username;
+                }
+            };
+        }
+        return null;
+    }
+
+    public boolean hasRole(final Principal principal, final String role) {
+        return principal != null && (
+                principal.getName().equals("userA") && (role.equals("admin")
+                        || role.equals("user"))
+                        || principal.getName().equals("userB") && (role.equals("user"))
+        );
+    }
+}


[15/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete/src/test/java/org/superbiz/injection/tx/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete/src/test/java/org/superbiz/injection/tx/MoviesTest.java b/examples/movies-complete/src/test/java/org/superbiz/injection/tx/MoviesTest.java
index fcd5826..afdccdf 100644
--- a/examples/movies-complete/src/test/java/org/superbiz/injection/tx/MoviesTest.java
+++ b/examples/movies-complete/src/test/java/org/superbiz/injection/tx/MoviesTest.java
@@ -1,142 +1,142 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import junit.framework.TestCase;
-
-import javax.annotation.security.RunAs;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-
-import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
-
-/**
- * See the transaction-rollback example as it does the same thing
- * via UserTransaction and shows more techniques for rollback
- */
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @EJB(beanName = "TransactionBean")
-    private Caller transactionalCaller;
-
-    @EJB(beanName = "NoTransactionBean")
-    private Caller nonTransactionalCaller;
-
-    protected void setUp() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        transactionalCaller.call(new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
-                for (final Movie m : movies.getMovies()) {
-                    movies.deleteMovie(m);
-                }
-                return null;
-            }
-        });
-    }
-
-    private void doWork() throws Exception {
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-
-    public void testWithTransaction() throws Exception {
-        transactionalCaller.call(new Callable() {
-            public Object call() throws Exception {
-                doWork();
-                return null;
-            }
-        });
-    }
-
-    public void testWithoutTransaction() throws Exception {
-        try {
-            nonTransactionalCaller.call(new Callable() {
-                public Object call() throws Exception {
-                    doWork();
-                    return null;
-                }
-            });
-            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
-        } catch (javax.ejb.EJBException e) {
-            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
-        }
-    }
-
-    public static interface Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception;
-    }
-
-    /**
-     * This little bit of magic allows our test code to execute in
-     * the scope of a container controlled transaction.
-     */
-    @Stateless
-    @RunAs("Manager")
-    @TransactionAttribute(REQUIRES_NEW)
-    public static class TransactionBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-    @Stateless
-    @RunAs("Manager")
-    @TransactionAttribute(TransactionAttributeType.NEVER)
-    public static class NoTransactionBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import junit.framework.TestCase;
+
+import javax.annotation.security.RunAs;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+
+/**
+ * See the transaction-rollback example as it does the same thing
+ * via UserTransaction and shows more techniques for rollback
+ */
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @EJB(beanName = "TransactionBean")
+    private Caller transactionalCaller;
+
+    @EJB(beanName = "NoTransactionBean")
+    private Caller nonTransactionalCaller;
+
+    protected void setUp() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        transactionalCaller.call(new Callable<Object>() {
+            @Override
+            public Object call() throws Exception {
+                for (final Movie m : movies.getMovies()) {
+                    movies.deleteMovie(m);
+                }
+                return null;
+            }
+        });
+    }
+
+    private void doWork() throws Exception {
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+
+    public void testWithTransaction() throws Exception {
+        transactionalCaller.call(new Callable() {
+            public Object call() throws Exception {
+                doWork();
+                return null;
+            }
+        });
+    }
+
+    public void testWithoutTransaction() throws Exception {
+        try {
+            nonTransactionalCaller.call(new Callable() {
+                public Object call() throws Exception {
+                    doWork();
+                    return null;
+                }
+            });
+            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
+        } catch (javax.ejb.EJBException e) {
+            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
+        }
+    }
+
+    public static interface Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception;
+    }
+
+    /**
+     * This little bit of magic allows our test code to execute in
+     * the scope of a container controlled transaction.
+     */
+    @Stateless
+    @RunAs("Manager")
+    @TransactionAttribute(REQUIRES_NEW)
+    public static class TransactionBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+    @Stateless
+    @RunAs("Manager")
+    @TransactionAttribute(TransactionAttributeType.NEVER)
+    public static class NoTransactionBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/AbstractService.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/AbstractService.java b/examples/mtom/src/main/java/org/superbiz/mtom/AbstractService.java
index 8613218..ea9c53f 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/AbstractService.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/AbstractService.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/EjbService.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/EjbService.java b/examples/mtom/src/main/java/org/superbiz/mtom/EjbService.java
index b417854..0efe823 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/EjbService.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/EjbService.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/PojoService.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/PojoService.java b/examples/mtom/src/main/java/org/superbiz/mtom/PojoService.java
index 17a2728..46c5769 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/PojoService.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/PojoService.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/Request.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/Request.java b/examples/mtom/src/main/java/org/superbiz/mtom/Request.java
index 804b8e2..66f2d29 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/Request.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/Request.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/Response.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/Response.java b/examples/mtom/src/main/java/org/superbiz/mtom/Response.java
index dde9919..9ac1d0a 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/Response.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/Response.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/main/java/org/superbiz/mtom/Service.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/main/java/org/superbiz/mtom/Service.java b/examples/mtom/src/main/java/org/superbiz/mtom/Service.java
index 21c88b0..54d672b 100644
--- a/examples/mtom/src/main/java/org/superbiz/mtom/Service.java
+++ b/examples/mtom/src/main/java/org/superbiz/mtom/Service.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/test/java/org/superbiz/mtom/AbstractServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/test/java/org/superbiz/mtom/AbstractServiceTest.java b/examples/mtom/src/test/java/org/superbiz/mtom/AbstractServiceTest.java
index 07a78de..1cc2bec 100644
--- a/examples/mtom/src/test/java/org/superbiz/mtom/AbstractServiceTest.java
+++ b/examples/mtom/src/test/java/org/superbiz/mtom/AbstractServiceTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/test/java/org/superbiz/mtom/EjbServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/test/java/org/superbiz/mtom/EjbServiceTest.java b/examples/mtom/src/test/java/org/superbiz/mtom/EjbServiceTest.java
index dcf7785..342da32 100644
--- a/examples/mtom/src/test/java/org/superbiz/mtom/EjbServiceTest.java
+++ b/examples/mtom/src/test/java/org/superbiz/mtom/EjbServiceTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mtom/src/test/java/org/superbiz/mtom/PojoServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/mtom/src/test/java/org/superbiz/mtom/PojoServiceTest.java b/examples/mtom/src/test/java/org/superbiz/mtom/PojoServiceTest.java
index cf2f013..97eee6e 100644
--- a/examples/mtom/src/test/java/org/superbiz/mtom/PojoServiceTest.java
+++ b/examples/mtom/src/test/java/org/superbiz/mtom/PojoServiceTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.mtom;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java b/examples/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
index 4a40f79..934230f 100644
--- a/examples/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
+++ b/examples/multi-jpa-provider-testing/src/main/java/org/superbiz/model/Person.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.model;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-@Entity
-public class Person {
-
-    @Id
-    @GeneratedValue
-    private long id;
-
-    private String name;
-
-    public long getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.model;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Person {
+
+    @Id
+    @GeneratedValue
+    private long id;
+
+    private String name;
+
+    public long getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
index e282034..558f8b2 100644
--- a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
+++ b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/JPATest.java
@@ -1,59 +1,59 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
-import org.jboss.arquillian.transaction.api.annotation.Transactional;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.model.Person;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class JPATest {
-
-    @Deployment
-    public static WebArchive war() {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addClass(Person.class)
-                         .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), ArchivePaths.create("persistence.xml"));
-    }
-
-    @PersistenceContext
-    private EntityManager em;
-
-    @Test
-    @Transactional(TransactionMode.ROLLBACK)
-    public void persist() {
-        assertNotNull(em);
-
-        // do something with the em
-        final Person p = new Person();
-        p.setName("Apache OpenEJB");
-        em.persist(p);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
+import org.jboss.arquillian.transaction.api.annotation.Transactional;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.model.Person;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class JPATest {
+
+    @Deployment
+    public static WebArchive war() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClass(Person.class)
+                .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), ArchivePaths.create("persistence.xml"));
+    }
+
+    @PersistenceContext
+    private EntityManager em;
+
+    @Test
+    @Transactional(TransactionMode.ROLLBACK)
+    public void persist() {
+        assertNotNull(em);
+
+        // do something with the em
+        final Person p = new Person();
+        p.setName("Apache OpenEJB");
+        em.persist(p);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
index d5a206b..552020c 100644
--- a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
+++ b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/HibernateEnricher.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enricher.jpa;
-
-import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
-import org.jboss.shrinkwrap.api.Archive;
-import org.superbiz.enricher.maven.Enrichers;
-
-public class HibernateEnricher implements AuxiliaryArchiveProcessor {
-
-    @Override
-    public void process(final Archive<?> auxiliaryArchive) {
-        Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/hibernate-pom.xml"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enricher.jpa;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.superbiz.enricher.maven.Enrichers;
+
+public class HibernateEnricher implements AuxiliaryArchiveProcessor {
+
+    @Override
+    public void process(final Archive<?> auxiliaryArchive) {
+        Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/hibernate-pom.xml"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
index 552359d..d07da53 100644
--- a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
+++ b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/JPAEnrichers.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enricher.jpa;
-
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-
-// use it with tomee remote adapter
-// in embedded mode simply put all provider in appclassloader
-// otherwise arquillian will be fooled by src/main/java
-public final class JPAEnrichers {
-
-    private JPAEnrichers() {
-        // no-op
-    }
-
-    public static WebArchive addJPAProvider(final WebArchive war) {
-        final String provider = System.getProperty("javax.persistence.provider");
-        if (provider != null && provider.contains("hibernate")) {
-            new HibernateEnricher().process(war);
-        } else { // default
-            new OpenJPAEnricher().process(war);
-        }
-        return war;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enricher.jpa;
+
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+// use it with tomee remote adapter
+// in embedded mode simply put all provider in appclassloader
+// otherwise arquillian will be fooled by src/main/java
+public final class JPAEnrichers {
+
+    private JPAEnrichers() {
+        // no-op
+    }
+
+    public static WebArchive addJPAProvider(final WebArchive war) {
+        final String provider = System.getProperty("javax.persistence.provider");
+        if (provider != null && provider.contains("hibernate")) {
+            new HibernateEnricher().process(war);
+        } else { // default
+            new OpenJPAEnricher().process(war);
+        }
+        return war;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
index 7928403..15d2c05 100644
--- a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
+++ b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/jpa/OpenJPAEnricher.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enricher.jpa;
-
-import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
-import org.jboss.shrinkwrap.api.Archive;
-import org.superbiz.enricher.maven.Enrichers;
-
-public class OpenJPAEnricher implements AuxiliaryArchiveProcessor {
-
-    @Override
-    public void process(final Archive<?> auxiliaryArchive) {
-        Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/openjpa-pom.xml"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enricher.jpa;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveProcessor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.superbiz.enricher.maven.Enrichers;
+
+public class OpenJPAEnricher implements AuxiliaryArchiveProcessor {
+
+    @Override
+    public void process(final Archive<?> auxiliaryArchive) {
+        Enrichers.wrap(auxiliaryArchive).addAsLibraries(Enrichers.resolve("src/test/resources/openjpa-pom.xml"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
index be62ac9..8a62ec8 100644
--- a/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
+++ b/examples/multi-jpa-provider-testing/src/test/java/org/superbiz/enricher/maven/Enrichers.java
@@ -1,62 +1,61 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enricher.maven;
-
-import org.jboss.shrinkwrap.api.container.LibraryContainer;
-import org.jboss.shrinkwrap.resolver.api.maven.Maven;
-
-import javax.enterprise.inject.ResolutionException;
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-public final class Enrichers {
-
-    private static final Map<String, File[]> CACHE = new HashMap<String, File[]>();
-
-    private Enrichers() {
-        // no-op
-    }
-
-    public static File[] resolve(final String pom) {
-        if (!CACHE.containsKey(pom)) {
-            try {
-
-                // try offline first since it is generally faster
-                CACHE.put(pom, Maven.resolver()
-                                    .offline(true)
-                                    .loadPomFromFile(pom)
-                                    .importRuntimeAndTestDependencies().resolve().withTransitivity()
-                                    .asFile());
-            } catch (ResolutionException re) { // try on central
-                CACHE.put(pom, Maven.resolver()
-                                    .loadPomFromFile(pom)
-                                    .importRuntimeAndTestDependencies().resolve().withTransitivity()
-                                    .asFile());
-            }
-        }
-        return CACHE.get(pom);
-    }
-
-    public static LibraryContainer wrap(final org.jboss.shrinkwrap.api.Archive<?> archive) {
-        if (!(LibraryContainer.class.isInstance(archive))) {
-            throw new IllegalArgumentException("Unsupported archive type: " + archive.getClass().getName());
-        }
-        return (LibraryContainer) archive;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enricher.maven;
+
+import org.jboss.shrinkwrap.api.container.LibraryContainer;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+import javax.enterprise.inject.ResolutionException;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+public final class Enrichers {
+
+    private static final Map<String, File[]> CACHE = new HashMap<String, File[]>();
+
+    private Enrichers() {
+        // no-op
+    }
+
+    public static File[] resolve(final String pom) {
+        if (!CACHE.containsKey(pom)) {
+            try {
+
+                // try offline first since it is generally faster
+                CACHE.put(pom, Maven.resolver()
+                        .offline(true)
+                        .loadPomFromFile(pom)
+                        .importRuntimeAndTestDependencies().resolve().withTransitivity()
+                        .asFile());
+            } catch (ResolutionException re) { // try on central
+                CACHE.put(pom, Maven.resolver()
+                        .loadPomFromFile(pom)
+                        .importRuntimeAndTestDependencies().resolve().withTransitivity()
+                        .asFile());
+            }
+        }
+        return CACHE.get(pom);
+    }
+
+    public static LibraryContainer wrap(final org.jboss.shrinkwrap.api.Archive<?> archive) {
+        if (!(LibraryContainer.class.isInstance(archive))) {
+            throw new IllegalArgumentException("Unsupported archive type: " + archive.getClass().getName());
+        }
+        return (LibraryContainer) archive;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeEJB.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeEJB.java b/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeEJB.java
index 402a685..deee0e4 100644
--- a/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeEJB.java
+++ b/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeEJB.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class SomeEJB {
-
-    public String ok() {
-        return "ejb";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class SomeEJB {
+
+    public String ok() {
+        return "ejb";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeRest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeRest.java b/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeRest.java
index 5fb7fc2..0eb9818 100644
--- a/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeRest.java
+++ b/examples/multiple-arquillian-adapters/src/main/java/org/superbiz/SomeRest.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import javax.ejb.Stateless;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-@Path("/rest")
-@Stateless
-public class SomeRest {
-
-    @GET
-    @Path("/ok")
-    public String ok() {
-        return "rest";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.ejb.Stateless;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/rest")
+@Stateless
+public class SomeRest {
+
+    @GET
+    @Path("/ok")
+    public String ok() {
+        return "rest";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/EmbeddedRemote.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/EmbeddedRemote.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/EmbeddedRemote.java
index 25d9301..592ac2b 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/EmbeddedRemote.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/EmbeddedRemote.java
@@ -1,21 +1,21 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.embedded.remote;
-
-public interface EmbeddedRemote {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.embedded.remote;
+
+public interface EmbeddedRemote {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/OpenEJBEmbeddedRemoteTest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/OpenEJBEmbeddedRemoteTest.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/OpenEJBEmbeddedRemoteTest.java
index f09b041..4531f4a 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/OpenEJBEmbeddedRemoteTest.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/remote/OpenEJBEmbeddedRemoteTest.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.embedded.remote;
-
-import org.apache.ziplock.IO;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.superbiz.SomeRest;
-
-import java.io.IOException;
-import java.net.URL;
-
-import static org.junit.Assert.assertEquals;
-
-@Category(EmbeddedRemote.class)
-@RunWith(Arquillian.class)
-public class OpenEJBEmbeddedRemoteTest {
-
-    @Deployment
-    public static JavaArchive jar() {
-        return ShrinkWrap.create(JavaArchive.class, "my-webapp.jar").addClass(SomeRest.class);
-    }
-
-    @Test
-    public void check() throws IOException {
-        final String content = IO.slurp(new URL("http://localhost:4204/my-webapp/rest/ok"));
-        assertEquals("rest", content);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.embedded.remote;
+
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.superbiz.SomeRest;
+
+import java.io.IOException;
+import java.net.URL;
+
+import static org.junit.Assert.assertEquals;
+
+@Category(EmbeddedRemote.class)
+@RunWith(Arquillian.class)
+public class OpenEJBEmbeddedRemoteTest {
+
+    @Deployment
+    public static JavaArchive jar() {
+        return ShrinkWrap.create(JavaArchive.class, "my-webapp.jar").addClass(SomeRest.class);
+    }
+
+    @Test
+    public void check() throws IOException {
+        final String content = IO.slurp(new URL("http://localhost:4204/my-webapp/rest/ok"));
+        assertEquals("rest", content);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/Embedded.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/Embedded.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/Embedded.java
index 5d65dbc..f4aea44 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/Embedded.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/Embedded.java
@@ -1,21 +1,21 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.embedded.standalone;
-
-public interface Embedded {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.embedded.standalone;
+
+public interface Embedded {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/OpenEJBEmbeddedTest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/OpenEJBEmbeddedTest.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/OpenEJBEmbeddedTest.java
index 3532085..a8dfbd2 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/OpenEJBEmbeddedTest.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/embedded/standalone/OpenEJBEmbeddedTest.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.embedded.standalone;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.superbiz.SomeEJB;
-
-import javax.ejb.EJB;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@Category(Embedded.class)
-@RunWith(Arquillian.class)
-public class OpenEJBEmbeddedTest {
-
-    @EJB
-    private SomeEJB ejb;
-
-    @Deployment
-    public static JavaArchive jar() {
-        return ShrinkWrap.create(JavaArchive.class).addClass(SomeEJB.class);
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(ejb);
-        assertEquals("ejb", ejb.ok());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.embedded.standalone;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.superbiz.SomeEJB;
+
+import javax.ejb.EJB;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Category(Embedded.class)
+@RunWith(Arquillian.class)
+public class OpenEJBEmbeddedTest {
+
+    @EJB
+    private SomeEJB ejb;
+
+    @Deployment
+    public static JavaArchive jar() {
+        return ShrinkWrap.create(JavaArchive.class).addClass(SomeEJB.class);
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(ejb);
+        assertEquals("ejb", ejb.ok());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbedded.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbedded.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbedded.java
index e2da33f..ea7c624 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbedded.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbedded.java
@@ -1,21 +1,21 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.tomee.embedded;
-
-public interface TomEEEmbedded {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.tomee.embedded;
+
+public interface TomEEEmbedded {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbeddedTest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbeddedTest.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbeddedTest.java
index d815c17..06d0576 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbeddedTest.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/embedded/TomEEEmbeddedTest.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.tomee.embedded;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.superbiz.SomeEJB;
-
-import javax.ejb.EJB;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@Category(TomEEEmbedded.class)
-@RunWith(Arquillian.class)
-public class TomEEEmbeddedTest {
-
-    @EJB
-    private SomeEJB ejb;
-
-    @Deployment
-    public static WebArchive war() { // use test name for the war otherwise arquillian ejb enricher doesn't work
-        return ShrinkWrap.create(WebArchive.class, "test.war").addClass(SomeEJB.class);
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(ejb);
-        assertEquals("ejb", ejb.ok());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.tomee.embedded;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.superbiz.SomeEJB;
+
+import javax.ejb.EJB;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Category(TomEEEmbedded.class)
+@RunWith(Arquillian.class)
+public class TomEEEmbeddedTest {
+
+    @EJB
+    private SomeEJB ejb;
+
+    @Deployment
+    public static WebArchive war() { // use test name for the war otherwise arquillian ejb enricher doesn't work
+        return ShrinkWrap.create(WebArchive.class, "test.war").addClass(SomeEJB.class);
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(ejb);
+        assertEquals("ejb", ejb.ok());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemote.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemote.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemote.java
index 90d09a3..e6ff760 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemote.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemote.java
@@ -1,21 +1,21 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.tomee.remote;
-
-public interface TomEERemote {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.tomee.remote;
+
+public interface TomEERemote {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemoteTest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemoteTest.java b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemoteTest.java
index 9814c2d..76af77c 100644
--- a/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemoteTest.java
+++ b/examples/multiple-arquillian-adapters/src/test/java/org/superbiz/tomee/remote/TomEERemoteTest.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.tomee.remote;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.superbiz.SomeEJB;
-
-import javax.ejb.EJB;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@Category(TomEERemote.class)
-@RunWith(Arquillian.class)
-public class TomEERemoteTest {
-
-    @EJB
-    private SomeEJB ejb;
-
-    @Deployment
-    public static WebArchive war() {
-        // use test name for the war otherwise arquillian ejb enricher doesn't work
-        // don't forget the category otherwise it will fail since the runner parse annotations
-        // in embedded mode it is not so important
-        return ShrinkWrap.create(WebArchive.class, "test.war").addClasses(SomeEJB.class, TomEERemote.class);
-    }
-
-    @Test
-    public void check() {
-        assertNotNull(ejb);
-        assertEquals("ejb", ejb.ok());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.tomee.remote;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.superbiz.SomeEJB;
+
+import javax.ejb.EJB;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@Category(TomEERemote.class)
+@RunWith(Arquillian.class)
+public class TomEERemoteTest {
+
+    @EJB
+    private SomeEJB ejb;
+
+    @Deployment
+    public static WebArchive war() {
+        // use test name for the war otherwise arquillian ejb enricher doesn't work
+        // don't forget the category otherwise it will fail since the runner parse annotations
+        // in embedded mode it is not so important
+        return ShrinkWrap.create(WebArchive.class, "test.war").addClasses(SomeEJB.class, TomEERemote.class);
+    }
+
+    @Test
+    public void check() {
+        assertNotNull(ejb);
+        assertEquals("ejb", ejb.ok());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/multiple-tomee-arquillian/src/test/java/org/superbiz/tomee/arquillian/multiple/MultipleTomEETest.java
----------------------------------------------------------------------
diff --git a/examples/multiple-tomee-arquillian/src/test/java/org/superbiz/tomee/arquillian/multiple/MultipleTomEETest.java b/examples/multiple-tomee-arquillian/src/test/java/org/superbiz/tomee/arquillian/multiple/MultipleTomEETest.java
index 16f4768..ef44345 100644
--- a/examples/multiple-tomee-arquillian/src/test/java/org/superbiz/tomee/arquillian/multiple/MultipleTomEETest.java
+++ b/examples/multiple-tomee-arquillian/src/test/java/org/superbiz/tomee/arquillian/multiple/MultipleTomEETest.java
@@ -1,66 +1,66 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.tomee.arquillian.multiple;
-
-import org.apache.ziplock.IO;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.OperateOnDeployment;
-import org.jboss.arquillian.container.test.api.TargetsContainer;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-import java.net.URL;
-
-import static org.junit.Assert.assertEquals;
-
-@RunWith(Arquillian.class)
-public class MultipleTomEETest {
-
-    @Deployment(name = "war1", testable = false)
-    @TargetsContainer("tomee-1")
-    public static WebArchive createDep1() {
-        return ShrinkWrap.create(WebArchive.class, "application1.war")
-                         .addAsWebResource(new StringAsset("Hello from TomEE 1"), "index.html");
-    }
-
-    @Deployment(name = "war2", testable = false)
-    @TargetsContainer("tomee-2")
-    public static WebArchive createDep2() {
-        return ShrinkWrap.create(WebArchive.class, "application2.war")
-                         .addAsWebResource(new StringAsset("Hello from TomEE 2"), "index.html");
-    }
-
-    @Test
-    @OperateOnDeployment("war1")
-    public void testRunningInDep1(@ArquillianResource final URL url) throws IOException {
-        final String content = IO.slurp(url);
-        assertEquals("Hello from TomEE 1", content);
-    }
-
-    @Test
-    @OperateOnDeployment("war2")
-    public void testRunningInDep2(@ArquillianResource final URL url) throws IOException {
-        final String content = IO.slurp(url);
-        assertEquals("Hello from TomEE 2", content);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.tomee.arquillian.multiple;
+
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.arquillian.container.test.api.TargetsContainer;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.net.URL;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(Arquillian.class)
+public class MultipleTomEETest {
+
+    @Deployment(name = "war1", testable = false)
+    @TargetsContainer("tomee-1")
+    public static WebArchive createDep1() {
+        return ShrinkWrap.create(WebArchive.class, "application1.war")
+                .addAsWebResource(new StringAsset("Hello from TomEE 1"), "index.html");
+    }
+
+    @Deployment(name = "war2", testable = false)
+    @TargetsContainer("tomee-2")
+    public static WebArchive createDep2() {
+        return ShrinkWrap.create(WebArchive.class, "application2.war")
+                .addAsWebResource(new StringAsset("Hello from TomEE 2"), "index.html");
+    }
+
+    @Test
+    @OperateOnDeployment("war1")
+    public void testRunningInDep1(@ArquillianResource final URL url) throws IOException {
+        final String content = IO.slurp(url);
+        assertEquals("Hello from TomEE 1", content);
+    }
+
+    @Test
+    @OperateOnDeployment("war2")
+    public void testRunningInDep2(@ArquillianResource final URL url) throws IOException {
+        final String content = IO.slurp(url);
+        assertEquals("Hello from TomEE 2", content);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/pom.xml
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/pom.xml b/examples/myfaces-codi-demo/pom.xml
index 5926ffe..aff4d2d 100644
--- a/examples/myfaces-codi-demo/pom.xml
+++ b/examples/myfaces-codi-demo/pom.xml
@@ -15,7 +15,7 @@
   <artifactId>myfaces-codi-demo</artifactId>
 
   <name>OpenEJB :: Examples :: JSF2/CDI/BV/JPA/CODI</name>
-  <version>1.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
 
   <packaging>war</packaging>
 


[02/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java b/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
index 87cb5bc..b874047 100644
--- a/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
+++ b/examples/webservice-handlerchain/src/test/java/org/superbiz/calculator/wsh/CalculatorTest.java
@@ -1,63 +1,63 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.wsh;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class CalculatorTest {
-
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-		
-        //properties.setProperty("httpejbd.print", "true");
-        //properties.setProperty("httpejbd.indent.xml", "true");
-        EJBContainer.createEJBContainer(properties);
-    }
-
-    @Test
-    public void testCalculatorViaWsInterface() throws Exception {
-        final Service calculatorService = Service.create(
-                                                            new URL("http://localhost:" + port + "/webservice-handlerchain/Calculator?wsdl"),
-                                                            new QName("http://superbiz.org/wsdl", "CalculatorService"));
-
-        assertNotNull(calculatorService);
-
-        final CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
-
-        // we expect our answers to come back 1000 times better, plus one!
-        assertEquals(10001, calculator.sum(4, 6));
-        assertEquals(12001, calculator.multiply(3, 4));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.wsh;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class CalculatorTest {
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        //properties.setProperty("httpejbd.print", "true");
+        //properties.setProperty("httpejbd.indent.xml", "true");
+        EJBContainer.createEJBContainer(properties);
+    }
+
+    @Test
+    public void testCalculatorViaWsInterface() throws Exception {
+        final Service calculatorService = Service.create(
+                new URL("http://localhost:" + port + "/webservice-handlerchain/Calculator?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorService"));
+
+        assertNotNull(calculatorService);
+
+        final CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
+
+        // we expect our answers to come back 1000 times better, plus one!
+        assertEquals(10001, calculator.sum(4, 6));
+        assertEquals(12001, calculator.multiply(3, 4));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-holder/src/main/java/org/superbiz/ws/out/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/webservice-holder/src/main/java/org/superbiz/ws/out/Calculator.java b/examples/webservice-holder/src/main/java/org/superbiz/ws/out/Calculator.java
index 706d04d..8638367 100644
--- a/examples/webservice-holder/src/main/java/org/superbiz/ws/out/Calculator.java
+++ b/examples/webservice-holder/src/main/java/org/superbiz/ws/out/Calculator.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.out;
-
-import javax.ejb.Stateless;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-@Stateless
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.ws.out.CalculatorWs")
-public class Calculator implements CalculatorWs {
-
-    public void sumAndMultiply(int a, int b,
-                               @WebParam(name = "sum", mode = WebParam.Mode.OUT) Holder<Integer> sum,
-                               @WebParam(name = "multiply", mode = WebParam.Mode.OUT) Holder<Integer> multiply) {
-        sum.value = a + b;
-        multiply.value = a * b;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.out;
+
+import javax.ejb.Stateless;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@Stateless
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.ws.out.CalculatorWs")
+public class Calculator implements CalculatorWs {
+
+    public void sumAndMultiply(int a, int b,
+                               @WebParam(name = "sum", mode = WebParam.Mode.OUT) Holder<Integer> sum,
+                               @WebParam(name = "multiply", mode = WebParam.Mode.OUT) Holder<Integer> multiply) {
+        sum.value = a + b;
+        multiply.value = a * b;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-holder/src/main/java/org/superbiz/ws/out/CalculatorWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-holder/src/main/java/org/superbiz/ws/out/CalculatorWs.java b/examples/webservice-holder/src/main/java/org/superbiz/ws/out/CalculatorWs.java
index 9d81913..3f2f3ae 100644
--- a/examples/webservice-holder/src/main/java/org/superbiz/ws/out/CalculatorWs.java
+++ b/examples/webservice-holder/src/main/java/org/superbiz/ws/out/CalculatorWs.java
@@ -1,26 +1,26 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.out;
-
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface CalculatorWs {
-
-    public void sumAndMultiply(int a, int b, Holder<Integer> sum, Holder<Integer> multiply);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.out;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface CalculatorWs {
+
+    public void sumAndMultiply(int a, int b, Holder<Integer> sum, Holder<Integer> multiply);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java b/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
index 49a182e..edc441f 100644
--- a/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
+++ b/examples/webservice-holder/src/test/java/org/superbiz/ws/out/CalculatorTest.java
@@ -1,68 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.out;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Holder;
-import javax.xml.ws.Service;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class CalculatorTest {
-
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-		
-        // properties.setProperty("httpejbd.print", "true");
-        // properties.setProperty("httpejbd.indent.xml", "true");
-        EJBContainer.createEJBContainer(properties);
-    }
-
-    @Test
-    public void outParams() throws Exception {
-        final Service calculatorService = Service.create(
-                                                            new URL("http://localhost:" + port + "/webservice-holder/Calculator?wsdl"),
-                                                            new QName("http://superbiz.org/wsdl", "CalculatorService"));
-
-        assertNotNull(calculatorService);
-
-        final CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
-
-        final Holder<Integer> sum = new Holder<Integer>();
-        final Holder<Integer> multiply = new Holder<Integer>();
-
-        calculator.sumAndMultiply(4, 6, sum, multiply);
-
-        assertEquals(10, (int) sum.value);
-        assertEquals(24, (int) multiply.value);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.out;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class CalculatorTest {
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        // properties.setProperty("httpejbd.print", "true");
+        // properties.setProperty("httpejbd.indent.xml", "true");
+        EJBContainer.createEJBContainer(properties);
+    }
+
+    @Test
+    public void outParams() throws Exception {
+        final Service calculatorService = Service.create(
+                new URL("http://localhost:" + port + "/webservice-holder/Calculator?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorService"));
+
+        assertNotNull(calculatorService);
+
+        final CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
+
+        final Holder<Integer> sum = new Holder<Integer>();
+        final Holder<Integer> multiply = new Holder<Integer>();
+
+        calculator.sumAndMultiply(4, 6, sum, multiply);
+
+        assertEquals(10, (int) sum.value);
+        assertEquals(24, (int) multiply.value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Item.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Item.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Item.java
index 919ea20..c89e4aa 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Item.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Item.java
@@ -1,69 +1,69 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import java.io.Serializable;
-
-@Entity
-@Inheritance(strategy = InheritanceType.JOINED)
-public class Item implements Serializable {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private Long id;
-    private String brand;
-    private String itemName;
-    private double price;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getBrand() {
-        return brand;
-    }
-
-    public void setBrand(String brand) {
-        this.brand = brand;
-    }
-
-    public String getItemName() {
-        return itemName;
-    }
-
-    public void setItemName(String itemName) {
-        this.itemName = itemName;
-    }
-
-    public double getPrice() {
-        return price;
-    }
-
-    public void setPrice(double price) {
-        this.price = price;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import java.io.Serializable;
+
+@Entity
+@Inheritance(strategy = InheritanceType.JOINED)
+public class Item implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private Long id;
+    private String brand;
+    private String itemName;
+    private double price;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Tower.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Tower.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Tower.java
index 427f3c7..5f68117 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Tower.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Tower.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Tower extends Item {
-
-    private Fit fit;
-    private String tubing;
-
-    public static enum Fit {
-        Custom,
-        Exact,
-        Universal
-    }
-
-    public Fit getFit() {
-        return fit;
-    }
-
-    public void setFit(Fit fit) {
-        this.fit = fit;
-    }
-
-    public String getTubing() {
-        return tubing;
-    }
-
-    public void setTubing(String tubing) {
-        this.tubing = tubing;
-    }
-
-    ;
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Tower extends Item {
+
+    private Fit fit;
+    private String tubing;
+
+    public static enum Fit {
+        Custom,
+        Exact,
+        Universal
+    }
+
+    public Fit getFit() {
+        return fit;
+    }
+
+    public void setFit(Fit fit) {
+        this.fit = fit;
+    }
+
+    public String getTubing() {
+        return tubing;
+    }
+
+    public void setTubing(String tubing) {
+        this.tubing = tubing;
+    }
+
+    ;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderImpl.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderImpl.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderImpl.java
index 0c76eb1..dd813b7 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderImpl.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderImpl.java
@@ -1,56 +1,56 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-/**
- * This is an EJB 3 style pojo stateless session bean Every stateless session
- * bean implementation must be annotated using the annotation @Stateless This
- * EJB has a single interface: {@link WakeRiderWs} a webservice interface.
- */
-@Stateless
-@WebService(
-               portName = "InheritancePort",
-               serviceName = "InheritanceWsService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.inheritance.WakeRiderWs")
-public class WakeRiderImpl implements WakeRiderWs {
-
-    @PersistenceContext(unitName = "wakeboard-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addItem(Item item) throws Exception {
-        entityManager.persist(item);
-    }
-
-    public void deleteMovie(Item item) throws Exception {
-        entityManager.remove(item);
-    }
-
-    public List<Item> getItems() throws Exception {
-        Query query = entityManager.createQuery("SELECT i FROM Item i");
-        List<Item> items = query.getResultList();
-        return items;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+/**
+ * This is an EJB 3 style pojo stateless session bean Every stateless session
+ * bean implementation must be annotated using the annotation @Stateless This
+ * EJB has a single interface: {@link WakeRiderWs} a webservice interface.
+ */
+@Stateless
+@WebService(
+        portName = "InheritancePort",
+        serviceName = "InheritanceWsService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.inheritance.WakeRiderWs")
+public class WakeRiderImpl implements WakeRiderWs {
+
+    @PersistenceContext(unitName = "wakeboard-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addItem(Item item) throws Exception {
+        entityManager.persist(item);
+    }
+
+    public void deleteMovie(Item item) throws Exception {
+        entityManager.remove(item);
+    }
+
+    public List<Item> getItems() throws Exception {
+        Query query = entityManager.createQuery("SELECT i FROM Item i");
+        List<Item> items = query.getResultList();
+        return items;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderWs.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderWs.java
index 372caa4..34aaa51 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderWs.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeRiderWs.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import java.util.List;
-
-/**
- * This is an EJB 3 webservice interface that uses inheritance.
- */
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-@XmlSeeAlso({Wakeboard.class, WakeboardBinding.class, Tower.class})
-public interface WakeRiderWs {
-
-    public void addItem(Item item) throws Exception;
-
-    public void deleteMovie(Item item) throws Exception;
-
-    public List<Item> getItems() throws Exception;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.List;
+
+/**
+ * This is an EJB 3 webservice interface that uses inheritance.
+ */
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+@XmlSeeAlso({Wakeboard.class, WakeboardBinding.class, Tower.class})
+public interface WakeRiderWs {
+
+    public void addItem(Item item) throws Exception;
+
+    public void deleteMovie(Item item) throws Exception;
+
+    public List<Item> getItems() throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wakeboard.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wakeboard.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wakeboard.java
index 231115d..2929acf 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wakeboard.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wakeboard.java
@@ -1,24 +1,24 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Wakeboard extends Wearable {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Wakeboard extends Wearable {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeboardBinding.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeboardBinding.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeboardBinding.java
index def1c0e..fb60976 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeboardBinding.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/WakeboardBinding.java
@@ -1,24 +1,24 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.persistence.Entity;
-
-@Entity
-public class WakeboardBinding extends Wearable {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.persistence.Entity;
+
+@Entity
+public class WakeboardBinding extends Wearable {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wearable.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wearable.java b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wearable.java
index 6db5073..aa22d09 100644
--- a/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wearable.java
+++ b/examples/webservice-inheritance/src/main/java/org/superbiz/inheritance/Wearable.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import javax.persistence.MappedSuperclass;
-
-@MappedSuperclass
-public abstract class Wearable extends Item {
-
-    protected String size;
-
-    public String getSize() {
-        return size;
-    }
-
-    public void setSize(String size) {
-        this.size = size;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import javax.persistence.MappedSuperclass;
+
+@MappedSuperclass
+public abstract class Wearable extends Item {
+
+    protected String size;
+
+    public String getSize() {
+        return size;
+    }
+
+    public void setSize(String size) {
+        this.size = size;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java b/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
index 0adb975..e63c4da 100644
--- a/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
+++ b/examples/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
@@ -1,157 +1,157 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.inheritance;
-
-import junit.framework.TestCase;
-import org.superbiz.inheritance.Tower.Fit;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import java.net.URL;
-import java.util.List;
-import java.util.Properties;
-
-public class InheritanceTest extends TestCase {
-
-    //START SNIPPET: setup	
-    private InitialContext initialContext;
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    protected void setUp() throws Exception {
-
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.put("wakeBoardDatabase", "new://Resource?type=DataSource");
-        p.put("wakeBoardDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("wakeBoardDatabase.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");
-
-        p.put("wakeBoardDatabaseUnmanaged", "new://Resource?type=DataSource");
-        p.put("wakeBoardDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("wakeBoardDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");
-        p.put("wakeBoardDatabaseUnmanaged.JtaManaged", "false");
-
-        p.put("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		p.put("httpejbd.port", "" + port);
-
-        initialContext = new InitialContext(p);
-    }
-    //END SNIPPET: setup    
-
-    /**
-     * Create a webservice client using wsdl url
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: webservice
-    public void testInheritanceViaWsInterface() throws Exception {
-        Service service = Service.create(
-                                            new URL("http://localhost:" + port + "/webservice-inheritance/WakeRiderImpl?wsdl"),
-                                            new QName("http://superbiz.org/wsdl", "InheritanceWsService"));
-        assertNotNull(service);
-
-        WakeRiderWs ws = service.getPort(WakeRiderWs.class);
-
-        Tower tower = createTower();
-        Item item = createItem();
-        Wakeboard wakeBoard = createWakeBoard();
-        WakeboardBinding wakeBoardbinding = createWakeboardBinding();
-
-        ws.addItem(tower);
-        ws.addItem(item);
-        ws.addItem(wakeBoard);
-        ws.addItem(wakeBoardbinding);
-
-        List<Item> returnedItems = ws.getItems();
-
-        assertEquals("testInheritanceViaWsInterface, nb Items", 4, returnedItems.size());
-
-        //check tower
-        assertEquals("testInheritanceViaWsInterface, first Item", returnedItems.get(0).getClass(), Tower.class);
-        tower = (Tower) returnedItems.get(0);
-        assertEquals("testInheritanceViaWsInterface, first Item", tower.getBrand(), "Tower brand");
-        assertEquals("testInheritanceViaWsInterface, first Item", tower.getFit().ordinal(), Fit.Custom.ordinal());
-        assertEquals("testInheritanceViaWsInterface, first Item", tower.getItemName(), "Tower item name");
-        assertEquals("testInheritanceViaWsInterface, first Item", tower.getPrice(), 1.0d);
-        assertEquals("testInheritanceViaWsInterface, first Item", tower.getTubing(), "Tower tubing");
-
-        //check item
-        assertEquals("testInheritanceViaWsInterface, second Item", returnedItems.get(1).getClass(), Item.class);
-        item = (Item) returnedItems.get(1);
-        assertEquals("testInheritanceViaWsInterface, second Item", item.getBrand(), "Item brand");
-        assertEquals("testInheritanceViaWsInterface, second Item", item.getItemName(), "Item name");
-        assertEquals("testInheritanceViaWsInterface, second Item", item.getPrice(), 2.0d);
-
-        //check wakeboard
-        assertEquals("testInheritanceViaWsInterface, third Item", returnedItems.get(2).getClass(), Wakeboard.class);
-        wakeBoard = (Wakeboard) returnedItems.get(2);
-        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getBrand(), "Wakeboard brand");
-        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getItemName(), "Wakeboard item name");
-        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getPrice(), 3.0d);
-        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getSize(), "WakeBoard size");
-
-        //check wakeboardbinding
-        assertEquals("testInheritanceViaWsInterface, fourth Item", returnedItems.get(3).getClass(), WakeboardBinding.class);
-        wakeBoardbinding = (WakeboardBinding) returnedItems.get(3);
-        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getBrand(), "Wakeboardbinding brand");
-        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getItemName(), "Wakeboardbinding item name");
-        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getPrice(), 4.0d);
-        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getSize(), "WakeBoardbinding size");
-    }
-    //END SNIPPET: webservice
-
-    private Tower createTower() {
-        Tower tower = new Tower();
-        tower.setBrand("Tower brand");
-        tower.setFit(Fit.Custom);
-        tower.setItemName("Tower item name");
-        tower.setPrice(1.0f);
-        tower.setTubing("Tower tubing");
-        return tower;
-    }
-
-    private Item createItem() {
-        Item item = new Item();
-        item.setBrand("Item brand");
-        item.setItemName("Item name");
-        item.setPrice(2.0f);
-        return item;
-    }
-
-    private Wakeboard createWakeBoard() {
-        Wakeboard wakeBoard = new Wakeboard();
-        wakeBoard.setBrand("Wakeboard brand");
-        wakeBoard.setItemName("Wakeboard item name");
-        wakeBoard.setPrice(3.0f);
-        wakeBoard.setSize("WakeBoard size");
-        return wakeBoard;
-    }
-
-    private WakeboardBinding createWakeboardBinding() {
-        WakeboardBinding wakeBoardBinding = new WakeboardBinding();
-        wakeBoardBinding.setBrand("Wakeboardbinding brand");
-        wakeBoardBinding.setItemName("Wakeboardbinding item name");
-        wakeBoardBinding.setPrice(4.0f);
-        wakeBoardBinding.setSize("WakeBoardbinding size");
-        return wakeBoardBinding;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.inheritance;
+
+import junit.framework.TestCase;
+import org.superbiz.inheritance.Tower.Fit;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+
+public class InheritanceTest extends TestCase {
+
+    //START SNIPPET: setup	
+    private InitialContext initialContext;
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    protected void setUp() throws Exception {
+
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.put("wakeBoardDatabase", "new://Resource?type=DataSource");
+        p.put("wakeBoardDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("wakeBoardDatabase.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");
+
+        p.put("wakeBoardDatabaseUnmanaged", "new://Resource?type=DataSource");
+        p.put("wakeBoardDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("wakeBoardDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");
+        p.put("wakeBoardDatabaseUnmanaged.JtaManaged", "false");
+
+        p.put("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        p.put("httpejbd.port", "" + port);
+
+        initialContext = new InitialContext(p);
+    }
+    //END SNIPPET: setup    
+
+    /**
+     * Create a webservice client using wsdl url
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: webservice
+    public void testInheritanceViaWsInterface() throws Exception {
+        Service service = Service.create(
+                new URL("http://localhost:" + port + "/webservice-inheritance/WakeRiderImpl?wsdl"),
+                new QName("http://superbiz.org/wsdl", "InheritanceWsService"));
+        assertNotNull(service);
+
+        WakeRiderWs ws = service.getPort(WakeRiderWs.class);
+
+        Tower tower = createTower();
+        Item item = createItem();
+        Wakeboard wakeBoard = createWakeBoard();
+        WakeboardBinding wakeBoardbinding = createWakeboardBinding();
+
+        ws.addItem(tower);
+        ws.addItem(item);
+        ws.addItem(wakeBoard);
+        ws.addItem(wakeBoardbinding);
+
+        List<Item> returnedItems = ws.getItems();
+
+        assertEquals("testInheritanceViaWsInterface, nb Items", 4, returnedItems.size());
+
+        //check tower
+        assertEquals("testInheritanceViaWsInterface, first Item", returnedItems.get(0).getClass(), Tower.class);
+        tower = (Tower) returnedItems.get(0);
+        assertEquals("testInheritanceViaWsInterface, first Item", tower.getBrand(), "Tower brand");
+        assertEquals("testInheritanceViaWsInterface, first Item", tower.getFit().ordinal(), Fit.Custom.ordinal());
+        assertEquals("testInheritanceViaWsInterface, first Item", tower.getItemName(), "Tower item name");
+        assertEquals("testInheritanceViaWsInterface, first Item", tower.getPrice(), 1.0d);
+        assertEquals("testInheritanceViaWsInterface, first Item", tower.getTubing(), "Tower tubing");
+
+        //check item
+        assertEquals("testInheritanceViaWsInterface, second Item", returnedItems.get(1).getClass(), Item.class);
+        item = (Item) returnedItems.get(1);
+        assertEquals("testInheritanceViaWsInterface, second Item", item.getBrand(), "Item brand");
+        assertEquals("testInheritanceViaWsInterface, second Item", item.getItemName(), "Item name");
+        assertEquals("testInheritanceViaWsInterface, second Item", item.getPrice(), 2.0d);
+
+        //check wakeboard
+        assertEquals("testInheritanceViaWsInterface, third Item", returnedItems.get(2).getClass(), Wakeboard.class);
+        wakeBoard = (Wakeboard) returnedItems.get(2);
+        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getBrand(), "Wakeboard brand");
+        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getItemName(), "Wakeboard item name");
+        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getPrice(), 3.0d);
+        assertEquals("testInheritanceViaWsInterface, third Item", wakeBoard.getSize(), "WakeBoard size");
+
+        //check wakeboardbinding
+        assertEquals("testInheritanceViaWsInterface, fourth Item", returnedItems.get(3).getClass(), WakeboardBinding.class);
+        wakeBoardbinding = (WakeboardBinding) returnedItems.get(3);
+        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getBrand(), "Wakeboardbinding brand");
+        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getItemName(), "Wakeboardbinding item name");
+        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getPrice(), 4.0d);
+        assertEquals("testInheritanceViaWsInterface, fourth Item", wakeBoardbinding.getSize(), "WakeBoardbinding size");
+    }
+    //END SNIPPET: webservice
+
+    private Tower createTower() {
+        Tower tower = new Tower();
+        tower.setBrand("Tower brand");
+        tower.setFit(Fit.Custom);
+        tower.setItemName("Tower item name");
+        tower.setPrice(1.0f);
+        tower.setTubing("Tower tubing");
+        return tower;
+    }
+
+    private Item createItem() {
+        Item item = new Item();
+        item.setBrand("Item brand");
+        item.setItemName("Item name");
+        item.setPrice(2.0f);
+        return item;
+    }
+
+    private Wakeboard createWakeBoard() {
+        Wakeboard wakeBoard = new Wakeboard();
+        wakeBoard.setBrand("Wakeboard brand");
+        wakeBoard.setItemName("Wakeboard item name");
+        wakeBoard.setPrice(3.0f);
+        wakeBoard.setSize("WakeBoard size");
+        return wakeBoard;
+    }
+
+    private WakeboardBinding createWakeboardBinding() {
+        WakeboardBinding wakeBoardBinding = new WakeboardBinding();
+        wakeBoardBinding.setBrand("Wakeboardbinding brand");
+        wakeBoardBinding.setItemName("Wakeboardbinding item name");
+        wakeBoardBinding.setPrice(4.0f);
+        wakeBoardBinding.setSize("WakeBoardbinding size");
+        return wakeBoardBinding;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
----------------------------------------------------------------------
diff --git a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
index cab94a1..6004523 100644
--- a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
+++ b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.annotation.security.DeclareRoles;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-/**
- * This is an EJB 3 style pojo stateless session bean
- * Every stateless session bean implementation must be annotated
- * using the annotation @Stateless
- * This EJB has a single interface: CalculatorWs a webservice interface.
- */
-//START SNIPPET: code
-@DeclareRoles(value = {"Administrator"})
-@Stateless
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorWsService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.calculator.CalculatorWs")
-public class CalculatorImpl implements CalculatorWs, CalculatorRemote {
-
-    @RolesAllowed(value = {"Administrator"})
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    @RolesAllowed(value = {"Administrator"})
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+/**
+ * This is an EJB 3 style pojo stateless session bean
+ * Every stateless session bean implementation must be annotated
+ * using the annotation @Stateless
+ * This EJB has a single interface: CalculatorWs a webservice interface.
+ */
+//START SNIPPET: code
+@DeclareRoles(value = {"Administrator"})
+@Stateless
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorWsService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.calculator.CalculatorWs")
+public class CalculatorImpl implements CalculatorWs, CalculatorRemote {
+
+    @RolesAllowed(value = {"Administrator"})
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    @RolesAllowed(value = {"Administrator"})
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
----------------------------------------------------------------------
diff --git a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
index 31149f2..66e9eb3 100644
--- a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
+++ b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
@@ -1,28 +1,28 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface CalculatorRemote {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface CalculatorRemote {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorWs.java b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
index 8feb08f..02521b9 100644
--- a/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
+++ b/examples/webservice-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.jws.WebService;
-
-//END SNIPPET: code
-
-/**
- * This is an EJB 3 webservice interface
- * A webservice interface must be annotated with the @Local
- * annotation.
- */
-//START SNIPPET: code
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface CalculatorWs {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.jws.WebService;
+
+//END SNIPPET: code
+
+/**
+ * This is an EJB 3 webservice interface
+ * A webservice interface must be annotated with the @Local
+ * annotation.
+ */
+//START SNIPPET: code
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface CalculatorWs {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java b/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
index ef226e7..14cf1a3 100644
--- a/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
+++ b/examples/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
@@ -1,69 +1,69 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import junit.framework.TestCase;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import java.net.URL;
-import java.util.Properties;
-
-public class CalculatorTest extends TestCase {
-
-    //START SNIPPET: setup
-    private InitialContext initialContext;
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    protected void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-
-        initialContext = new InitialContext(properties);
-    }
-    //END SNIPPET: setup
-
-    /**
-     * Create a webservice client using wsdl url
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: webservice
-    public void testCalculatorViaWsInterface() throws Exception {
-        URL url = new URL("http://localhost:" + port + "/webservice-security/CalculatorImpl?wsdl");
-        QName calcServiceQName = new QName("http://superbiz.org/wsdl", "CalculatorWsService");
-        Service calcService = Service.create(url, calcServiceQName);
-        assertNotNull(calcService);
-
-        CalculatorWs calc = calcService.getPort(CalculatorWs.class);
-        ((BindingProvider) calc).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "jane");
-        ((BindingProvider) calc).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "waterfall");
-        assertEquals(10, calc.sum(4, 6));
-        assertEquals(12, calc.multiply(3, 4));
-    }
-    //END SNIPPET: webservice
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.Properties;
+
+public class CalculatorTest extends TestCase {
+
+    //START SNIPPET: setup
+    private InitialContext initialContext;
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    protected void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        initialContext = new InitialContext(properties);
+    }
+    //END SNIPPET: setup
+
+    /**
+     * Create a webservice client using wsdl url
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: webservice
+    public void testCalculatorViaWsInterface() throws Exception {
+        URL url = new URL("http://localhost:" + port + "/webservice-security/CalculatorImpl?wsdl");
+        QName calcServiceQName = new QName("http://superbiz.org/wsdl", "CalculatorWsService");
+        Service calcService = Service.create(url, calcServiceQName);
+        assertNotNull(calcService);
+
+        CalculatorWs calc = calcService.getPort(CalculatorWs.class);
+        ((BindingProvider) calc).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "jane");
+        ((BindingProvider) calc).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "waterfall");
+        assertEquals(10, calc.sum(4, 6));
+        assertEquals(12, calc.multiply(3, 4));
+    }
+    //END SNIPPET: webservice
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
index fa5e800..8a12afa 100644
--- a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
+++ b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorImpl.java
@@ -1,52 +1,52 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.annotation.security.DeclareRoles;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-/**
- * This is an EJB 3 style pojo stateless session bean
- * Every stateless session bean implementation must be annotated
- * using the annotation @Stateless
- * This EJB has a single interface: CalculatorWs a webservice interface.
- */
-//START SNIPPET: code
-@DeclareRoles(value = {"Administrator"})
-@Stateless
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorWsService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.calculator.CalculatorWs")
-public class CalculatorImpl implements CalculatorWs, CalculatorRemote {
-
-    @Override
-    @RolesAllowed(value = {"Administrator"})
-    public int sum(final int add1, final int add2) {
-        return add1 + add2;
-    }
-
-    @Override
-    public int multiply(final int mul1, final int mul2) {
-        return mul1 * mul2;
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+/**
+ * This is an EJB 3 style pojo stateless session bean
+ * Every stateless session bean implementation must be annotated
+ * using the annotation @Stateless
+ * This EJB has a single interface: CalculatorWs a webservice interface.
+ */
+//START SNIPPET: code
+@DeclareRoles(value = {"Administrator"})
+@Stateless
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorWsService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.calculator.CalculatorWs")
+public class CalculatorImpl implements CalculatorWs, CalculatorRemote {
+
+    @Override
+    @RolesAllowed(value = {"Administrator"})
+    public int sum(final int add1, final int add2) {
+        return add1 + add2;
+    }
+
+    @Override
+    public int multiply(final int mul1, final int mul2) {
+        return mul1 * mul2;
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
index 68fed28..66e9eb3 100644
--- a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
+++ b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorRemote.java
@@ -1,28 +1,28 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface CalculatorRemote {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface CalculatorRemote {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
----------------------------------------------------------------------
diff --git a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorWs.java b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
index 8feb08f..02521b9 100644
--- a/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
+++ b/examples/webservice-ws-security/src/main/java/org/superbiz/calculator/CalculatorWs.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.jws.WebService;
-
-//END SNIPPET: code
-
-/**
- * This is an EJB 3 webservice interface
- * A webservice interface must be annotated with the @Local
- * annotation.
- */
-//START SNIPPET: code
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface CalculatorWs {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.jws.WebService;
+
+//END SNIPPET: code
+
+/**
+ * This is an EJB 3 webservice interface
+ * A webservice interface must be annotated with the @Local
+ * annotation.
+ */
+//START SNIPPET: code
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface CalculatorWs {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+}
 //END SNIPPET: code
\ No newline at end of file


[26/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonRemote.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonRemote.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonRemote.java
index 92f352a..8b378d1 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonRemote.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonRemote.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import javax.ejb.Remote;
-
-//START SNIPPET: code
-@Remote
-public interface FriendlyPersonRemote {
-
-    String greet(String friend);
-
-    String greet(String language, String friend);
-
-    void addGreeting(String language, String message);
-
-    void setLanguagePreferences(String friend, String language);
-
-    String getDefaultLanguage();
-
-    void setDefaultLanguage(String defaultLanguage);
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.ejb.Remote;
+
+//START SNIPPET: code
+@Remote
+public interface FriendlyPersonRemote {
+
+    String greet(String friend);
+
+    String greet(String language, String friend);
+
+    void addGreeting(String language, String message);
+
+    void setLanguagePreferences(String friend, String language);
+
+    String getDefaultLanguage();
+
+    void setDefaultLanguage(String defaultLanguage);
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/test/java/org/superbiz/FriendlyPersonTest.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/test/java/org/superbiz/FriendlyPersonTest.java b/examples/component-interfaces/src/test/java/org/superbiz/FriendlyPersonTest.java
index 6a31fbf..60cb575 100644
--- a/examples/component-interfaces/src/test/java/org/superbiz/FriendlyPersonTest.java
+++ b/examples/component-interfaces/src/test/java/org/superbiz/FriendlyPersonTest.java
@@ -1,180 +1,180 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.Locale;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FriendlyPersonTest extends TestCase {
-
-    private Context context;
-
-    protected void setUp() throws Exception {
-        context = EJBContainer.createEJBContainer().getContext();
-    }
-
-    /**
-     * Here we lookup and test the FriendlyPerson bean via its EJB 2.1 EJBHome and EJBObject interfaces
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: remotehome
-    public void testEjbHomeAndEjbObject() throws Exception {
-        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonEjbHome");
-        FriendlyPersonEjbHome home = (FriendlyPersonEjbHome) object;
-        FriendlyPersonEjbObject friendlyPerson = home.create();
-
-        friendlyPerson.setDefaultLanguage("en");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
-
-        friendlyPerson.setLanguagePreferences("Amelia", "es");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
-
-        // Amelia took some French, let's see if she remembers
-        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
-
-        // Dave should take some Polish and if he had, he could say Hi in Polish
-        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
-
-        // Let's see if I speak Portuguese
-        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
-
-        // Ok, well I've been meaning to learn, so...
-        friendlyPerson.addGreeting("pt", "Ola {0}!");
-
-        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
-    }
-    //END SNIPPET: remotehome
-
-    /**
-     * Here we lookup and test the FriendlyPerson bean via its EJB 2.1 EJBLocalHome and EJBLocalObject interfaces
-     *
-     * @throws Exception
-     */
-    public void testEjbLocalHomeAndEjbLocalObject() throws Exception {
-        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonEjbLocalHome");
-        FriendlyPersonEjbLocalHome home = (FriendlyPersonEjbLocalHome) object;
-        FriendlyPersonEjbLocalObject friendlyPerson = home.create();
-
-        friendlyPerson.setDefaultLanguage("en");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
-
-        friendlyPerson.setLanguagePreferences("Amelia", "es");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
-
-        // Amelia took some French, let's see if she remembers
-        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
-
-        // Dave should take some Polish and if he had, he could say Hi in Polish
-        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
-
-        // Let's see if I speak Portuguese
-        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
-
-        // Ok, well I've been meaning to learn, so...
-        friendlyPerson.addGreeting("pt", "Ola {0}!");
-
-        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
-    }
-
-    /**
-     * Here we lookup and test the FriendlyPerson bean via its EJB 3.0 business remote interface
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: remote
-    public void testBusinessRemote() throws Exception {
-        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonRemote");
-
-        FriendlyPersonRemote friendlyPerson = (FriendlyPersonRemote) object;
-
-        friendlyPerson.setDefaultLanguage("en");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
-
-        friendlyPerson.setLanguagePreferences("Amelia", "es");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
-
-        // Amelia took some French, let's see if she remembers
-        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
-
-        // Dave should take some Polish and if he had, he could say Hi in Polish
-        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
-
-        // Let's see if I speak Portuguese
-        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
-
-        // Ok, well I've been meaning to learn, so...
-        friendlyPerson.addGreeting("pt", "Ola {0}!");
-
-        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
-    }
-    //START SNIPPET: remote
-
-    /**
-     * Here we lookup and test the FriendlyPerson bean via its EJB 3.0 business local interface
-     *
-     * @throws Exception
-     */
-    public void testBusinessLocal() throws Exception {
-        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonLocal");
-
-        FriendlyPersonLocal friendlyPerson = (FriendlyPersonLocal) object;
-
-        friendlyPerson.setDefaultLanguage("en");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
-
-        friendlyPerson.setLanguagePreferences("Amelia", "es");
-
-        assertEquals("Hello David!", friendlyPerson.greet("David"));
-        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
-
-        // Amelia took some French, let's see if she remembers
-        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
-
-        // Dave should take some Polish and if he had, he could say Hi in Polish
-        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
-
-        // Let's see if I speak Portuguese
-        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
-
-        // Ok, well I've been meaning to learn, so...
-        friendlyPerson.addGreeting("pt", "Ola {0}!");
-
-        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.Locale;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class FriendlyPersonTest extends TestCase {
+
+    private Context context;
+
+    protected void setUp() throws Exception {
+        context = EJBContainer.createEJBContainer().getContext();
+    }
+
+    /**
+     * Here we lookup and test the FriendlyPerson bean via its EJB 2.1 EJBHome and EJBObject interfaces
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: remotehome
+    public void testEjbHomeAndEjbObject() throws Exception {
+        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonEjbHome");
+        FriendlyPersonEjbHome home = (FriendlyPersonEjbHome) object;
+        FriendlyPersonEjbObject friendlyPerson = home.create();
+
+        friendlyPerson.setDefaultLanguage("en");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
+
+        friendlyPerson.setLanguagePreferences("Amelia", "es");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
+
+        // Amelia took some French, let's see if she remembers
+        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
+
+        // Dave should take some Polish and if he had, he could say Hi in Polish
+        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
+
+        // Let's see if I speak Portuguese
+        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
+
+        // Ok, well I've been meaning to learn, so...
+        friendlyPerson.addGreeting("pt", "Ola {0}!");
+
+        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
+    }
+    //END SNIPPET: remotehome
+
+    /**
+     * Here we lookup and test the FriendlyPerson bean via its EJB 2.1 EJBLocalHome and EJBLocalObject interfaces
+     *
+     * @throws Exception
+     */
+    public void testEjbLocalHomeAndEjbLocalObject() throws Exception {
+        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonEjbLocalHome");
+        FriendlyPersonEjbLocalHome home = (FriendlyPersonEjbLocalHome) object;
+        FriendlyPersonEjbLocalObject friendlyPerson = home.create();
+
+        friendlyPerson.setDefaultLanguage("en");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
+
+        friendlyPerson.setLanguagePreferences("Amelia", "es");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
+
+        // Amelia took some French, let's see if she remembers
+        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
+
+        // Dave should take some Polish and if he had, he could say Hi in Polish
+        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
+
+        // Let's see if I speak Portuguese
+        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
+
+        // Ok, well I've been meaning to learn, so...
+        friendlyPerson.addGreeting("pt", "Ola {0}!");
+
+        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
+    }
+
+    /**
+     * Here we lookup and test the FriendlyPerson bean via its EJB 3.0 business remote interface
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: remote
+    public void testBusinessRemote() throws Exception {
+        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonRemote");
+
+        FriendlyPersonRemote friendlyPerson = (FriendlyPersonRemote) object;
+
+        friendlyPerson.setDefaultLanguage("en");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
+
+        friendlyPerson.setLanguagePreferences("Amelia", "es");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
+
+        // Amelia took some French, let's see if she remembers
+        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
+
+        // Dave should take some Polish and if he had, he could say Hi in Polish
+        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
+
+        // Let's see if I speak Portuguese
+        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
+
+        // Ok, well I've been meaning to learn, so...
+        friendlyPerson.addGreeting("pt", "Ola {0}!");
+
+        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
+    }
+    //START SNIPPET: remote
+
+    /**
+     * Here we lookup and test the FriendlyPerson bean via its EJB 3.0 business local interface
+     *
+     * @throws Exception
+     */
+    public void testBusinessLocal() throws Exception {
+        Object object = context.lookup("java:global/component-interfaces/FriendlyPerson!org.superbiz.FriendlyPersonLocal");
+
+        FriendlyPersonLocal friendlyPerson = (FriendlyPersonLocal) object;
+
+        friendlyPerson.setDefaultLanguage("en");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hello Amelia!", friendlyPerson.greet("Amelia"));
+
+        friendlyPerson.setLanguagePreferences("Amelia", "es");
+
+        assertEquals("Hello David!", friendlyPerson.greet("David"));
+        assertEquals("Hola Amelia!", friendlyPerson.greet("Amelia"));
+
+        // Amelia took some French, let's see if she remembers
+        assertEquals("Bonjour Amelia!", friendlyPerson.greet("fr", "Amelia"));
+
+        // Dave should take some Polish and if he had, he could say Hi in Polish
+        assertEquals("Witaj Dave!", friendlyPerson.greet("pl", "Dave"));
+
+        // Let's see if I speak Portuguese
+        assertEquals("Sorry, I don't speak " + new Locale("pt").getDisplayLanguage() + ".", friendlyPerson.greet("pt", "David"));
+
+        // Ok, well I've been meaning to learn, so...
+        friendlyPerson.addGreeting("pt", "Ola {0}!");
+
+        assertEquals("Ola David!", friendlyPerson.greet("pt", "David"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/custom-injection/src/main/java/org/superbiz/enventries/Pickup.java
----------------------------------------------------------------------
diff --git a/examples/custom-injection/src/main/java/org/superbiz/enventries/Pickup.java b/examples/custom-injection/src/main/java/org/superbiz/enventries/Pickup.java
index 650a4fa..b33dd5a 100644
--- a/examples/custom-injection/src/main/java/org/superbiz/enventries/Pickup.java
+++ b/examples/custom-injection/src/main/java/org/superbiz/enventries/Pickup.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enventries;
-
-//START SNIPPET: code
-
-import java.beans.PropertyEditorManager;
-
-public enum Pickup {
-
-    HUMBUCKER,
-    SINGLE_COIL;
-
-    // Here's the little magic where we register the PickupEditor
-    // which knows how to create this object from a string.
-    // You can add any of your own Property Editors in the same way.
-    static {
-        PropertyEditorManager.registerEditor(Pickup.class, PickupEditor.class);
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enventries;
+
+//START SNIPPET: code
+
+import java.beans.PropertyEditorManager;
+
+public enum Pickup {
+
+    HUMBUCKER,
+    SINGLE_COIL;
+
+    // Here's the little magic where we register the PickupEditor
+    // which knows how to create this object from a string.
+    // You can add any of your own Property Editors in the same way.
+    static {
+        PropertyEditorManager.registerEditor(Pickup.class, PickupEditor.class);
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/custom-injection/src/main/java/org/superbiz/enventries/PickupEditor.java
----------------------------------------------------------------------
diff --git a/examples/custom-injection/src/main/java/org/superbiz/enventries/PickupEditor.java b/examples/custom-injection/src/main/java/org/superbiz/enventries/PickupEditor.java
index 05b8207..808cfe2 100644
--- a/examples/custom-injection/src/main/java/org/superbiz/enventries/PickupEditor.java
+++ b/examples/custom-injection/src/main/java/org/superbiz/enventries/PickupEditor.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enventries;
-
-/**
- * With a java.beans.PropertyEditor, you can go way beyond the built-in
- * types that OpenEJB supports and can extend dependency injection to
- * just about anywhere.
- * <p/>
- * In the world of electric guitars, two types of pickups are used: humbucking, and single-coil.
- * Guitarists often refer to their guitars as HSS, meaning a guitar with 1 humbucker and
- * 2 single coil pickups, and so on.  This little PropertyEditor supports that shorthand notation.
- *
- * @version $Revision$ $Date$
- */
-//START SNIPPET: code
-public class PickupEditor extends java.beans.PropertyEditorSupport {
-
-    public void setAsText(String text) throws IllegalArgumentException {
-        text = text.trim();
-
-        if (text.equalsIgnoreCase("H")) {
-            setValue(Pickup.HUMBUCKER);
-        } else if (text.equalsIgnoreCase("S")) {
-            setValue(Pickup.SINGLE_COIL);
-        } else {
-            throw new IllegalStateException("H and S are the only supported Pickup aliases");
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enventries;
+
+/**
+ * With a java.beans.PropertyEditor, you can go way beyond the built-in
+ * types that OpenEJB supports and can extend dependency injection to
+ * just about anywhere.
+ * <p/>
+ * In the world of electric guitars, two types of pickups are used: humbucking, and single-coil.
+ * Guitarists often refer to their guitars as HSS, meaning a guitar with 1 humbucker and
+ * 2 single coil pickups, and so on.  This little PropertyEditor supports that shorthand notation.
+ *
+ * @version $Revision$ $Date$
+ */
+//START SNIPPET: code
+public class PickupEditor extends java.beans.PropertyEditorSupport {
+
+    public void setAsText(String text) throws IllegalArgumentException {
+        text = text.trim();
+
+        if (text.equalsIgnoreCase("H")) {
+            setValue(Pickup.HUMBUCKER);
+        } else if (text.equalsIgnoreCase("S")) {
+            setValue(Pickup.SINGLE_COIL);
+        } else {
+            throw new IllegalStateException("H and S are the only supported Pickup aliases");
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/custom-injection/src/main/java/org/superbiz/enventries/Stratocaster.java
----------------------------------------------------------------------
diff --git a/examples/custom-injection/src/main/java/org/superbiz/enventries/Stratocaster.java b/examples/custom-injection/src/main/java/org/superbiz/enventries/Stratocaster.java
index 29f5f9f..95a2fcf 100644
--- a/examples/custom-injection/src/main/java/org/superbiz/enventries/Stratocaster.java
+++ b/examples/custom-injection/src/main/java/org/superbiz/enventries/Stratocaster.java
@@ -1,76 +1,76 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enventries;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-import java.io.File;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * In addition to the standard env-entry types (String, Integer, Long, Short, Byte, Boolean, Double, Float, Character)
- * OpenEJB supports many other types.
- */
-//START SNIPPET: code
-@Stateless
-public class Stratocaster {
-
-    @Resource(name = "pickups")
-    private List<Pickup> pickups;
-
-    @Resource(name = "style")
-    private Style style;
-
-    @Resource(name = "dateCreated")
-    private Date dateCreated;
-
-    @Resource(name = "guitarStringGuages")
-    private Map<String, Float> guitarStringGuages;
-
-    @Resource(name = "certificateOfAuthenticity")
-    private File certificateOfAuthenticity;
-
-    public Date getDateCreated() {
-        return dateCreated;
-    }
-
-    /**
-     * Gets the guage of the electric guitar strings
-     * used in this guitar.
-     *
-     * @param string
-     * @return
-     */
-    public float getStringGuage(String string) {
-        return guitarStringGuages.get(string);
-    }
-
-    public List<Pickup> getPickups() {
-        return pickups;
-    }
-
-    public Style getStyle() {
-        return style;
-    }
-
-    public File getCertificateOfAuthenticity() {
-        return certificateOfAuthenticity;
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enventries;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import java.io.File;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * In addition to the standard env-entry types (String, Integer, Long, Short, Byte, Boolean, Double, Float, Character)
+ * OpenEJB supports many other types.
+ */
+//START SNIPPET: code
+@Stateless
+public class Stratocaster {
+
+    @Resource(name = "pickups")
+    private List<Pickup> pickups;
+
+    @Resource(name = "style")
+    private Style style;
+
+    @Resource(name = "dateCreated")
+    private Date dateCreated;
+
+    @Resource(name = "guitarStringGuages")
+    private Map<String, Float> guitarStringGuages;
+
+    @Resource(name = "certificateOfAuthenticity")
+    private File certificateOfAuthenticity;
+
+    public Date getDateCreated() {
+        return dateCreated;
+    }
+
+    /**
+     * Gets the guage of the electric guitar strings
+     * used in this guitar.
+     *
+     * @param string
+     * @return
+     */
+    public float getStringGuage(String string) {
+        return guitarStringGuages.get(string);
+    }
+
+    public List<Pickup> getPickups() {
+        return pickups;
+    }
+
+    public Style getStyle() {
+        return style;
+    }
+
+    public File getCertificateOfAuthenticity() {
+        return certificateOfAuthenticity;
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/custom-injection/src/main/java/org/superbiz/enventries/Style.java
----------------------------------------------------------------------
diff --git a/examples/custom-injection/src/main/java/org/superbiz/enventries/Style.java b/examples/custom-injection/src/main/java/org/superbiz/enventries/Style.java
index 6956a40..57fc335 100644
--- a/examples/custom-injection/src/main/java/org/superbiz/enventries/Style.java
+++ b/examples/custom-injection/src/main/java/org/superbiz/enventries/Style.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enventries;
-
-/**
- * @version $Revision$ $Date$
- */
-//START SNIPPET: code
-public enum Style {
-
-    STANDARD,
-    DELUX,
-    VINTAGE;
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enventries;
+
+/**
+ * @version $Revision$ $Date$
+ */
+//START SNIPPET: code
+public enum Style {
+
+    STANDARD,
+    DELUX,
+    VINTAGE;
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/custom-injection/src/test/java/org/superbiz/enventries/StratocasterTest.java
----------------------------------------------------------------------
diff --git a/examples/custom-injection/src/test/java/org/superbiz/enventries/StratocasterTest.java b/examples/custom-injection/src/test/java/org/superbiz/enventries/StratocasterTest.java
index 562f8c9..03822c6 100644
--- a/examples/custom-injection/src/test/java/org/superbiz/enventries/StratocasterTest.java
+++ b/examples/custom-injection/src/test/java/org/superbiz/enventries/StratocasterTest.java
@@ -1,63 +1,63 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.enventries;
-
-import junit.framework.TestCase;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import java.io.File;
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-import static java.util.Arrays.asList;
-
-/**
- * @version $Rev$ $Date$
- */
-//START SNIPPET: code
-public class StratocasterTest extends TestCase {
-
-    @EJB
-    private Stratocaster strat;
-
-    public void test() throws Exception {
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-
-        Date date = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US).parse("Mar 1, 1962");
-        assertEquals("Strat.getDateCreated()", date, strat.getDateCreated());
-
-        List<Pickup> pickups = asList(Pickup.SINGLE_COIL, Pickup.SINGLE_COIL, Pickup.SINGLE_COIL);
-        assertEquals("Strat.getPickups()", pickups, strat.getPickups());
-
-        assertEquals("Strat.getStyle()", Style.VINTAGE, strat.getStyle());
-
-        assertEquals("Strat.getStringGuage(\"E1\")", 0.052F, strat.getStringGuage("E1"), 1e-15);
-        assertEquals("Strat.getStringGuage(\"A\")", 0.042F, strat.getStringGuage("A"), 1e-15);
-        assertEquals("Strat.getStringGuage(\"D\")", 0.030F, strat.getStringGuage("D"), 1e-15);
-        assertEquals("Strat.getStringGuage(\"G\")", 0.017F, strat.getStringGuage("G"), 1e-15);
-        assertEquals("Strat.getStringGuage(\"B\")", 0.013F, strat.getStringGuage("B"), 1e-15);
-        assertEquals("Strat.getStringGuage(\"E\")", 0.010F, strat.getStringGuage("E"), 1e-15);
-
-        File file = new File("/tmp/strat-certificate.txt");
-        assertEquals("Strat.getCertificateOfAuthenticity()", file, strat.getCertificateOfAuthenticity());
-
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.enventries;
+
+import junit.framework.TestCase;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import java.io.File;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+import static java.util.Arrays.asList;
+
+/**
+ * @version $Rev$ $Date$
+ */
+//START SNIPPET: code
+public class StratocasterTest extends TestCase {
+
+    @EJB
+    private Stratocaster strat;
+
+    public void test() throws Exception {
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+
+        Date date = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US).parse("Mar 1, 1962");
+        assertEquals("Strat.getDateCreated()", date, strat.getDateCreated());
+
+        List<Pickup> pickups = asList(Pickup.SINGLE_COIL, Pickup.SINGLE_COIL, Pickup.SINGLE_COIL);
+        assertEquals("Strat.getPickups()", pickups, strat.getPickups());
+
+        assertEquals("Strat.getStyle()", Style.VINTAGE, strat.getStyle());
+
+        assertEquals("Strat.getStringGuage(\"E1\")", 0.052F, strat.getStringGuage("E1"), 1e-15);
+        assertEquals("Strat.getStringGuage(\"A\")", 0.042F, strat.getStringGuage("A"), 1e-15);
+        assertEquals("Strat.getStringGuage(\"D\")", 0.030F, strat.getStringGuage("D"), 1e-15);
+        assertEquals("Strat.getStringGuage(\"G\")", 0.017F, strat.getStringGuage("G"), 1e-15);
+        assertEquals("Strat.getStringGuage(\"B\")", 0.013F, strat.getStringGuage("B"), 1e-15);
+        assertEquals("Strat.getStringGuage(\"E\")", 0.010F, strat.getStringGuage("E"), 1e-15);
+
+        File file = new File("/tmp/strat-certificate.txt");
+        assertEquals("Strat.getCertificateOfAuthenticity()", file, strat.getCertificateOfAuthenticity());
+
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/datasource-definition/src/main/java/org/superbiz/dsdef/Persister.java
----------------------------------------------------------------------
diff --git a/examples/datasource-definition/src/main/java/org/superbiz/dsdef/Persister.java b/examples/datasource-definition/src/main/java/org/superbiz/dsdef/Persister.java
index 4b70bd3..bd65da8 100644
--- a/examples/datasource-definition/src/main/java/org/superbiz/dsdef/Persister.java
+++ b/examples/datasource-definition/src/main/java/org/superbiz/dsdef/Persister.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,13 +22,13 @@ import javax.inject.Named;
 import javax.sql.DataSource;
 
 @DataSourceDefinition(transactional = true,
-                      url = "jdbc:h2:mem:persister",
-                      className = "org.h2.jdbcx.JdbcDataSource",
-                      user = "sa",
-                      password = "",
-                      name = "java:app/jdbc/persister",
-                      initialPoolSize = 1,
-                      maxPoolSize = 3
+        url = "jdbc:h2:mem:persister",
+        className = "org.h2.jdbcx.JdbcDataSource",
+        user = "sa",
+        password = "",
+        name = "java:app/jdbc/persister",
+        initialPoolSize = 1,
+        maxPoolSize = 3
 )
 @Named
 public class Persister {

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/datasource-definition/src/test/java/org/superbiz/dsdef/DataSourceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/examples/datasource-definition/src/test/java/org/superbiz/dsdef/DataSourceDefinitionTest.java b/examples/datasource-definition/src/test/java/org/superbiz/dsdef/DataSourceDefinitionTest.java
index ba9c3f2..aedc7ea 100644
--- a/examples/datasource-definition/src/test/java/org/superbiz/dsdef/DataSourceDefinitionTest.java
+++ b/examples/datasource-definition/src/test/java/org/superbiz/dsdef/DataSourceDefinitionTest.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.


[32/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applet/src/main/java/org/superbiz/applet/CalculatorApplet.java
----------------------------------------------------------------------
diff --git a/examples/applet/src/main/java/org/superbiz/applet/CalculatorApplet.java b/examples/applet/src/main/java/org/superbiz/applet/CalculatorApplet.java
index 49115bd..eb16e25 100644
--- a/examples/applet/src/main/java/org/superbiz/applet/CalculatorApplet.java
+++ b/examples/applet/src/main/java/org/superbiz/applet/CalculatorApplet.java
@@ -1,101 +1,100 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.applet;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Properties;
-
-public class CalculatorApplet extends JApplet {
-
-    JTextArea area;
-
-    JTextField field1;
-    JTextField field2;
-    JLabel label1;
-    JLabel label2;
-    JButton button;
-    JLabel label3;
-    Context ctx;
-
-    public void init() {
-        try {
-            SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    createUI();
-                }
-            });
-        } catch (Exception e) {
-            System.err.println("createGUI didn't successfully complete");
-        }
-
-    }
-
-    private void createUI() {
-        field1 = new JTextField();
-        field2 = new JTextField();
-        label1 = new JLabel("Enter first number");
-        label2 = new JLabel("Enter second number");
-        label3 = new JLabel("RESULT=");
-        button = new JButton("Add");
-
-        setLayout(new GridLayout(3, 2));
-        add(label1);
-        add(field1);
-        add(label2);
-        add(field2);
-        add(button);
-        add(label3);
-        Properties props = new Properties();
-        props.put(Context.INITIAL_CONTEXT_FACTORY,
-                  "org.apache.openejb.client.RemoteInitialContextFactory");
-        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/applet/ejb");
-        try {
-            ctx = new InitialContext(props);
-        } catch (NamingException e) {
-            throw new RuntimeException(e);
-        }
-        button.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-
-                try {
-                    final Object ref = ctx.lookup("CalculatorImplRemote");
-                    Calculator calc = (Calculator) PortableRemoteObject.narrow(
-                                                                                  ref, Calculator.class);
-                    String text1 = field1.getText();
-                    String text2 = field2.getText();
-                    int num1 = Integer.parseInt(text1);
-                    int num2 = Integer.parseInt(text2);
-                    double result = calc.add(num1, num2);
-                    label3.setText("RESULT=" + result);
-                } catch (NamingException ex) {
-                    throw new RuntimeException(ex);
-                }
-
-            }
-        });
-
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.applet;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Properties;
+
+public class CalculatorApplet extends JApplet {
+
+    JTextArea area;
+
+    JTextField field1;
+    JTextField field2;
+    JLabel label1;
+    JLabel label2;
+    JButton button;
+    JLabel label3;
+    Context ctx;
+
+    public void init() {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    createUI();
+                }
+            });
+        } catch (Exception e) {
+            System.err.println("createGUI didn't successfully complete");
+        }
+
+    }
+
+    private void createUI() {
+        field1 = new JTextField();
+        field2 = new JTextField();
+        label1 = new JLabel("Enter first number");
+        label2 = new JLabel("Enter second number");
+        label3 = new JLabel("RESULT=");
+        button = new JButton("Add");
+
+        setLayout(new GridLayout(3, 2));
+        add(label1);
+        add(field1);
+        add(label2);
+        add(field2);
+        add(button);
+        add(label3);
+        Properties props = new Properties();
+        props.put(Context.INITIAL_CONTEXT_FACTORY,
+                "org.apache.openejb.client.RemoteInitialContextFactory");
+        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/applet/ejb");
+        try {
+            ctx = new InitialContext(props);
+        } catch (NamingException e) {
+            throw new RuntimeException(e);
+        }
+        button.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+
+                try {
+                    final Object ref = ctx.lookup("CalculatorImplRemote");
+                    Calculator calc = (Calculator) PortableRemoteObject.narrow(
+                            ref, Calculator.class);
+                    String text1 = field1.getText();
+                    String text2 = field2.getText();
+                    int num1 = Integer.parseInt(text1);
+                    int num2 = Integer.parseInt(text2);
+                    double result = calc.add(num1, num2);
+                    label3.setText("RESULT=" + result);
+                } catch (NamingException ex) {
+                    throw new RuntimeException(ex);
+                }
+
+            }
+        });
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applet/src/main/java/org/superbiz/applet/CalculatorImpl.java
----------------------------------------------------------------------
diff --git a/examples/applet/src/main/java/org/superbiz/applet/CalculatorImpl.java b/examples/applet/src/main/java/org/superbiz/applet/CalculatorImpl.java
index c80f8bb..6fccc92 100644
--- a/examples/applet/src/main/java/org/superbiz/applet/CalculatorImpl.java
+++ b/examples/applet/src/main/java/org/superbiz/applet/CalculatorImpl.java
@@ -1,29 +1,28 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.applet;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class CalculatorImpl implements Calculator {
-
-    public double add(double x, double y) {
-        return x + y;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.applet;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class CalculatorImpl implements Calculator {
+
+    public double add(double x, double y) {
+        return x + y;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applet/src/test/java/org/superbiz/JNDILookupTest.java
----------------------------------------------------------------------
diff --git a/examples/applet/src/test/java/org/superbiz/JNDILookupTest.java b/examples/applet/src/test/java/org/superbiz/JNDILookupTest.java
index 6205173..1663148 100644
--- a/examples/applet/src/test/java/org/superbiz/JNDILookupTest.java
+++ b/examples/applet/src/test/java/org/superbiz/JNDILookupTest.java
@@ -1,47 +1,46 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.superbiz.applet.Calculator;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.rmi.PortableRemoteObject;
-import java.util.Properties;
-
-public class JNDILookupTest {
-
-    @Test
-    public void test() {
-        Properties props = new Properties();
-        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/tomee/ejb");
-        try {
-            Context ctx = new InitialContext(props);
-            System.out.println("Found context " + ctx);
-            final Object ref = ctx.lookup("CalculatorImplRemote");
-            Calculator calc = (Calculator) PortableRemoteObject.narrow(ref, Calculator.class);
-            double result = calc.add(10, 30);
-            Assert.assertEquals(40, result, 0.5);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.superbiz.applet.Calculator;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+import java.util.Properties;
+
+public class JNDILookupTest {
+
+    @Test
+    public void test() {
+        Properties props = new Properties();
+        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/tomee/ejb");
+        try {
+            Context ctx = new InitialContext(props);
+            System.out.println("Found context " + ctx);
+            final Object ref = ctx.lookup("CalculatorImplRemote");
+            Calculator calc = (Calculator) PortableRemoteObject.narrow(ref, Calculator.class);
+            double result = calc.add(10, 30);
+            Assert.assertEquals(40, result, 0.5);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/application-composer/src/main/java/org/superbiz/composed/Movie.java
----------------------------------------------------------------------
diff --git a/examples/application-composer/src/main/java/org/superbiz/composed/Movie.java b/examples/application-composer/src/main/java/org/superbiz/composed/Movie.java
index d5647c8..88d71df 100644
--- a/examples/application-composer/src/main/java/org/superbiz/composed/Movie.java
+++ b/examples/application-composer/src/main/java/org/superbiz/composed/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/application-composer/src/main/java/org/superbiz/composed/Movies.java
----------------------------------------------------------------------
diff --git a/examples/application-composer/src/main/java/org/superbiz/composed/Movies.java b/examples/application-composer/src/main/java/org/superbiz/composed/Movies.java
index 3113c13..36b2343 100644
--- a/examples/application-composer/src/main/java/org/superbiz/composed/Movies.java
+++ b/examples/application-composer/src/main/java/org/superbiz/composed/Movies.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed;
-
-import java.util.List;
-
-/**
- * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
- */
-public interface Movies {
-
-    void addMovie(Movie movie) throws Exception;
-
-    void deleteMovie(Movie movie) throws Exception;
-
-    List<Movie> getMovies() throws Exception;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed;
+
+import java.util.List;
+
+/**
+ * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
+ */
+public interface Movies {
+
+    void addMovie(Movie movie) throws Exception;
+
+    void deleteMovie(Movie movie) throws Exception;
+
+    List<Movie> getMovies() throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/application-composer/src/main/java/org/superbiz/composed/MoviesImpl.java
----------------------------------------------------------------------
diff --git a/examples/application-composer/src/main/java/org/superbiz/composed/MoviesImpl.java b/examples/application-composer/src/main/java/org/superbiz/composed/MoviesImpl.java
index 45fe222..933d53e 100644
--- a/examples/application-composer/src/main/java/org/superbiz/composed/MoviesImpl.java
+++ b/examples/application-composer/src/main/java/org/superbiz/composed/MoviesImpl.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed;
-
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-import static javax.ejb.TransactionAttributeType.MANDATORY;
-
-//START SNIPPET: code
-@Stateful(name = "Movies")
-@TransactionAttribute(MANDATORY)
-public class MoviesImpl implements Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed;
+
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+
+//START SNIPPET: code
+@Stateful(name = "Movies")
+@TransactionAttribute(MANDATORY)
+public class MoviesImpl implements Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/application-composer/src/test/java/org/superbiz/composed/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/application-composer/src/test/java/org/superbiz/composed/MoviesTest.java b/examples/application-composer/src/test/java/org/superbiz/composed/MoviesTest.java
index 35b6e8c..3cd5f78 100644
--- a/examples/application-composer/src/test/java/org/superbiz/composed/MoviesTest.java
+++ b/examples/application-composer/src/test/java/org/superbiz/composed/MoviesTest.java
@@ -1,100 +1,100 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.composed;
-
-import junit.framework.TestCase;
-import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.StatefulBean;
-import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.testing.Configuration;
-import org.apache.openejb.testing.Module;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.transaction.UserTransaction;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-@RunWith(ApplicationComposer.class)
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    @Module
-    public PersistenceUnit persistence() {
-        PersistenceUnit unit = new PersistenceUnit("movie-unit");
-        unit.setJtaDataSource("movieDatabase");
-        unit.setNonJtaDataSource("movieDatabaseUnmanaged");
-        unit.getClazz().add(Movie.class.getName());
-        unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
-        return unit;
-    }
-
-    @Module
-    public EjbJar beans() {
-        EjbJar ejbJar = new EjbJar("movie-beans");
-        ejbJar.addEnterpriseBean(new StatefulBean(MoviesImpl.class));
-        return ejbJar;
-    }
-
-    @Configuration
-    public Properties config() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-        return p;
-    }
-
-    @Test
-    public void test() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-
-        } finally {
-            userTransaction.commit();
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.composed;
+
+import junit.framework.TestCase;
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.StatefulBean;
+import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.Module;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.UserTransaction;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+@RunWith(ApplicationComposer.class)
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Module
+    public PersistenceUnit persistence() {
+        PersistenceUnit unit = new PersistenceUnit("movie-unit");
+        unit.setJtaDataSource("movieDatabase");
+        unit.setNonJtaDataSource("movieDatabaseUnmanaged");
+        unit.getClazz().add(Movie.class.getName());
+        unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
+        return unit;
+    }
+
+    @Module
+    public EjbJar beans() {
+        EjbJar ejbJar = new EjbJar("movie-beans");
+        ejbJar.addEnterpriseBean(new StatefulBean(MoviesImpl.class));
+        return ejbJar;
+    }
+
+    @Configuration
+    public Properties config() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+        return p;
+    }
+
+    @Test
+    public void test() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+        } finally {
+            userTransaction.commit();
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/pom.xml
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/pom.xml b/examples/applicationcomposer-jaxws-cdi/pom.xml
index 3ca06c8..2ccb96c 100644
--- a/examples/applicationcomposer-jaxws-cdi/pom.xml
+++ b/examples/applicationcomposer-jaxws-cdi/pom.xml
@@ -23,7 +23,7 @@
 
   <groupId>org.superbiz</groupId>
   <artifactId>ws-pojo-cdi</artifactId>
-  <version>1.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: Application Composer, JAX-WS and CDI are in a boat</name>
 
   <properties>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/Agenda.java
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/Agenda.java b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/Agenda.java
index 8860e09..219395e 100644
--- a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/Agenda.java
+++ b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/Agenda.java
@@ -1,23 +1,23 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.example.jaxws;
-
-import java.util.Date;
-
-public interface Agenda {
-    boolean isBookable(Date d);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.example.jaxws;
+
+import java.util.Date;
+
+public interface Agenda {
+    boolean isBookable(Date d);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/LazyAgenda.java
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/LazyAgenda.java b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/LazyAgenda.java
index 024cbf0..d989da5 100644
--- a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/LazyAgenda.java
+++ b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/LazyAgenda.java
@@ -1,26 +1,26 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.example.jaxws;
-
-import java.util.Date;
-
-public class LazyAgenda implements Agenda {
-    @Override
-    public boolean isBookable(final Date d) {
-        return d.after(new Date());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.example.jaxws;
+
+import java.util.Date;
+
+public class LazyAgenda implements Agenda {
+    @Override
+    public boolean isBookable(final Date d) {
+        return d.after(new Date());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlanner.java
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlanner.java b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlanner.java
index 616dedd..005f4a7 100644
--- a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlanner.java
+++ b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlanner.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.example.jaxws;
-
-import javax.jws.WebService;
-import java.util.Date;
-
-@WebService
-public interface MeetingPlanner {
-    boolean book(final Date date);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.example.jaxws;
+
+import javax.jws.WebService;
+import java.util.Date;
+
+@WebService
+public interface MeetingPlanner {
+    boolean book(final Date date);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlannerImpl.java
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlannerImpl.java b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlannerImpl.java
index 3159598..243c21b 100644
--- a/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlannerImpl.java
+++ b/examples/applicationcomposer-jaxws-cdi/src/main/java/org/superbiz/example/jaxws/MeetingPlannerImpl.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.example.jaxws;
-
-import javax.inject.Inject;
-import javax.jws.WebService;
-import java.util.Date;
-
-@WebService
-public class MeetingPlannerImpl implements MeetingPlanner  {
-    @Inject
-    private Agenda agenda;
-
-    @Override
-    public boolean book(final Date date) {
-        return agenda.isBookable(date);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.example.jaxws;
+
+import javax.inject.Inject;
+import javax.jws.WebService;
+import java.util.Date;
+
+@WebService
+public class MeetingPlannerImpl implements MeetingPlanner {
+    @Inject
+    private Agenda agenda;
+
+    @Override
+    public boolean book(final Date date) {
+        return agenda.isBookable(date);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationcomposer-jaxws-cdi/src/test/java/org/superbiz/example/jaxws/MeetingPlannerTest.java
----------------------------------------------------------------------
diff --git a/examples/applicationcomposer-jaxws-cdi/src/test/java/org/superbiz/example/jaxws/MeetingPlannerTest.java b/examples/applicationcomposer-jaxws-cdi/src/test/java/org/superbiz/example/jaxws/MeetingPlannerTest.java
index b365c65..bc43041 100644
--- a/examples/applicationcomposer-jaxws-cdi/src/test/java/org/superbiz/example/jaxws/MeetingPlannerTest.java
+++ b/examples/applicationcomposer-jaxws-cdi/src/test/java/org/superbiz/example/jaxws/MeetingPlannerTest.java
@@ -1,66 +1,65 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.example.jaxws;
-
-import org.apache.openejb.jee.WebApp;
-import org.apache.openejb.junit.ApplicationComposer;
-import org.apache.openejb.testing.Classes;
-import org.apache.openejb.testing.Configuration;
-import org.apache.openejb.testing.EnableServices;
-import org.apache.openejb.testing.Module;
-
-import static java.lang.Integer.toString;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.openejb.testng.PropertiesBuilder;
-import org.apache.openejb.util.NetworkUtil;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Date;
-import java.util.Properties;
-
-@EnableServices("jax-ws")
-@RunWith(ApplicationComposer.class)
-public class MeetingPlannerTest {
-    private static final int JAX_WS_PORT = NetworkUtil.getNextAvailablePort();
-
-    @Configuration
-    public Properties configuration() {
-        return new PropertiesBuilder().p("httpejbd.port", Integer.toString(JAX_WS_PORT)).build();
-    }
-    @Module
-    @Classes(cdi = true, value = { MeetingPlannerImpl.class, LazyAgenda.class })
-    public WebApp war() {
-        return new WebApp()
-                .contextRoot("/demo")
-                .addServlet("jaxws", MeetingPlannerImpl.class.getName(), "/meeting-planner");
-    }
-
-    @Test
-    public void book() throws MalformedURLException {
-        final Service service = Service.create(
-                new URL("http://127.0.0.1:" + JAX_WS_PORT + "/demo/meeting-planner?wsdl"),
-                new QName("http://jaxws.example.superbiz.org/", "MeetingPlannerImplService"));
-        final MeetingPlanner planner = service.getPort(MeetingPlanner.class);
-        assertTrue(planner.book(new Date(System.currentTimeMillis() + 1000000)));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.example.jaxws;
+
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Classes;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.EnableServices;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.testng.PropertiesBuilder;
+import org.apache.openejb.util.NetworkUtil;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Date;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+@EnableServices("jax-ws")
+@RunWith(ApplicationComposer.class)
+public class MeetingPlannerTest {
+    private static final int JAX_WS_PORT = NetworkUtil.getNextAvailablePort();
+
+    @Configuration
+    public Properties configuration() {
+        return new PropertiesBuilder().p("httpejbd.port", Integer.toString(JAX_WS_PORT)).build();
+    }
+
+    @Module
+    @Classes(cdi = true, value = {MeetingPlannerImpl.class, LazyAgenda.class})
+    public WebApp war() {
+        return new WebApp()
+                .contextRoot("/demo")
+                .addServlet("jaxws", MeetingPlannerImpl.class.getName(), "/meeting-planner");
+    }
+
+    @Test
+    public void book() throws MalformedURLException {
+        final Service service = Service.create(
+                new URL("http://127.0.0.1:" + JAX_WS_PORT + "/demo/meeting-planner?wsdl"),
+                new QName("http://jaxws.example.superbiz.org/", "MeetingPlannerImplService"));
+        final MeetingPlanner planner = service.getPort(MeetingPlanner.class);
+        assertTrue(planner.book(new Date(System.currentTimeMillis() + 1000000)));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationexception/src/main/java/org/superbiz/appexception/BusinessException.java
----------------------------------------------------------------------
diff --git a/examples/applicationexception/src/main/java/org/superbiz/appexception/BusinessException.java b/examples/applicationexception/src/main/java/org/superbiz/appexception/BusinessException.java
index 29bc19c..14b68cb 100755
--- a/examples/applicationexception/src/main/java/org/superbiz/appexception/BusinessException.java
+++ b/examples/applicationexception/src/main/java/org/superbiz/appexception/BusinessException.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.appexception;
-
-import javax.ejb.ApplicationException;
-
-/**
- * @version $Rev$ $Date$
- */
-@ApplicationException(rollback = true)
-public abstract class BusinessException extends RuntimeException {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.appexception;
+
+import javax.ejb.ApplicationException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@ApplicationException(rollback = true)
+public abstract class BusinessException extends RuntimeException {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessException.java
----------------------------------------------------------------------
diff --git a/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessException.java b/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessException.java
index d7a901c..4fd3c43 100755
--- a/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessException.java
+++ b/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessException.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.appexception;
-
-import javax.ejb.Remote;
-
-/**
- * This is an EJB 3 remote business interface
- * A remote business interface must be annotated with the @Remote
- * annotation
- */
-//START SNIPPET: code
-@Remote
-public interface ThrowBusinessException {
-
-    public void throwValueRequiredException() throws BusinessException;
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.appexception;
+
+import javax.ejb.Remote;
+
+/**
+ * This is an EJB 3 remote business interface
+ * A remote business interface must be annotated with the @Remote
+ * annotation
+ */
+//START SNIPPET: code
+@Remote
+public interface ThrowBusinessException {
+
+    public void throwValueRequiredException() throws BusinessException;
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessExceptionImpl.java
----------------------------------------------------------------------
diff --git a/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessExceptionImpl.java b/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessExceptionImpl.java
index 8665751..02a6edd 100755
--- a/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessExceptionImpl.java
+++ b/examples/applicationexception/src/main/java/org/superbiz/appexception/ThrowBusinessExceptionImpl.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.appexception;
-
-import javax.ejb.Stateless;
-
-//START SNIPPET: code
-@Stateless
-public class ThrowBusinessExceptionImpl implements ThrowBusinessException {
-
-    public void throwValueRequiredException() throws BusinessException {
-        throw new ValueRequiredException();
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.appexception;
+
+import javax.ejb.Stateless;
+
+//START SNIPPET: code
+@Stateless
+public class ThrowBusinessExceptionImpl implements ThrowBusinessException {
+
+    public void throwValueRequiredException() throws BusinessException {
+        throw new ValueRequiredException();
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationexception/src/main/java/org/superbiz/appexception/ValueRequiredException.java
----------------------------------------------------------------------
diff --git a/examples/applicationexception/src/main/java/org/superbiz/appexception/ValueRequiredException.java b/examples/applicationexception/src/main/java/org/superbiz/appexception/ValueRequiredException.java
index f6fb67b..3f68ae2 100755
--- a/examples/applicationexception/src/main/java/org/superbiz/appexception/ValueRequiredException.java
+++ b/examples/applicationexception/src/main/java/org/superbiz/appexception/ValueRequiredException.java
@@ -1,24 +1,24 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.appexception;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ValueRequiredException extends BusinessException {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.appexception;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ValueRequiredException extends BusinessException {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/applicationexception/src/test/java/org/superbiz/appexception/ThrowBusinessExceptionImplTest.java
----------------------------------------------------------------------
diff --git a/examples/applicationexception/src/test/java/org/superbiz/appexception/ThrowBusinessExceptionImplTest.java b/examples/applicationexception/src/test/java/org/superbiz/appexception/ThrowBusinessExceptionImplTest.java
index 7bba170..df0c5d7 100755
--- a/examples/applicationexception/src/test/java/org/superbiz/appexception/ThrowBusinessExceptionImplTest.java
+++ b/examples/applicationexception/src/test/java/org/superbiz/appexception/ThrowBusinessExceptionImplTest.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.appexception;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-// TODO This test case does not actually show that the bean was not destroyed.  The effect of @ApplicationException is not demonstrated
-// Maybe have two methods that throw runtime exceptions and compare the behavior of both
-// TODO Remote the business interface and show only POJO usage
-public class ThrowBusinessExceptionImplTest {
-
-    //START SNIPPET: setup
-    private InitialContext initialContext;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-
-        initialContext = new InitialContext(properties);
-    }
-    //END SNIPPET: setup	
-
-    /**
-     * Lookup the Counter bean via its remote home interface
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: remote
-    @Test(expected = ValueRequiredException.class)
-    public void testCounterViaRemoteInterface() throws Exception {
-        Object object = initialContext.lookup("ThrowBusinessExceptionImplRemote");
-
-        Assert.assertNotNull(object);
-        Assert.assertTrue(object instanceof ThrowBusinessException);
-        ThrowBusinessException bean = (ThrowBusinessException) object;
-        bean.throwValueRequiredException();
-    }
-    //END SNIPPET: remote
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.appexception;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+// TODO This test case does not actually show that the bean was not destroyed.  The effect of @ApplicationException is not demonstrated
+// Maybe have two methods that throw runtime exceptions and compare the behavior of both
+// TODO Remote the business interface and show only POJO usage
+public class ThrowBusinessExceptionImplTest {
+
+    //START SNIPPET: setup
+    private InitialContext initialContext;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+        initialContext = new InitialContext(properties);
+    }
+    //END SNIPPET: setup	
+
+    /**
+     * Lookup the Counter bean via its remote home interface
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: remote
+    @Test(expected = ValueRequiredException.class)
+    public void testCounterViaRemoteInterface() throws Exception {
+        Object object = initialContext.lookup("ThrowBusinessExceptionImplRemote");
+
+        Assert.assertNotNull(object);
+        Assert.assertTrue(object instanceof ThrowBusinessException);
+        ThrowBusinessException bean = (ThrowBusinessException) object;
+        bean.throwValueRequiredException();
+    }
+    //END SNIPPET: remote
+
+}


[16/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesArquillianHtmlUnitTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesArquillianHtmlUnitTest.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesArquillianHtmlUnitTest.java
index 42fe599..2cca1ac 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesArquillianHtmlUnitTest.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesArquillianHtmlUnitTest.java
@@ -1,109 +1,109 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.Filters;
-import org.jboss.shrinkwrap.api.GenericArchive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.resolver.api.maven.Maven;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.ejb.EJB;
-import java.io.File;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collection;
-
-import static org.junit.Assert.assertTrue;
-
-@RunWith(Arquillian.class)
-public class MoviesArquillianHtmlUnitTest {
-
-    private static final String WEBAPP_SRC = "src/main/webapp";
-
-    @Deployment
-    public static WebArchive createDeployment() {
-
-        Collection<String> dependencies = Arrays.asList(new String[]{
-                                                                        "javax.servlet:jstl",
-                                                                        "taglibs:standard",
-                                                                        "commons-lang:commons-lang"
-        });
-
-        File[] libs = Maven.resolver()
-                           .loadPomFromFile(Basedir.basedir("pom.xml")).resolve(dependencies)
-                           .withTransitivity().asFile();
-
-        WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
-                                   .addClasses(Movie.class, MoviesBean.class, MoviesArquillianHtmlUnitTest.class, ActionServlet.class)
-                                   .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
-                                   .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml")
-                                   .addAsLibraries(libs);
-
-        war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
-                            .importDirectory(Basedir.basedir(WEBAPP_SRC)).as(GenericArchive.class),
-                  "/", Filters.includeAll());
-
-        return war;
-    }
-
-    @EJB
-    private MoviesBean movies;
-
-    @ArquillianResource
-    private URL deploymentUrl;
-
-    @Before
-    @After
-    public void clean() {
-        movies.clean();
-    }
-
-    @Test
-    public void testShouldMakeSureWebappIsWorking() throws Exception {
-        WebClient webClient = new WebClient();
-        HtmlPage page = webClient.getPage(deploymentUrl + "/setup.jsp");
-
-        assertMoviesPresent(page);
-
-        page = webClient.getPage(deploymentUrl + "/moviefun");
-
-        assertMoviesPresent(page);
-        webClient.closeAllWindows();
-    }
-
-    private void assertMoviesPresent(HtmlPage page) {
-        String pageAsText = page.asText();
-        assertTrue(pageAsText.contains("Wedding Crashers"));
-        assertTrue(pageAsText.contains("Starsky & Hutch"));
-        assertTrue(pageAsText.contains("Shanghai Knights"));
-        assertTrue(pageAsText.contains("I-Spy"));
-        assertTrue(pageAsText.contains("The Royal Tenenbaums"));
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.Filters;
+import org.jboss.shrinkwrap.api.GenericArchive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.EJB;
+import java.io.File;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Arquillian.class)
+public class MoviesArquillianHtmlUnitTest {
+
+    private static final String WEBAPP_SRC = "src/main/webapp";
+
+    @Deployment
+    public static WebArchive createDeployment() {
+
+        Collection<String> dependencies = Arrays.asList(new String[]{
+                "javax.servlet:jstl",
+                "taglibs:standard",
+                "commons-lang:commons-lang"
+        });
+
+        File[] libs = Maven.resolver()
+                .loadPomFromFile(Basedir.basedir("pom.xml")).resolve(dependencies)
+                .withTransitivity().asFile();
+
+        WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
+                .addClasses(Movie.class, MoviesBean.class, MoviesArquillianHtmlUnitTest.class, ActionServlet.class)
+                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
+                .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml")
+                .addAsLibraries(libs);
+
+        war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
+                        .importDirectory(Basedir.basedir(WEBAPP_SRC)).as(GenericArchive.class),
+                "/", Filters.includeAll());
+
+        return war;
+    }
+
+    @EJB
+    private MoviesBean movies;
+
+    @ArquillianResource
+    private URL deploymentUrl;
+
+    @Before
+    @After
+    public void clean() {
+        movies.clean();
+    }
+
+    @Test
+    public void testShouldMakeSureWebappIsWorking() throws Exception {
+        WebClient webClient = new WebClient();
+        HtmlPage page = webClient.getPage(deploymentUrl + "/setup.jsp");
+
+        assertMoviesPresent(page);
+
+        page = webClient.getPage(deploymentUrl + "/moviefun");
+
+        assertMoviesPresent(page);
+        webClient.closeAllWindows();
+    }
+
+    private void assertMoviesPresent(HtmlPage page) {
+        String pageAsText = page.asText();
+        assertTrue(pageAsText.contains("Wedding Crashers"));
+        assertTrue(pageAsText.contains("Starsky & Hutch"));
+        assertTrue(pageAsText.contains("Shanghai Knights"));
+        assertTrue(pageAsText.contains("I-Spy"));
+        assertTrue(pageAsText.contains("The Royal Tenenbaums"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
index 37f4699..dffce5a 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
@@ -1,78 +1,78 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.ejb.EJB;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class MoviesEJBTest {
-
-    @Deployment
-    public static WebArchive createDeployment() {
-        return ShrinkWrap.create(WebArchive.class, "test.war")
-                         .addClasses(Movie.class, MoviesBean.class, MoviesEJBTest.class)
-                         .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
-                         .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
-    }
-
-    @EJB
-    private MoviesBean movies;
-
-    @Before
-    @After
-    public void clean() {
-        movies.clean();
-    }
-
-    @Test
-    public void shouldBeAbleToAddAMovie() throws Exception {
-        assertNotNull("Verify that the ejb was injected", movies);
-
-        Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        assertEquals(1, movies.countAll());
-        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 5);
-
-        assertEquals(1, moviesFound.size());
-        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        assertEquals("Action", moviesFound.get(0).getGenre());
-        assertEquals(9, moviesFound.get(0).getRating());
-        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.EJB;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class MoviesEJBTest {
+
+    @Deployment
+    public static WebArchive createDeployment() {
+        return ShrinkWrap.create(WebArchive.class, "test.war")
+                .addClasses(Movie.class, MoviesBean.class, MoviesEJBTest.class)
+                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
+                .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
+    }
+
+    @EJB
+    private MoviesBean movies;
+
+    @Before
+    @After
+    public void clean() {
+        movies.clean();
+    }
+
+    @Test
+    public void shouldBeAbleToAddAMovie() throws Exception {
+        assertNotNull("Verify that the ejb was injected", movies);
+
+        Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        assertEquals(1, movies.countAll());
+        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 5);
+
+        assertEquals(1, moviesFound.size());
+        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        assertEquals("Action", moviesFound.get(0).getGenre());
+        assertEquals(9, moviesFound.get(0).getRating());
+        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
index 71af57a..d404794 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
@@ -1,75 +1,75 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-public class MoviesEmbeddedEJBTest {
-
-    private static EJBContainer ejbContainer;
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-    }
-
-    @AfterClass
-    public static void tearDown() {
-        if (ejbContainer != null) {
-            ejbContainer.close();
-        }
-    }
-
-    @Before
-    @After
-    public void clean() throws Exception {
-        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
-        movies.clean();
-    }
-
-    @Test
-    public void testShouldAddAMovie() throws Exception {
-        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
-
-        Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        Assert.assertEquals(1, movies.countAll());
-        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 10);
-
-        Assert.assertEquals(1, moviesFound.size());
-        Assert.assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        Assert.assertEquals("Action", moviesFound.get(0).getGenre());
-        Assert.assertEquals(9, moviesFound.get(0).getRating());
-        Assert.assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        Assert.assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+public class MoviesEmbeddedEJBTest {
+
+    private static EJBContainer ejbContainer;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+    }
+
+    @AfterClass
+    public static void tearDown() {
+        if (ejbContainer != null) {
+            ejbContainer.close();
+        }
+    }
+
+    @Before
+    @After
+    public void clean() throws Exception {
+        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
+        movies.clean();
+    }
+
+    @Test
+    public void testShouldAddAMovie() throws Exception {
+        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
+
+        Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        Assert.assertEquals(1, movies.countAll());
+        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 10);
+
+        Assert.assertEquals(1, moviesFound.size());
+        Assert.assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        Assert.assertEquals("Action", moviesFound.get(0).getGenre());
+        Assert.assertEquals(9, moviesFound.get(0).getRating());
+        Assert.assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        Assert.assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesHtmlUnitTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesHtmlUnitTest.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesHtmlUnitTest.java
index 6c7e364..bcfcc6f 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesHtmlUnitTest.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesHtmlUnitTest.java
@@ -1,103 +1,103 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import org.apache.commons.io.FileUtils;
-import org.apache.tomee.embedded.EmbeddedTomEEContainer;
-import org.apache.ziplock.Archive;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import java.io.File;
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.Properties;
-
-import static org.junit.Assert.assertTrue;
-import static org.superbiz.moviefun.Basedir.basedir;
-
-public class MoviesHtmlUnitTest {
-
-    private static EJBContainer container;
-    private static File webApp;
-    private static int port;
-
-    @BeforeClass
-    public static void start() throws IOException {
-
-        // get a random unused port to use for http requests
-        ServerSocket server = new ServerSocket(0);
-        port = server.getLocalPort();
-        server.close();
-
-        webApp = createWebApp();
-        Properties p = new Properties();
-        p.setProperty(EJBContainer.APP_NAME, "moviefun");
-        p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
-        p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
-        p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, String.valueOf(port));
-        container = EJBContainer.createEJBContainer(p);
-    }
-
-    @AfterClass
-    public static void stop() {
-        if (container != null) {
-            container.close();
-        }
-        if (webApp != null) {
-            try {
-                FileUtils.forceDelete(webApp);
-            } catch (IOException e) {
-                FileUtils.deleteQuietly(webApp);
-            }
-        }
-    }
-
-    private static File createWebApp() throws IOException {
-        return Archive.archive()
-                .copyTo("WEB-INF/classes", basedir("target/classes"))
-                .copyTo("WEB-INF/lib", basedir("target/test-libs"))
-                .copyTo("", basedir("src/main/webapp"))
-                .asDir();
-    }
-
-    @Test
-    public void testShouldMakeSureWebappIsWorking() throws Exception {
-        WebClient webClient = new WebClient();
-        HtmlPage page = webClient.getPage("http://localhost:" + port + "/moviefun/setup.jsp");
-
-        assertMoviesPresent(page);
-
-        page = webClient.getPage("http://localhost:" + port + "/moviefun/moviefun");
-
-        assertMoviesPresent(page);
-        webClient.closeAllWindows();
-    }
-
-    private void assertMoviesPresent(HtmlPage page) {
-        String pageAsText = page.asText();
-        assertTrue(pageAsText.contains("Wedding Crashers"));
-        assertTrue(pageAsText.contains("Starsky & Hutch"));
-        assertTrue(pageAsText.contains("Shanghai Knights"));
-        assertTrue(pageAsText.contains("I-Spy"));
-        assertTrue(pageAsText.contains("The Royal Tenenbaums"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.apache.commons.io.FileUtils;
+import org.apache.tomee.embedded.EmbeddedTomEEContainer;
+import org.apache.ziplock.Archive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+import static org.superbiz.moviefun.Basedir.basedir;
+
+public class MoviesHtmlUnitTest {
+
+    private static EJBContainer container;
+    private static File webApp;
+    private static int port;
+
+    @BeforeClass
+    public static void start() throws IOException {
+
+        // get a random unused port to use for http requests
+        ServerSocket server = new ServerSocket(0);
+        port = server.getLocalPort();
+        server.close();
+
+        webApp = createWebApp();
+        Properties p = new Properties();
+        p.setProperty(EJBContainer.APP_NAME, "moviefun");
+        p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
+        p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
+        p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, String.valueOf(port));
+        container = EJBContainer.createEJBContainer(p);
+    }
+
+    @AfterClass
+    public static void stop() {
+        if (container != null) {
+            container.close();
+        }
+        if (webApp != null) {
+            try {
+                FileUtils.forceDelete(webApp);
+            } catch (IOException e) {
+                FileUtils.deleteQuietly(webApp);
+            }
+        }
+    }
+
+    private static File createWebApp() throws IOException {
+        return Archive.archive()
+                .copyTo("WEB-INF/classes", basedir("target/classes"))
+                .copyTo("WEB-INF/lib", basedir("target/test-libs"))
+                .copyTo("", basedir("src/main/webapp"))
+                .asDir();
+    }
+
+    @Test
+    public void testShouldMakeSureWebappIsWorking() throws Exception {
+        WebClient webClient = new WebClient();
+        HtmlPage page = webClient.getPage("http://localhost:" + port + "/moviefun/setup.jsp");
+
+        assertMoviesPresent(page);
+
+        page = webClient.getPage("http://localhost:" + port + "/moviefun/moviefun");
+
+        assertMoviesPresent(page);
+        webClient.closeAllWindows();
+    }
+
+    private void assertMoviesPresent(HtmlPage page) {
+        String pageAsText = page.asText();
+        assertTrue(pageAsText.contains("Wedding Crashers"));
+        assertTrue(pageAsText.contains("Starsky & Hutch"));
+        assertTrue(pageAsText.contains("Shanghai Knights"));
+        assertTrue(pageAsText.contains("I-Spy"));
+        assertTrue(pageAsText.contains("The Royal Tenenbaums"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesTest.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesTest.java
index af611e9..cbda921 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesTest.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/MoviesTest.java
@@ -1,75 +1,75 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-public class MoviesTest {
-
-    private static EJBContainer ejbContainer;
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-    }
-
-    @AfterClass
-    public static void tearDown() {
-        if (ejbContainer != null) {
-            ejbContainer.close();
-        }
-    }
-
-    @Before
-    @After
-    public void clean() throws Exception {
-        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
-        movies.clean();
-    }
-
-    @Test
-    public void testShouldAddAMovie() throws Exception {
-        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
-
-        Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        Assert.assertEquals(1, movies.countAll());
-        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 10);
-
-        Assert.assertEquals(1, moviesFound.size());
-        Assert.assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        Assert.assertEquals("Action", moviesFound.get(0).getGenre());
-        Assert.assertEquals(9, moviesFound.get(0).getRating());
-        Assert.assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        Assert.assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+public class MoviesTest {
+
+    private static EJBContainer ejbContainer;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+    }
+
+    @AfterClass
+    public static void tearDown() {
+        if (ejbContainer != null) {
+            ejbContainer.close();
+        }
+    }
+
+    @Before
+    @After
+    public void clean() throws Exception {
+        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
+        movies.clean();
+    }
+
+    @Test
+    public void testShouldAddAMovie() throws Exception {
+        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean");
+
+        Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        Assert.assertEquals(1, movies.countAll());
+        List<Movie> moviesFound = movies.findRange("title", "Bad Boys", 0, 10);
+
+        Assert.assertEquals(1, moviesFound.size());
+        Assert.assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        Assert.assertEquals("Action", moviesFound.get(0).getGenre());
+        Assert.assertEquals(9, moviesFound.get(0).getRating());
+        Assert.assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        Assert.assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/AddInterceptor.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
index c9f9cef..648a501 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Revision$ $Date$
- */
-public class AddInterceptor {
-
-    @AroundInvoke
-    public Object invoke(InvocationContext context) throws Exception {
-        // Log Add
-        return context.proceed();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class AddInterceptor {
+
+    @AroundInvoke
+    public Object invoke(InvocationContext context) throws Exception {
+        // Log Add
+        return context.proceed();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
index a20fc75..f21e20c 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Revision$ $Date$
- */
-public class DeleteInterceptor {
-
-    @AroundInvoke
-    public Object invoke(InvocationContext context) throws Exception {
-        // Log Delete
-        return context.proceed();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class DeleteInterceptor {
+
+    @AroundInvoke
+    public Object invoke(InvocationContext context) throws Exception {
+        // Log Delete
+        return context.proceed();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movie.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movie.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movie.java
index 1d0c359..5b880ba 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movie.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movies.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movies.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movies.java
index 6ed16d0..fd9d851 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movies.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/Movies.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import org.superbiz.injection.tx.api.Add;
-import org.superbiz.injection.tx.api.Delete;
-import org.superbiz.injection.tx.api.MovieUnit;
-import org.superbiz.injection.tx.api.Read;
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.List;
-
-//END SNIPPET: code
-
-//START SNIPPET: code
-@Stateful
-public class Movies {
-
-    @MovieUnit
-    private EntityManager entityManager;
-
-    @Add
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @Delete
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @Read
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import org.superbiz.injection.tx.api.Add;
+import org.superbiz.injection.tx.api.Delete;
+import org.superbiz.injection.tx.api.MovieUnit;
+import org.superbiz.injection.tx.api.Read;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.List;
+
+//END SNIPPET: code
+
+//START SNIPPET: code
+@Stateful
+public class Movies {
+
+    @MovieUnit
+    private EntityManager entityManager;
+
+    @Add
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @Delete
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @Read
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/Metatype.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/Metatype.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/Metatype.java
index 0bf8570..ab6dd4a 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/Metatype.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/Metatype.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Metatype {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Metatype {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/MovieUnit.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/MovieUnit.java b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/MovieUnit.java
index b6f6ffc..31bf8c2 100644
--- a/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/MovieUnit.java
+++ b/examples/movies-complete-meta/src/main/java/org/superbiz/injection/tx/api/MovieUnit.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx.api;
-
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target({ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-
-@PersistenceContext(name = "movie-unit", unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-public @interface MovieUnit {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx.api;
+
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target({ElementType.METHOD, ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+
+@PersistenceContext(name = "movie-unit", unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+public @interface MovieUnit {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete-meta/src/test/java/org/superbiz/injection/tx/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete-meta/src/test/java/org/superbiz/injection/tx/MoviesTest.java b/examples/movies-complete-meta/src/test/java/org/superbiz/injection/tx/MoviesTest.java
index fcd5826..afdccdf 100644
--- a/examples/movies-complete-meta/src/test/java/org/superbiz/injection/tx/MoviesTest.java
+++ b/examples/movies-complete-meta/src/test/java/org/superbiz/injection/tx/MoviesTest.java
@@ -1,142 +1,142 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import junit.framework.TestCase;
-
-import javax.annotation.security.RunAs;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-
-import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
-
-/**
- * See the transaction-rollback example as it does the same thing
- * via UserTransaction and shows more techniques for rollback
- */
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @EJB(beanName = "TransactionBean")
-    private Caller transactionalCaller;
-
-    @EJB(beanName = "NoTransactionBean")
-    private Caller nonTransactionalCaller;
-
-    protected void setUp() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        transactionalCaller.call(new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
-                for (final Movie m : movies.getMovies()) {
-                    movies.deleteMovie(m);
-                }
-                return null;
-            }
-        });
-    }
-
-    private void doWork() throws Exception {
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-
-    public void testWithTransaction() throws Exception {
-        transactionalCaller.call(new Callable() {
-            public Object call() throws Exception {
-                doWork();
-                return null;
-            }
-        });
-    }
-
-    public void testWithoutTransaction() throws Exception {
-        try {
-            nonTransactionalCaller.call(new Callable() {
-                public Object call() throws Exception {
-                    doWork();
-                    return null;
-                }
-            });
-            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
-        } catch (javax.ejb.EJBException e) {
-            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
-        }
-    }
-
-    public static interface Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception;
-    }
-
-    /**
-     * This little bit of magic allows our test code to execute in
-     * the scope of a container controlled transaction.
-     */
-    @Stateless
-    @RunAs("Manager")
-    @TransactionAttribute(REQUIRES_NEW)
-    public static class TransactionBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-    @Stateless
-    @RunAs("Manager")
-    @TransactionAttribute(TransactionAttributeType.NEVER)
-    public static class NoTransactionBean implements Caller {
-
-        public <V> V call(Callable<V> callable) throws Exception {
-            return callable.call();
-        }
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import junit.framework.TestCase;
+
+import javax.annotation.security.RunAs;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+
+/**
+ * See the transaction-rollback example as it does the same thing
+ * via UserTransaction and shows more techniques for rollback
+ */
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @EJB(beanName = "TransactionBean")
+    private Caller transactionalCaller;
+
+    @EJB(beanName = "NoTransactionBean")
+    private Caller nonTransactionalCaller;
+
+    protected void setUp() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        transactionalCaller.call(new Callable<Object>() {
+            @Override
+            public Object call() throws Exception {
+                for (final Movie m : movies.getMovies()) {
+                    movies.deleteMovie(m);
+                }
+                return null;
+            }
+        });
+    }
+
+    private void doWork() throws Exception {
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+
+    public void testWithTransaction() throws Exception {
+        transactionalCaller.call(new Callable() {
+            public Object call() throws Exception {
+                doWork();
+                return null;
+            }
+        });
+    }
+
+    public void testWithoutTransaction() throws Exception {
+        try {
+            nonTransactionalCaller.call(new Callable() {
+                public Object call() throws Exception {
+                    doWork();
+                    return null;
+                }
+            });
+            fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
+        } catch (javax.ejb.EJBException e) {
+            // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
+        }
+    }
+
+    public static interface Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception;
+    }
+
+    /**
+     * This little bit of magic allows our test code to execute in
+     * the scope of a container controlled transaction.
+     */
+    @Stateless
+    @RunAs("Manager")
+    @TransactionAttribute(REQUIRES_NEW)
+    public static class TransactionBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+    @Stateless
+    @RunAs("Manager")
+    @TransactionAttribute(TransactionAttributeType.NEVER)
+    public static class NoTransactionBean implements Caller {
+
+        public <V> V call(Callable<V> callable) throws Exception {
+            return callable.call();
+        }
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/AddInterceptor.java b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
index c9f9cef..648a501 100644
--- a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
+++ b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/AddInterceptor.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Revision$ $Date$
- */
-public class AddInterceptor {
-
-    @AroundInvoke
-    public Object invoke(InvocationContext context) throws Exception {
-        // Log Add
-        return context.proceed();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class AddInterceptor {
+
+    @AroundInvoke
+    public Object invoke(InvocationContext context) throws Exception {
+        // Log Add
+        return context.proceed();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
index a20fc75..f21e20c 100644
--- a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
+++ b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/DeleteInterceptor.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Revision$ $Date$
- */
-public class DeleteInterceptor {
-
-    @AroundInvoke
-    public Object invoke(InvocationContext context) throws Exception {
-        // Log Delete
-        return context.proceed();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class DeleteInterceptor {
+
+    @AroundInvoke
+    public Object invoke(InvocationContext context) throws Exception {
+        // Log Delete
+        return context.proceed();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movie.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movie.java b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movie.java
index 1d0c359..5b880ba 100644
--- a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movie.java
+++ b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movies.java
----------------------------------------------------------------------
diff --git a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movies.java b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movies.java
index 73f9e04..5fc73ab 100644
--- a/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movies.java
+++ b/examples/movies-complete/src/main/java/org/superbiz/injection/tx/Movies.java
@@ -1,60 +1,59 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.tx;
-
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.interceptor.Interceptors;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-//START SNIPPET: code
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    @RolesAllowed({"Employee", "Manager"})
-    @TransactionAttribute(TransactionAttributeType.REQUIRED)
-    @Interceptors(AddInterceptor.class)
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @RolesAllowed({"Manager"})
-    @TransactionAttribute(TransactionAttributeType.MANDATORY)
-    @Interceptors(DeleteInterceptor.class)
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @PermitAll
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.tx;
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.interceptor.Interceptors;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+//START SNIPPET: code
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    @RolesAllowed({"Employee", "Manager"})
+    @TransactionAttribute(TransactionAttributeType.REQUIRED)
+    @Interceptors(AddInterceptor.class)
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @RolesAllowed({"Manager"})
+    @TransactionAttribute(TransactionAttributeType.MANDATORY)
+    @Interceptors(DeleteInterceptor.class)
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @PermitAll
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code


[31/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/README.md
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/README.md b/examples/arquillian-jpa/README.md
index ae43e71..1bc2e9f 100644
--- a/examples/arquillian-jpa/README.md
+++ b/examples/arquillian-jpa/README.md
@@ -1,169 +1,169 @@
-Title: Arquillian Persistence Extension
-
-A sample showing how to use TomEE, Arquillian and its Persistence Extension.
-
-Note that it doesn't work with embedded containers (openejb, tomee-embedded)
-if you don't use workarounds like https://github.com/rmannibucau/persistence-with-openejb-and-arquillian
-(see src/test/resources folder).
-
-# Running (output)
-
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.arquillian.test.persistence.PersistenceTest
-    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Setup findHome
-    INFOS: Unable to find home in: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote
-    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
-    INFOS: Downloading org.apache.openejb:apache-tomee:2.0.0-SNAPSHOT:zip:webprofile please wait...
-    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Zips unzip
-    INFOS: Extracting '/home/rmannibucau/.m2/repository/org/apache/openejb/apache-tomee/2.0.0-SNAPSHOT/apache-tomee-2.0.0-SNAPSHOT-webprofile.zip' to '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote'
-    oct. 01, 2014 6:30:24 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
-    INFOS: Downloaded container to: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
-    INFOS - Server version: Apache Tomcat/8.0.14
-    INFOS - Server built:   Sep 24 2014 09:01:51
-    INFOS - Server number:  8.0.14.0
-    INFOS - OS Name:        Linux
-    INFOS - OS Version:     3.13.0-35-generic
-    INFOS - Architecture:   amd64
-    INFOS - JVM Version:    1.7.0_67-b01
-    INFOS - JVM Vendor:     Oracle Corporation
-    INFOS - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
-    INFOS - Initializing ProtocolHandler ["http-nio-52256"]
-    INFOS - Using a shared selector for servlet write/read
-    INFOS - Initializing ProtocolHandler ["ajp-nio-40071"]
-    INFOS - Using a shared selector for servlet write/read
-    INFOS - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
-    INFOS - ********************************************************************************
-    INFOS - OpenEJB http://tomee.apache.org/
-    INFOS - Startup: Wed Oct 01 18:30:26 CEST 2014
-    INFOS - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
-    INFOS - Version: 5.0.0-SNAPSHOT
-    INFOS - Build date: 20141001
-    INFOS - Build time: 04:53
-    INFOS - ********************************************************************************
-    INFOS - openejb.home = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
-    INFOS - openejb.base = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
-    INFOS - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
-    INFOS - Succeeded in installing singleton service
-    INFOS - openejb configuration file is '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT/conf/tomee.xml'
-    INFOS - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
-    INFOS - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFOS - Configuring Service(id=demoDataSource, type=Resource, provider-id=Default JDBC Database)
-    INFOS - Using 'openejb.system.apps=true'
-    INFOS - Configuring enterprise application: openejb
-    INFOS - Using openejb.deploymentId.format '{ejbName}'
-    INFOS - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
-    INFOS - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
-    INFOS - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
-    INFOS - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
-    INFOS - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
-    INFOS - Enterprise application "openejb" loaded.
-    INFOS - Creating TransactionManager(id=Default Transaction Manager)
-    INFOS - Creating SecurityService(id=Tomcat Security Service)
-    INFOS - Creating Resource(id=demoDataSource)
-    INFOS - Disabling testOnBorrow since no validation query is provided
-    INFOS - Creating Container(id=Default Stateless Container)
-    INFOS - Not creating another application classloader for openejb
-    INFOS - Assembling app: openejb
-    INFOS - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
-    INFOS - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
-    INFOS - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
-    INFOS - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
-    INFOS - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFOS - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
-    INFOS - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
-    INFOS - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
-    INFOS - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
-    INFOS - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
-    INFOS - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
-    INFOS - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
-    INFOS - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
-    INFOS - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
-    INFOS - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
-    INFOS - Deployed Application(path=openejb)
-    INFOS - Creating ServerService(id=cxf-rs)
-    INFOS -   ** Bound Services **
-    INFOS -   NAME                 IP              PORT  
-    INFOS - -------
-    INFOS - Ready!
-    INFOS - Initialization processed in 2589 ms
-    INFOS - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
-    INFOS - Creating Resource(id=UserDatabase)
-    INFOS - Démarrage du service Catalina
-    INFOS - Starting Servlet Engine: Apache Tomcat (TomEE)/8.0.14 (2.0.0-SNAPSHOT)
-    INFOS - Starting ProtocolHandler ["http-nio-52256"]
-    INFOS - Starting ProtocolHandler ["ajp-nio-40071"]
-    INFOS - Server startup in 140 ms
-    oct. 01, 2014 6:30:30 PM org.apache.openejb.client.EventLogger log
-    INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
-    INFOS - Extracting jar: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest.war
-    INFOS - Extracted path: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
-    INFOS - using default host: localhost
-    INFOS - ------------------------- localhost -> /UserPersistenceTest
-    INFOS - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
-    INFOS - Configuring enterprise application: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
-    INFOS - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFOS - Auto-creating a container for bean UserPersistenceTest_org.superbiz.arquillian.test.persistence.PersistenceTest: Container(type=MANAGED, id=Default Managed Container)
-    INFOS - Creating Container(id=Default Managed Container)
-    INFOS - Using directory /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT/temp for stateful session passivation
-    INFOS - Configuring PersistenceUnit(name=demoApplicationPU)
-    INFOS - Auto-creating a Resource with id 'demoDataSourceNonJta' of type 'DataSource for 'demoApplicationPU'.
-    INFOS - Configuring Service(id=demoDataSourceNonJta, type=Resource, provider-id=demoDataSource)
-    INFOS - Creating Resource(id=demoDataSourceNonJta)
-    INFOS - Disabling testOnBorrow since no validation query is provided
-    INFOS - Adjusting PersistenceUnit demoApplicationPU <non-jta-data-source> to Resource ID 'demoDataSourceNonJta' from 'null'
-    INFOS - Enterprise application "/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest" loaded.
-    INFOS - Assembling app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
-    INFOS - OpenJPA dynamically loaded a validation provider.
-    INFOS - Starting OpenJPA 2.4.0-nonfinal-1598334
-    INFOS - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.3.2 ,HSQL Database Engine Driver 2.3.2).
-    INFOS - Connected to HSQL Database Engine version 2.2 using JDBC driver HSQL Database Engine Driver version 2.3.2. 
-    INFOS - SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES --> 0ms
-    INFOS - CREATE TABLE User (id BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id)) --> 0ms
-    INFOS - PersistenceUnit(name=demoApplicationPU, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 1075ms
-    INFOS - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
-    INFOS - OpenWebBeans Container is starting...
-    INFOS - Adding OpenWebBeansPlugin : [CdiPlugin]
-    INFOS - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
-    INFOS - All injection points were validated successfully.
-    INFOS - OpenWebBeans Container has started, it took 224 ms.
-    INFOS - Deployed Application(path=/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest)
-    INFOS - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
-    AVERTISSEMENT - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'HSQL Database Engine' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
-    INFOS - insert into USER (ID, NAME) values (1, TomEE) --> 1ms
-    INFOS - insert into USER (ID, NAME) values (1, 2)TomEE,Old) --> 0ms
-    INFOS - SELECT COUNT(t0.id) FROM User t0 --> 0ms
-    INFOS - SELECT t0.name FROM User t0 WHERE t0.id = 2 --> 0ms
-    INFOS - UPDATE User SET name = OpenEJB WHERE id = 2 --> 1ms
-    INFOS - select ID, NAME from USER order by ID --> 0ms
-    INFOS - select ID, NAME from USER order by ID --> 0ms
-    INFOS - select ID, NAME from USER order by ID --> 0ms
-    INFOS - select ID, NAME from USER order by ID --> 0ms
-    INFOS - delete from USER --> 0ms
-    oct. 01, 2014 6:30:34 PM org.apache.openejb.client.EventLogger log
-    INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
-    INFOS - Undeploying app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
-    oct. 01, 2014 6:30:34 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
-    INFOS: cleaning /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.242 sec
-    INFOS - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
-    INFOS - Pausing ProtocolHandler ["http-nio-52256"]
-    INFOS - Pausing ProtocolHandler ["ajp-nio-40071"]
-    INFOS - Arrêt du service Catalina
-    INFOS - Stopping ProtocolHandler ["http-nio-52256"]
-    INFOS - Stopping ProtocolHandler ["ajp-nio-40071"]
-    INFOS - Stopping server services
-    INFOS - Undeploying app: openejb
-    INFOS - Closing DataSource: demoDataSource
-    INFOS - Closing DataSource: demoDataSourceNonJta
-    INFOS - Destroying ProtocolHandler ["http-nio-52256"]
-    INFOS - Destroying ProtocolHandler ["ajp-nio-40071"]
-    
-    Results :
-    
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-
+Title: Arquillian Persistence Extension
+
+A sample showing how to use TomEE, Arquillian and its Persistence Extension.
+
+Note that it doesn't work with embedded containers (openejb, tomee-embedded)
+if you don't use workarounds like https://github.com/rmannibucau/persistence-with-openejb-and-arquillian
+(see src/test/resources folder).
+
+# Running (output)
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.arquillian.test.persistence.PersistenceTest
+    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Setup findHome
+    INFOS: Unable to find home in: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote
+    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
+    INFOS: Downloading org.apache.openejb:apache-tomee:7.0.0-SNAPSHOT:zip:webprofile please wait...
+    oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Zips unzip
+    INFOS: Extracting '/home/rmannibucau/.m2/repository/org/apache/openejb/apache-tomee/7.0.0-SNAPSHOT/apache-tomee-7.0.0-SNAPSHOT-webprofile.zip' to '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote'
+    oct. 01, 2014 6:30:24 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
+    INFOS: Downloaded container to: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+    INFOS - Server version: Apache Tomcat/8.0.14
+    INFOS - Server built:   Sep 24 2014 09:01:51
+    INFOS - Server number:  8.0.14.0
+    INFOS - OS Name:        Linux
+    INFOS - OS Version:     3.13.0-35-generic
+    INFOS - Architecture:   amd64
+    INFOS - JVM Version:    1.7.0_67-b01
+    INFOS - JVM Vendor:     Oracle Corporation
+    INFOS - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
+    INFOS - Initializing ProtocolHandler ["http-nio-52256"]
+    INFOS - Using a shared selector for servlet write/read
+    INFOS - Initializing ProtocolHandler ["ajp-nio-40071"]
+    INFOS - Using a shared selector for servlet write/read
+    INFOS - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
+    INFOS - ********************************************************************************
+    INFOS - OpenEJB http://tomee.apache.org/
+    INFOS - Startup: Wed Oct 01 18:30:26 CEST 2014
+    INFOS - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFOS - Version: 7.0.0-SNAPSHOT
+    INFOS - Build date: 20141001
+    INFOS - Build time: 04:53
+    INFOS - ********************************************************************************
+    INFOS - openejb.home = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+    INFOS - openejb.base = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+    INFOS - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
+    INFOS - Succeeded in installing singleton service
+    INFOS - openejb configuration file is '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT/conf/tomee.xml'
+    INFOS - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
+    INFOS - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFOS - Configuring Service(id=demoDataSource, type=Resource, provider-id=Default JDBC Database)
+    INFOS - Using 'openejb.system.apps=true'
+    INFOS - Configuring enterprise application: openejb
+    INFOS - Using openejb.deploymentId.format '{ejbName}'
+    INFOS - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
+    INFOS - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
+    INFOS - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
+    INFOS - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+    INFOS - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
+    INFOS - Enterprise application "openejb" loaded.
+    INFOS - Creating TransactionManager(id=Default Transaction Manager)
+    INFOS - Creating SecurityService(id=Tomcat Security Service)
+    INFOS - Creating Resource(id=demoDataSource)
+    INFOS - Disabling testOnBorrow since no validation query is provided
+    INFOS - Creating Container(id=Default Stateless Container)
+    INFOS - Not creating another application classloader for openejb
+    INFOS - Assembling app: openejb
+    INFOS - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
+    INFOS - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
+    INFOS - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
+    INFOS - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
+    INFOS - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFOS - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
+    INFOS - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
+    INFOS - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
+    INFOS - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+    INFOS - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+    INFOS - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+    INFOS - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+    INFOS - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+    INFOS - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+    INFOS - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
+    INFOS - Deployed Application(path=openejb)
+    INFOS - Creating ServerService(id=cxf-rs)
+    INFOS -   ** Bound Services **
+    INFOS -   NAME                 IP              PORT  
+    INFOS - -------
+    INFOS - Ready!
+    INFOS - Initialization processed in 2589 ms
+    INFOS - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
+    INFOS - Creating Resource(id=UserDatabase)
+    INFOS - Démarrage du service Catalina
+    INFOS - Starting Servlet Engine: Apache Tomcat (TomEE)/8.0.14 (7.0.0-SNAPSHOT)
+    INFOS - Starting ProtocolHandler ["http-nio-52256"]
+    INFOS - Starting ProtocolHandler ["ajp-nio-40071"]
+    INFOS - Server startup in 140 ms
+    oct. 01, 2014 6:30:30 PM org.apache.openejb.client.EventLogger log
+    INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
+    INFOS - Extracting jar: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest.war
+    INFOS - Extracted path: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+    INFOS - using default host: localhost
+    INFOS - ------------------------- localhost -> /UserPersistenceTest
+    INFOS - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
+    INFOS - Configuring enterprise application: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+    INFOS - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFOS - Auto-creating a container for bean UserPersistenceTest_org.superbiz.arquillian.test.persistence.PersistenceTest: Container(type=MANAGED, id=Default Managed Container)
+    INFOS - Creating Container(id=Default Managed Container)
+    INFOS - Using directory /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT/temp for stateful session passivation
+    INFOS - Configuring PersistenceUnit(name=demoApplicationPU)
+    INFOS - Auto-creating a Resource with id 'demoDataSourceNonJta' of type 'DataSource for 'demoApplicationPU'.
+    INFOS - Configuring Service(id=demoDataSourceNonJta, type=Resource, provider-id=demoDataSource)
+    INFOS - Creating Resource(id=demoDataSourceNonJta)
+    INFOS - Disabling testOnBorrow since no validation query is provided
+    INFOS - Adjusting PersistenceUnit demoApplicationPU <non-jta-data-source> to Resource ID 'demoDataSourceNonJta' from 'null'
+    INFOS - Enterprise application "/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest" loaded.
+    INFOS - Assembling app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+    INFOS - OpenJPA dynamically loaded a validation provider.
+    INFOS - Starting OpenJPA 2.4.0-nonfinal-1598334
+    INFOS - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.3.2 ,HSQL Database Engine Driver 2.3.2).
+    INFOS - Connected to HSQL Database Engine version 2.2 using JDBC driver HSQL Database Engine Driver version 2.3.2. 
+    INFOS - SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES --> 0ms
+    INFOS - CREATE TABLE User (id BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id)) --> 0ms
+    INFOS - PersistenceUnit(name=demoApplicationPU, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 1075ms
+    INFOS - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
+    INFOS - OpenWebBeans Container is starting...
+    INFOS - Adding OpenWebBeansPlugin : [CdiPlugin]
+    INFOS - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
+    INFOS - All injection points were validated successfully.
+    INFOS - OpenWebBeans Container has started, it took 224 ms.
+    INFOS - Deployed Application(path=/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest)
+    INFOS - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
+    AVERTISSEMENT - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'HSQL Database Engine' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
+    INFOS - insert into USER (ID, NAME) values (1, TomEE) --> 1ms
+    INFOS - insert into USER (ID, NAME) values (1, 2)TomEE,Old) --> 0ms
+    INFOS - SELECT COUNT(t0.id) FROM User t0 --> 0ms
+    INFOS - SELECT t0.name FROM User t0 WHERE t0.id = 2 --> 0ms
+    INFOS - UPDATE User SET name = OpenEJB WHERE id = 2 --> 1ms
+    INFOS - select ID, NAME from USER order by ID --> 0ms
+    INFOS - select ID, NAME from USER order by ID --> 0ms
+    INFOS - select ID, NAME from USER order by ID --> 0ms
+    INFOS - select ID, NAME from USER order by ID --> 0ms
+    INFOS - delete from USER --> 0ms
+    oct. 01, 2014 6:30:34 PM org.apache.openejb.client.EventLogger log
+    INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
+    INFOS - Undeploying app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+    oct. 01, 2014 6:30:34 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
+    INFOS: cleaning /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.242 sec
+    INFOS - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
+    INFOS - Pausing ProtocolHandler ["http-nio-52256"]
+    INFOS - Pausing ProtocolHandler ["ajp-nio-40071"]
+    INFOS - Arrêt du service Catalina
+    INFOS - Stopping ProtocolHandler ["http-nio-52256"]
+    INFOS - Stopping ProtocolHandler ["ajp-nio-40071"]
+    INFOS - Stopping server services
+    INFOS - Undeploying app: openejb
+    INFOS - Closing DataSource: demoDataSource
+    INFOS - Closing DataSource: demoDataSourceNonJta
+    INFOS - Destroying ProtocolHandler ["http-nio-52256"]
+    INFOS - Destroying ProtocolHandler ["ajp-nio-40071"]
+    
+    Results :
+    
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/pom.xml b/examples/arquillian-jpa/pom.xml
index f23be7f..92f26b9 100644
--- a/examples/arquillian-jpa/pom.xml
+++ b/examples/arquillian-jpa/pom.xml
@@ -14,7 +14,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>arquillian-jpa</artifactId>
   <name>OpenEJB :: Examples :: Arquillian Persistence Extension Sample</name>
-  <version>1.0.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
 
   <properties>
     <arquillian.version>1.1.5.Final</arquillian.version>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java b/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
index 0d9c1d7..65c0c67 100644
--- a/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
+++ b/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.arquillian.persistence;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class User {
-    @Id
-    private long id;
-    private String name;
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(final long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(final String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.arquillian.persistence;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class User {
+    @Id
+    private long id;
+    private String name;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(final long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java b/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
index a3bf408..4b68131 100644
--- a/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
+++ b/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
@@ -1,66 +1,63 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.arquillian.test.persistence;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.persistence.ShouldMatchDataSet;
-import org.jboss.arquillian.persistence.UsingDataSet;
-import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
-import org.jboss.arquillian.transaction.api.annotation.Transactional;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.arquillian.persistence.User;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class PersistenceTest
-{
-    @Deployment
-    public static Archive<?> createDeploymentPackage()
-    {
-        return ShrinkWrap.create(WebArchive.class, "UserPersistenceTest.war")
-                .addPackage(User.class.getPackage())
-                .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml");
-    }
-
-    @PersistenceContext
-    private EntityManager em;
-
-    @Test
-    @Transactional(TransactionMode.COMMIT) // default with persistence extension
-    @UsingDataSet("datasets/users.yml")
-    @ShouldMatchDataSet("datasets/expected-users.yml")
-    public void seriouslyYouAlreadyForgotOpenEJB_questionMark() throws Exception
-    {
-        assertEquals(2, em.createQuery("select count(e) from User e",Number.class).getSingleResult().intValue());
-
-        final User user = em.find(User.class, 2L);
-        assertNotNull(user);
-
-        user.setName("OpenEJB"); // @Transactional(TransactionMode.COMMIT) will commit it and datasets/expected-users.yml will check it
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.arquillian.test.persistence;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.persistence.ShouldMatchDataSet;
+import org.jboss.arquillian.persistence.UsingDataSet;
+import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
+import org.jboss.arquillian.transaction.api.annotation.Transactional;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.arquillian.persistence.User;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class PersistenceTest {
+    @Deployment
+    public static Archive<?> createDeploymentPackage() {
+        return ShrinkWrap.create(WebArchive.class, "UserPersistenceTest.war")
+                .addPackage(User.class.getPackage())
+                .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml");
+    }
+
+    @PersistenceContext
+    private EntityManager em;
+
+    @Test
+    @Transactional(TransactionMode.COMMIT) // default with persistence extension
+    @UsingDataSet("datasets/users.yml")
+    @ShouldMatchDataSet("datasets/expected-users.yml")
+    public void seriouslyYouAlreadyForgotOpenEJB_questionMark() throws Exception {
+        assertEquals(2, em.createQuery("select count(e) from User e", Number.class).getSingleResult().intValue());
+
+        final User user = em.find(User.class, 2L);
+        assertNotNull(user);
+
+        user.setName("OpenEJB"); // @Transactional(TransactionMode.COMMIT) will commit it and datasets/expected-users.yml will check it
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/README.md
----------------------------------------------------------------------
diff --git a/examples/async-methods/README.md b/examples/async-methods/README.md
index ab5da1c..69c93ad 100644
--- a/examples/async-methods/README.md
+++ b/examples/async-methods/README.md
@@ -1,154 +1,154 @@
-Title: @Asynchronous Methods
-
-The @Asynchronous annotation was introduced in EJB 3.1 as a simple way of creating asynchronous processing.
-
-Every time a method annotated `@Asynchronous` is invoked by anyone it will immediately return regardless of how long the method actually takes.  Each invocation returns a [Future][1] object that essentially starts out *empty* and will later have its value filled in by the container when the related method call actually completes.  Returning a `Future` object is not required and `@Asynchronous` methods can of course return `void`.
-
-# Example
-
-Here, in `JobProcessorTest`,
-
-`final Future<String> red = processor.addJob("red");`
-proceeds to the next statement,
-
-`final Future<String> orange = processor.addJob("orange");`
-
-without waiting for the addJob() method to complete. And later we could ask for the result using the `Future<?>.get()` method like
-
-`assertEquals("blue", blue.get());`
-
-It waits for the processing to complete (if its not completed already) and gets the result. If you did not care about the result, you could simply have your asynchronous method as a void method.
-
-[Future][1] Object from docs,
-
-> A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, the computation cannot be cancelled. If you would like to use a Future for the sake of cancellability but not provide a usable result, you can declare types of the form Future<?> and return null as a result of the underlying task
-
-
-
-# The code
-    @Singleton
-    public class JobProcessor {
-    @Asynchronous
-    @Lock(READ)
-    @AccessTimeout(-1)
-    public Future<String> addJob(String jobName) {
-
-        // Pretend this job takes a while
-        doSomeHeavyLifting();
-
-        // Return our result
-        return new AsyncResult<String>(jobName);
-    }
-
-    private void doSomeHeavyLifting() {
-        try {
-            Thread.sleep(SECONDS.toMillis(10));
-        } catch (InterruptedException e) {
-            Thread.interrupted();
-            throw new IllegalStateException(e);
-        }
-      }
-    }
-# Test
-    public class JobProcessorTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
-
-        final long start = System.nanoTime();
-
-        // Queue up a bunch of work
-        final Future<String> red = processor.addJob("red");
-        final Future<String> orange = processor.addJob("orange");
-        final Future<String> yellow = processor.addJob("yellow");
-        final Future<String> green = processor.addJob("green");
-        final Future<String> blue = processor.addJob("blue");
-        final Future<String> violet = processor.addJob("violet");
-
-        // Wait for the result -- 1 minute worth of work
-        assertEquals("blue", blue.get());
-        assertEquals("orange", orange.get());
-        assertEquals("green", green.get());
-        assertEquals("red", red.get());
-        assertEquals("yellow", yellow.get());
-        assertEquals("violet", violet.get());
-
-        // How long did it take?
-        final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-
-        // Execution should be around 9 - 21 seconds
-		// The execution time depends on the number of threads available for asynchronous execution.
-		// In the best case it is 10s plus some minimal processing time. 
-        assertTrue("Expected > 9 but was: " + total, total > 9);
-        assertTrue("Expected < 21 but was: " + total, total < 21);
-
-      }
-    }
-#Running
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.async.JobProcessorTest
-    Apache OpenEJB 4.0.0-SNAPSHOT    build: 20110801-04:02
-    http://tomee.apache.org/
-    INFO - openejb.home = G:\Workspace\fullproject\openejb3\examples\async-methods
-    INFO - openejb.base = G:\Workspace\fullproject\openejb3\examples\async-methods
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Found EjbModule in classpath: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
-    INFO - Beginning load: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
-    INFO - Configuring enterprise application: g:\Workspace\fullproject\openejb3\examples\async-methods
-    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
-    INFO - Auto-creating a container for bean JobProcessor: Container(type=SINGLETON, id=Default Singleton Container)
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean org.superbiz.async.JobProcessorTest: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Enterprise application "g:\Workspace\fullproject\openejb3\examples\async-methods" loaded.
-    INFO - Assembling app: g:\Workspace\fullproject\openejb3\examples\async-methods
-    INFO - Jndi(name="java:global/async-methods/JobProcessor!org.superbiz.async.JobProcessor")
-    INFO - Jndi(name="java:global/async-methods/JobProcessor")
-    INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest!org.superbiz.async.JobProcessorTest")
-    INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest")
-    INFO - Created Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
-    INFO - Created Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
-    INFO - Started Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
-    INFO - Deployed Application(path=g:\Workspace\fullproject\openejb3\examples\async-methods)
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.305 sec
-
-    Results :
-
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-    [INFO] ------------------------------------------------------------------------
-    [INFO] BUILD SUCCESS
-    [INFO] ------------------------------------------------------------------------
-    [INFO] Total time: 21.097s
-    [INFO] Finished at: Wed Aug 03 22:48:26 IST 2011
-    [INFO] Final Memory: 13M/145M
-    [INFO] ------------------------------------------------------------------------
-
-# How it works <small>under the covers</small>
-
-Under the covers what makes this work is:
-
-  - The `JobProcessor` the caller sees is not actually an instance of `JobProcessor`.  Rather it's a subclass or proxy that has all the methods overridden.  Methods that are supposed to be asynchronous are handled differently.
-  - Calls to an asynchronous method simply result in a `Runnable` being created that wraps the method and parameters you gave.  This runnable is given to an [Executor][3] which is simply a work queue attached to a thread pool.
-  - After adding the work to the queue, the proxied version of the method returns an implementation of `Future` that is linked to the `Runnable` which is now waiting on the queue.
-  - When the `Runnable` finally executes the method on the *real* `JobProcessor` instance, it will take the return value and set it into the `Future` making it available to the caller.
-
-Important to note that the `AsyncResult` object the `JobProcessor` returns is not the same `Future` object the caller is holding.  It would have been neat if the real `JobProcessor` could just return `String` and the caller's version of `JobProcessor` could return `Future<String>`, but we didn't see any way to do that without adding more complexity.  So the `AsyncResult` is a simple wrapper object.  The container will pull the `String` out, throw the `AsyncResult` away, then put the `String` in the *real* `Future` that the caller is holding.
-
-To get progress along the way, simply pass a thread-safe object like [AtomicInteger][4] to the `@Asynchronous` method and have the bean code periodically update it with the percent complete.
-
-#Related Examples
-
-For complex asynchronous processing, JavaEE's answer is `@MessageDrivenBean`. Have a look at the [simple-mdb](../simple-mdb/README.html) example
-
-[1]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html
-[3]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html
-[4]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicInteger.html
-
+Title: @Asynchronous Methods
+
+The @Asynchronous annotation was introduced in EJB 3.1 as a simple way of creating asynchronous processing.
+
+Every time a method annotated `@Asynchronous` is invoked by anyone it will immediately return regardless of how long the method actually takes.  Each invocation returns a [Future][1] object that essentially starts out *empty* and will later have its value filled in by the container when the related method call actually completes.  Returning a `Future` object is not required and `@Asynchronous` methods can of course return `void`.
+
+# Example
+
+Here, in `JobProcessorTest`,
+
+`final Future<String> red = processor.addJob("red");`
+proceeds to the next statement,
+
+`final Future<String> orange = processor.addJob("orange");`
+
+without waiting for the addJob() method to complete. And later we could ask for the result using the `Future<?>.get()` method like
+
+`assertEquals("blue", blue.get());`
+
+It waits for the processing to complete (if its not completed already) and gets the result. If you did not care about the result, you could simply have your asynchronous method as a void method.
+
+[Future][1] Object from docs,
+
+> A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, the computation cannot be cancelled. If you would like to use a Future for the sake of cancellability but not provide a usable result, you can declare types of the form Future<?> and return null as a result of the underlying task
+
+
+
+# The code
+    @Singleton
+    public class JobProcessor {
+    @Asynchronous
+    @Lock(READ)
+    @AccessTimeout(-1)
+    public Future<String> addJob(String jobName) {
+
+        // Pretend this job takes a while
+        doSomeHeavyLifting();
+
+        // Return our result
+        return new AsyncResult<String>(jobName);
+    }
+
+    private void doSomeHeavyLifting() {
+        try {
+            Thread.sleep(SECONDS.toMillis(10));
+        } catch (InterruptedException e) {
+            Thread.interrupted();
+            throw new IllegalStateException(e);
+        }
+      }
+    }
+# Test
+    public class JobProcessorTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
+
+        final long start = System.nanoTime();
+
+        // Queue up a bunch of work
+        final Future<String> red = processor.addJob("red");
+        final Future<String> orange = processor.addJob("orange");
+        final Future<String> yellow = processor.addJob("yellow");
+        final Future<String> green = processor.addJob("green");
+        final Future<String> blue = processor.addJob("blue");
+        final Future<String> violet = processor.addJob("violet");
+
+        // Wait for the result -- 1 minute worth of work
+        assertEquals("blue", blue.get());
+        assertEquals("orange", orange.get());
+        assertEquals("green", green.get());
+        assertEquals("red", red.get());
+        assertEquals("yellow", yellow.get());
+        assertEquals("violet", violet.get());
+
+        // How long did it take?
+        final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+
+        // Execution should be around 9 - 21 seconds
+		// The execution time depends on the number of threads available for asynchronous execution.
+		// In the best case it is 10s plus some minimal processing time. 
+        assertTrue("Expected > 9 but was: " + total, total > 9);
+        assertTrue("Expected < 21 but was: " + total, total < 21);
+
+      }
+    }
+#Running
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.async.JobProcessorTest
+    Apache OpenEJB 7.0.0-SNAPSHOT    build: 20110801-04:02
+    http://tomee.apache.org/
+    INFO - openejb.home = G:\Workspace\fullproject\openejb3\examples\async-methods
+    INFO - openejb.base = G:\Workspace\fullproject\openejb3\examples\async-methods
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Found EjbModule in classpath: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
+    INFO - Beginning load: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
+    INFO - Configuring enterprise application: g:\Workspace\fullproject\openejb3\examples\async-methods
+    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+    INFO - Auto-creating a container for bean JobProcessor: Container(type=SINGLETON, id=Default Singleton Container)
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean org.superbiz.async.JobProcessorTest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Enterprise application "g:\Workspace\fullproject\openejb3\examples\async-methods" loaded.
+    INFO - Assembling app: g:\Workspace\fullproject\openejb3\examples\async-methods
+    INFO - Jndi(name="java:global/async-methods/JobProcessor!org.superbiz.async.JobProcessor")
+    INFO - Jndi(name="java:global/async-methods/JobProcessor")
+    INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest!org.superbiz.async.JobProcessorTest")
+    INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest")
+    INFO - Created Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
+    INFO - Created Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
+    INFO - Started Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
+    INFO - Deployed Application(path=g:\Workspace\fullproject\openejb3\examples\async-methods)
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.305 sec
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+    [INFO] ------------------------------------------------------------------------
+    [INFO] BUILD SUCCESS
+    [INFO] ------------------------------------------------------------------------
+    [INFO] Total time: 21.097s
+    [INFO] Finished at: Wed Aug 03 22:48:26 IST 2011
+    [INFO] Final Memory: 13M/145M
+    [INFO] ------------------------------------------------------------------------
+
+# How it works <small>under the covers</small>
+
+Under the covers what makes this work is:
+
+  - The `JobProcessor` the caller sees is not actually an instance of `JobProcessor`.  Rather it's a subclass or proxy that has all the methods overridden.  Methods that are supposed to be asynchronous are handled differently.
+  - Calls to an asynchronous method simply result in a `Runnable` being created that wraps the method and parameters you gave.  This runnable is given to an [Executor][3] which is simply a work queue attached to a thread pool.
+  - After adding the work to the queue, the proxied version of the method returns an implementation of `Future` that is linked to the `Runnable` which is now waiting on the queue.
+  - When the `Runnable` finally executes the method on the *real* `JobProcessor` instance, it will take the return value and set it into the `Future` making it available to the caller.
+
+Important to note that the `AsyncResult` object the `JobProcessor` returns is not the same `Future` object the caller is holding.  It would have been neat if the real `JobProcessor` could just return `String` and the caller's version of `JobProcessor` could return `Future<String>`, but we didn't see any way to do that without adding more complexity.  So the `AsyncResult` is a simple wrapper object.  The container will pull the `String` out, throw the `AsyncResult` away, then put the `String` in the *real* `Future` that the caller is holding.
+
+To get progress along the way, simply pass a thread-safe object like [AtomicInteger][4] to the `@Asynchronous` method and have the bean code periodically update it with the percent complete.
+
+#Related Examples
+
+For complex asynchronous processing, JavaEE's answer is `@MessageDrivenBean`. Have a look at the [simple-mdb](../simple-mdb/README.html) example
+
+[1]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html
+[3]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html
+[4]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicInteger.html
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
----------------------------------------------------------------------
diff --git a/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java b/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
index d543484..8389fcf 100644
--- a/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
+++ b/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.async;
-
-import javax.ejb.AccessTimeout;
-import javax.ejb.AsyncResult;
-import javax.ejb.Asynchronous;
-import javax.ejb.Lock;
-import javax.ejb.Singleton;
-import java.util.concurrent.Future;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static javax.ejb.LockType.READ;
-
-/**
- * @version $Revision$ $Date$
- */
-@Singleton
-public class JobProcessor {
-
-    @Asynchronous
-    @Lock(READ)
-    @AccessTimeout(-1)
-    public Future<String> addJob(String jobName) {
-
-        // Pretend this job takes a while
-        doSomeHeavyLifting();
-
-        // Return our result
-        return new AsyncResult<String>(jobName);
-    }
-
-    private void doSomeHeavyLifting() {
-        try {
-            Thread.sleep(SECONDS.toMillis(10));
-        } catch (InterruptedException e) {
-            Thread.interrupted();
-            throw new IllegalStateException(e);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.async;
+
+import javax.ejb.AccessTimeout;
+import javax.ejb.AsyncResult;
+import javax.ejb.Asynchronous;
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.concurrent.Future;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static javax.ejb.LockType.READ;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Singleton
+public class JobProcessor {
+
+    @Asynchronous
+    @Lock(READ)
+    @AccessTimeout(-1)
+    public Future<String> addJob(String jobName) {
+
+        // Pretend this job takes a while
+        doSomeHeavyLifting();
+
+        // Return our result
+        return new AsyncResult<String>(jobName);
+    }
+
+    private void doSomeHeavyLifting() {
+        try {
+            Thread.sleep(SECONDS.toMillis(10));
+        } catch (InterruptedException e) {
+            Thread.interrupted();
+            throw new IllegalStateException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
----------------------------------------------------------------------
diff --git a/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java b/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
index 48cf4ee..e3bf30f 100644
--- a/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
+++ b/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
@@ -1,66 +1,66 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.async;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @version $Revision$ $Date$
- */
-public class JobProcessorTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
-
-        final long start = System.nanoTime();
-
-        // Queue up a bunch of work
-        final Future<String> red = processor.addJob("red");
-        final Future<String> orange = processor.addJob("orange");
-        final Future<String> yellow = processor.addJob("yellow");
-        final Future<String> green = processor.addJob("green");
-        final Future<String> blue = processor.addJob("blue");
-        final Future<String> violet = processor.addJob("violet");
-
-        // Wait for the result -- 1 minute worth of work
-        assertEquals("blue", blue.get());
-        assertEquals("orange", orange.get());
-        assertEquals("green", green.get());
-        assertEquals("red", red.get());
-        assertEquals("yellow", yellow.get());
-        assertEquals("violet", violet.get());
-
-        // How long did it take?
-        final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-
-        // Execution should be around 9 - 21 seconds
-		// The execution time depends on the number of threads available for asynchronous execution.
-		// In the best case it is 10s plus some minimal processing time. 
-        assertTrue("Expected > 9 but was: " + total, total > 9);
-        assertTrue("Expected < 21 but was: " + total, total < 21);
-
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.async;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class JobProcessorTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
+
+        final long start = System.nanoTime();
+
+        // Queue up a bunch of work
+        final Future<String> red = processor.addJob("red");
+        final Future<String> orange = processor.addJob("orange");
+        final Future<String> yellow = processor.addJob("yellow");
+        final Future<String> green = processor.addJob("green");
+        final Future<String> blue = processor.addJob("blue");
+        final Future<String> violet = processor.addJob("violet");
+
+        // Wait for the result -- 1 minute worth of work
+        assertEquals("blue", blue.get());
+        assertEquals("orange", orange.get());
+        assertEquals("green", green.get());
+        assertEquals("red", red.get());
+        assertEquals("yellow", yellow.get());
+        assertEquals("violet", violet.get());
+
+        // How long did it take?
+        final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+
+        // Execution should be around 9 - 21 seconds
+        // The execution time depends on the number of threads available for asynchronous execution.
+        // In the best case it is 10s plus some minimal processing time.
+        assertTrue("Expected > 9 but was: " + total, total > 9);
+        assertTrue("Expected < 21 but was: " + total, total < 21);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-postconstruct/pom.xml
----------------------------------------------------------------------
diff --git a/examples/async-postconstruct/pom.xml b/examples/async-postconstruct/pom.xml
index 1390e5b..16bb30f 100644
--- a/examples/async-postconstruct/pom.xml
+++ b/examples/async-postconstruct/pom.xml
@@ -25,7 +25,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>async-postconstruct</artifactId>
   <packaging>jar</packaging>
-  <version>1.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: @Asynchronous @PostConstrct</name>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
index 7293a5c..11ae3d3 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.designbycontract;
-
-import javax.ejb.Stateless;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-
-@Stateless
-public class OlympicGamesManager {
-
-    public String addSportMan(@Pattern(regexp = "^[A-Za-z]+$") String name, @Size(min = 2, max = 4) String country) {
-        if (country.equals("USA")) {
-            return null;
-        }
-        return new StringBuilder(name).append(" [").append(country).append("]").toString();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Stateless;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+
+@Stateless
+public class OlympicGamesManager {
+
+    public String addSportMan(@Pattern(regexp = "^[A-Za-z]+$") String name, @Size(min = 2, max = 4) String country) {
+        if (country.equals("USA")) {
+            return null;
+        }
+        return new StringBuilder(name).append(" [").append(country).append("]").toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
index fd56af0..fd4a963 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
@@ -1,26 +1,26 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.designbycontract;
-
-import javax.ejb.Local;
-import javax.validation.constraints.Min;
-
-@Local
-public interface PoleVaultingManager {
-
-    int points(@Min(120) int centimeters);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Local;
+import javax.validation.constraints.Min;
+
+@Local
+public interface PoleVaultingManager {
+
+    int points(@Min(120) int centimeters);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
index c253c8c..7e4ddfb 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
@@ -1,28 +1,28 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.designbycontract;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class PoleVaultingManagerBean implements PoleVaultingManager {
-
-    @Override
-    public int points(int centimeters) {
-        return centimeters - 120;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class PoleVaultingManagerBean implements PoleVaultingManager {
+
+    @Override
+    public int points(int centimeters) {
+        return centimeters - 120;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/pom.xml b/examples/bval-evaluation-redeployment/WebApp1/pom.xml
index fa7cbfe..e7fb7ae 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/pom.xml
+++ b/examples/bval-evaluation-redeployment/WebApp1/pom.xml
@@ -28,7 +28,6 @@
   </parent>
 
   <artifactId>WebApp1</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
   <packaging>war</packaging>
 
   <name>WebApp1</name>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
index bdc8324..0f49ed8 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp1.ejb;
-
-import javax.ejb.Stateless;
-import javax.validation.constraints.Pattern;
-
-@Stateless
-public class BusinessBean {
-
-    public void doStuff(@Pattern(regexp = "valid") final String txt) {
-        System.out.println("Received: " + txt);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.ejb;
+
+import javax.ejb.Stateless;
+import javax.validation.constraints.Pattern;
+
+@Stateless
+public class BusinessBean {
+
+    public void doStuff(@Pattern(regexp = "valid") final String txt) {
+        System.out.println("Received: " + txt);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
index e1076c4..b5354da 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp1.messages;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import java.util.ArrayList;
-import java.util.Collection;
-
-@XmlRootElement
-@XmlSeeAlso(ErrorResponse.class)
-public class ErrorList<T> extends ArrayList<T> {
-
-    private static final long serialVersionUID = -8861634470374757349L;
-
-    public ErrorList() {
-    }
-
-    public ErrorList(final Collection<? extends T> clctn) {
-        addAll(clctn);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.messages;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.ArrayList;
+import java.util.Collection;
+
+@XmlRootElement
+@XmlSeeAlso(ErrorResponse.class)
+public class ErrorList<T> extends ArrayList<T> {
+
+    private static final long serialVersionUID = -8861634470374757349L;
+
+    public ErrorList() {
+    }
+
+    public ErrorList(final Collection<? extends T> clctn) {
+        addAll(clctn);
+    }
+
+}


[13/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/QueryAndPostCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/QueryAndPostCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/QueryAndPostCommand.java
index 8af0a3f..c72bbaf 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/QueryAndPostCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/QueryAndPostCommand.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public abstract class QueryAndPostCommand extends AbstractCommand {
-
-    private static final Pattern PATTERN = Pattern.compile(" \\[(.*),(.*)\\]");
-
-    @Override
-    protected Response invoke(final String cmd) {
-        final Matcher matcher = PATTERN.matcher(cmd.substring(getClass().getAnnotation(Command.class).name().length()));
-        if (!matcher.matches() || matcher.groupCount() != 2) {
-            System.err.println("'" + cmd + "' doesn't match command usage");
-            return null;
-        }
-
-        return client.path(getPath()).query(getName(), matcher.group(1).trim()).post(prePost(matcher.group(2).trim()));
-    }
-
-    protected String prePost(final String post) {
-        return post;
-    }
-
-    protected abstract String getName();
-
-    protected abstract String getPath();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public abstract class QueryAndPostCommand extends AbstractCommand {
+
+    private static final Pattern PATTERN = Pattern.compile(" \\[(.*),(.*)\\]");
+
+    @Override
+    protected Response invoke(final String cmd) {
+        final Matcher matcher = PATTERN.matcher(cmd.substring(getClass().getAnnotation(Command.class).name().length()));
+        if (!matcher.matches() || matcher.groupCount() != 2) {
+            System.err.println("'" + cmd + "' doesn't match command usage");
+            return null;
+        }
+
+        return client.path(getPath()).query(getName(), matcher.group(1).trim()).post(prePost(matcher.group(2).trim()));
+    }
+
+    protected String prePost(final String post) {
+        return post;
+    }
+
+    protected abstract String getName();
+
+    protected abstract String getPath();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ShowPollCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ShowPollCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ShowPollCommand.java
index 5313223..9eed651 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ShowPollCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ShowPollCommand.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-
-import static jug.client.command.impl.ShowPollCommand.SHOW_POLL_CMD;
-
-@Command(name = SHOW_POLL_CMD, usage = SHOW_POLL_CMD + " <name>", description = "show a poll")
-public class ShowPollCommand extends AbstractCommand {
-
-    public static final String SHOW_POLL_CMD = "show-poll";
-
-    @Override
-    protected Response invoke(String cmd) {
-        if (SHOW_POLL_CMD.length() + 1 >= cmd.length()) {
-            System.err.println("please specify a poll name");
-            return null;
-        }
-
-        return client.path("api/subject/find/".concat(cmd.substring(SHOW_POLL_CMD.length() + 1))).get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+
+import static jug.client.command.impl.ShowPollCommand.SHOW_POLL_CMD;
+
+@Command(name = SHOW_POLL_CMD, usage = SHOW_POLL_CMD + " <name>", description = "show a poll")
+public class ShowPollCommand extends AbstractCommand {
+
+    public static final String SHOW_POLL_CMD = "show-poll";
+
+    @Override
+    protected Response invoke(String cmd) {
+        if (SHOW_POLL_CMD.length() + 1 >= cmd.length()) {
+            System.err.println("please specify a poll name");
+            return null;
+        }
+
+        return client.path("api/subject/find/".concat(cmd.substring(SHOW_POLL_CMD.length() + 1))).get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/SwitchClientCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/SwitchClientCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/SwitchClientCommand.java
index 3bf715b..d08fb76 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/SwitchClientCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/SwitchClientCommand.java
@@ -1,47 +1,47 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-import jug.client.util.ClientNameHolder;
-
-import javax.ws.rs.core.Response;
-import java.util.Map;
-
-@Command(name = "client", usage = "client <name>", description = "change client")
-public class SwitchClientCommand extends AbstractCommand {
-
-    private Map<String, Class<?>> commands;
-
-    @Override
-    public void execute(final String cmd) {
-        if (cmd.length() <= "client ".length()) {
-            System.err.println("please specify a client name (client1 or client2)");
-            return;
-        }
-
-        final String client = cmd.substring(7);
-        ClientNameHolder.setCurrent(client);
-    }
-
-    @Override
-    protected Response invoke(String cmd) {
-        return null;
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+import jug.client.util.ClientNameHolder;
+
+import javax.ws.rs.core.Response;
+import java.util.Map;
+
+@Command(name = "client", usage = "client <name>", description = "change client")
+public class SwitchClientCommand extends AbstractCommand {
+
+    private Map<String, Class<?>> commands;
+
+    @Override
+    public void execute(final String cmd) {
+        if (cmd.length() <= "client ".length()) {
+            System.err.println("please specify a client name (client1 or client2)");
+            return;
+        }
+
+        final String client = cmd.substring(7);
+        ClientNameHolder.setCurrent(client);
+    }
+
+    @Override
+    protected Response invoke(String cmd) {
+        return null;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/VoteCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/VoteCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/VoteCommand.java
index c95dfff..d0d271f 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/VoteCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/VoteCommand.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.Command;
-import jug.domain.Value;
-
-@Command(name = "vote", usage = "vote [<subject name>, +1|-1]", description = "vote for a subject")
-public class VoteCommand extends QueryAndPostCommand {
-
-    @Override
-    protected String getName() {
-        return "subject";
-    }
-
-    @Override
-    protected String getPath() {
-        return "api/subject/vote";
-    }
-
-    @Override
-    protected String prePost(final String post) {
-        if ("+1".equals(post) || "like".equals(post)) {
-            return Value.I_LIKE.name();
-        }
-        if ("-1".equals(post)) {
-            return Value.I_DONT_LIKE.name();
-        }
-        throw new IllegalArgumentException("please use +1 or -1 and not '" + post + "'");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.Command;
+import jug.domain.Value;
+
+@Command(name = "vote", usage = "vote [<subject name>, +1|-1]", description = "vote for a subject")
+public class VoteCommand extends QueryAndPostCommand {
+
+    @Override
+    protected String getName() {
+        return "subject";
+    }
+
+    @Override
+    protected String getPath() {
+        return "api/subject/vote";
+    }
+
+    @Override
+    protected String prePost(final String post) {
+        if ("+1".equals(post) || "like".equals(post)) {
+            return Value.I_LIKE.name();
+        }
+        if ("-1".equals(post)) {
+            return Value.I_DONT_LIKE.name();
+        }
+        throw new IllegalArgumentException("please use +1 or -1 and not '" + post + "'");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/util/ClientNameHolder.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/util/ClientNameHolder.java b/examples/polling-parent/polling-client/src/main/java/jug/client/util/ClientNameHolder.java
index da5f425..2972a1a 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/util/ClientNameHolder.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/util/ClientNameHolder.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.util;
-
-public class ClientNameHolder {
-
-    private static String current = null;
-
-    public static String getCurrent() {
-        return current;
-    }
-
-    public static void setCurrent(String current) {
-        ClientNameHolder.current = current;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.util;
+
+public class ClientNameHolder {
+
+    private static String current = null;
+
+    public static String getCurrent() {
+        return current;
+    }
+
+    public static void setCurrent(String current) {
+        ClientNameHolder.current = current;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/util/CommandManager.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/util/CommandManager.java b/examples/polling-parent/polling-client/src/main/java/jug/client/util/CommandManager.java
index 03a27b9..a56461f 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/util/CommandManager.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/util/CommandManager.java
@@ -1,74 +1,74 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.util;
-
-import jug.client.command.api.Command;
-import org.apache.xbean.finder.Annotated;
-import org.apache.xbean.finder.AnnotationFinder;
-import org.apache.xbean.finder.IAnnotationFinder;
-import org.apache.xbean.finder.UrlSet;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public class CommandManager {
-
-    private static final Logger LOGGER = Logger.getLogger(CommandManager.class.getName());
-    private static final Map<String, Class<?>> COMMANDS = new TreeMap<String, Class<?>>();
-
-    static {
-        final ClassLoader loader = CommandManager.class.getClassLoader();
-        try {
-            UrlSet urlSet = new UrlSet(loader);
-            urlSet = urlSet.exclude(loader);
-            urlSet = urlSet.include(CommandManager.class.getProtectionDomain().getCodeSource().getLocation());
-
-            final IAnnotationFinder finder = new AnnotationFinder(new ConfigurableClasspathArchive(loader, urlSet.getUrls()));
-            for (Annotated<Class<?>> cmd : finder.findMetaAnnotatedClasses(Command.class)) {
-                try {
-                    final Command annotation = cmd.getAnnotation(Command.class);
-                    final String key = annotation.name();
-                    if (!COMMANDS.containsKey(key)) {
-                        COMMANDS.put(key, cmd.get());
-                    } else {
-                        LOGGER.warning("command " + key + " already exists, this one will be ignored ( " + annotation.description() + ")");
-                    }
-                } catch (Exception e) {
-                    // command ignored
-                }
-            }
-        } catch (RuntimeException | IOException e) {
-            LOGGER.log(Level.SEVERE, "an error occured while getting commands", e);
-        }
-    }
-
-    public static Map<String, Class<?>> getCommands() {
-        return COMMANDS;
-    }
-
-    public static int size() {
-        return COMMANDS.size();
-    }
-
-    public static Set<String> keys() {
-        return COMMANDS.keySet();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.util;
+
+import jug.client.command.api.Command;
+import org.apache.xbean.finder.Annotated;
+import org.apache.xbean.finder.AnnotationFinder;
+import org.apache.xbean.finder.IAnnotationFinder;
+import org.apache.xbean.finder.UrlSet;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class CommandManager {
+
+    private static final Logger LOGGER = Logger.getLogger(CommandManager.class.getName());
+    private static final Map<String, Class<?>> COMMANDS = new TreeMap<String, Class<?>>();
+
+    static {
+        final ClassLoader loader = CommandManager.class.getClassLoader();
+        try {
+            UrlSet urlSet = new UrlSet(loader);
+            urlSet = urlSet.exclude(loader);
+            urlSet = urlSet.include(CommandManager.class.getProtectionDomain().getCodeSource().getLocation());
+
+            final IAnnotationFinder finder = new AnnotationFinder(new ConfigurableClasspathArchive(loader, urlSet.getUrls()));
+            for (Annotated<Class<?>> cmd : finder.findMetaAnnotatedClasses(Command.class)) {
+                try {
+                    final Command annotation = cmd.getAnnotation(Command.class);
+                    final String key = annotation.name();
+                    if (!COMMANDS.containsKey(key)) {
+                        COMMANDS.put(key, cmd.get());
+                    } else {
+                        LOGGER.warning("command " + key + " already exists, this one will be ignored ( " + annotation.description() + ")");
+                    }
+                } catch (Exception e) {
+                    // command ignored
+                }
+            }
+        } catch (RuntimeException | IOException e) {
+            LOGGER.log(Level.SEVERE, "an error occured while getting commands", e);
+        }
+    }
+
+    public static Map<String, Class<?>> getCommands() {
+        return COMMANDS;
+    }
+
+    public static int size() {
+        return COMMANDS.size();
+    }
+
+    public static Set<String> keys() {
+        return COMMANDS.keySet();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/util/ConfigurableClasspathArchive.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/util/ConfigurableClasspathArchive.java b/examples/polling-parent/polling-client/src/main/java/jug/client/util/ConfigurableClasspathArchive.java
index fb9b090..e695fc5 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/util/ConfigurableClasspathArchive.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/util/ConfigurableClasspathArchive.java
@@ -1,196 +1,196 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.util;
-
-import org.apache.xbean.finder.archive.Archive;
-import org.apache.xbean.finder.archive.ClassesArchive;
-import org.apache.xbean.finder.archive.ClasspathArchive;
-import org.apache.xbean.finder.archive.CompositeArchive;
-import org.apache.xbean.finder.archive.FilteredArchive;
-import org.apache.xbean.finder.filter.Filter;
-import org.apache.xbean.finder.filter.FilterList;
-import org.apache.xbean.finder.filter.PackageFilter;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class ConfigurableClasspathArchive extends CompositeArchive {
-
-    private static final SAXParserFactory SAX_FACTORY = SAXParserFactory.newInstance();
-    private static final String SCAN_XML = "META-INF/scan.xml";
-
-    public ConfigurableClasspathArchive(final ClassLoader loader, final Iterable<URL> urls) {
-        super(archive(loader, urls, true));
-    }
-
-    public static List<Archive> archive(final ClassLoader loader, final Iterable<URL> urls, boolean forceDescriptor) {
-        final List<Archive> archives = new ArrayList<Archive>();
-        for (URL location : urls) {
-            try {
-                archives.add(archive(loader, location, true));
-            } catch (Exception e) {
-                // ignored
-            }
-        }
-        return archives;
-    }
-
-    public static Archive archive(final ClassLoader loader, final URL location, boolean forceDescriptor) {
-        try {
-            URL scanXml = loader.getResource(SCAN_XML);
-            if (scanXml == null && !forceDescriptor) {
-                return ClasspathArchive.archive(loader, location);
-            } else if (scanXml == null) {
-                return new ClassesArchive();
-            }
-
-            // read descriptors
-            ScanHandler scan;
-            if (scanXml != null) {
-                scan = read(scanXml);
-            } else {
-                scan = new ScanHandler();
-            }
-
-            final Archive packageArchive = packageArchive(scan.getPackages(), loader, location);
-            final Archive classesArchive = classesArchive(scan.getPackages(), scan.getClasses(), loader);
-
-            if (packageArchive != null && classesArchive != null) {
-                return new CompositeArchive(classesArchive, packageArchive);
-            } else if (packageArchive != null) {
-                return packageArchive;
-            }
-            return classesArchive;
-        } catch (IOException e) {
-            if (forceDescriptor) {
-                return new ClassesArchive();
-            }
-            return ClasspathArchive.archive(loader, location);
-        }
-    }
-
-    public static Archive packageArchive(final Set<String> packageNames, final ClassLoader loader, final URL url) {
-        if (!packageNames.isEmpty()) {
-            return new FilteredArchive(ClasspathArchive.archive(loader, url), filters(packageNames));
-        }
-        return null;
-    }
-
-    private static Filter filters(final Set<String> packageNames) {
-        final List<Filter> filters = new ArrayList<Filter>();
-        for (String packageName : packageNames) {
-            filters.add(new PackageFilter(packageName));
-        }
-        return new FilterList(filters);
-    }
-
-    public static Archive classesArchive(final Set<String> packages, final Set<String> classnames, final ClassLoader loader) {
-        Class<?>[] classes = new Class<?>[classnames.size()];
-        int i = 0;
-        for (String clazz : classnames) {
-            // skip classes managed by package filtering
-            if (packages != null && clazzInPackage(packages, clazz)) {
-                continue;
-            }
-
-            try {
-                classes[i++] = loader.loadClass(clazz);
-            } catch (ClassNotFoundException e) {
-                // ignored
-            }
-        }
-
-        if (i != classes.length) { // shouldn't occur
-            final Class<?>[] updatedClasses = new Class<?>[i];
-            System.arraycopy(classes, 0, updatedClasses, 0, i);
-            classes = updatedClasses;
-        }
-
-        return new ClassesArchive(classes);
-    }
-
-    private static boolean clazzInPackage(final Collection<String> packagename, final String clazz) {
-        for (String str : packagename) {
-            if (clazz.startsWith(str)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static ScanHandler read(final URL scanXml) throws IOException {
-        final SAXParser parser;
-        try {
-            synchronized (SAX_FACTORY) {
-                parser = SAX_FACTORY.newSAXParser();
-            }
-            final ScanHandler handler = new ScanHandler();
-            parser.parse(new BufferedInputStream(scanXml.openStream()), handler);
-            return handler;
-        } catch (Exception e) {
-            throw new IOException("can't parse " + scanXml.toExternalForm());
-        }
-    }
-
-    public static final class ScanHandler extends DefaultHandler {
-
-        private final Set<String> classes = new HashSet<String>();
-        private final Set<String> packages = new HashSet<String>();
-        private Set<String> current = null;
-
-        @Override
-        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-            if (qName.equals("class")) {
-                current = classes;
-            } else if (qName.equals("package")) {
-                current = packages;
-            }
-        }
-
-        @Override
-        public void characters(char ch[], int start, int length) throws SAXException {
-            if (current != null) {
-                current.add(new String(ch, start, length));
-            }
-        }
-
-        @Override
-        public void endElement(final String uri, final String localName, final String qName) throws SAXException {
-            current = null;
-        }
-
-        public Set<String> getPackages() {
-            return packages;
-        }
-
-        public Set<String> getClasses() {
-            return classes;
-        }
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.util;
+
+import org.apache.xbean.finder.archive.Archive;
+import org.apache.xbean.finder.archive.ClassesArchive;
+import org.apache.xbean.finder.archive.ClasspathArchive;
+import org.apache.xbean.finder.archive.CompositeArchive;
+import org.apache.xbean.finder.archive.FilteredArchive;
+import org.apache.xbean.finder.filter.Filter;
+import org.apache.xbean.finder.filter.FilterList;
+import org.apache.xbean.finder.filter.PackageFilter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class ConfigurableClasspathArchive extends CompositeArchive {
+
+    private static final SAXParserFactory SAX_FACTORY = SAXParserFactory.newInstance();
+    private static final String SCAN_XML = "META-INF/scan.xml";
+
+    public ConfigurableClasspathArchive(final ClassLoader loader, final Iterable<URL> urls) {
+        super(archive(loader, urls, true));
+    }
+
+    public static List<Archive> archive(final ClassLoader loader, final Iterable<URL> urls, boolean forceDescriptor) {
+        final List<Archive> archives = new ArrayList<Archive>();
+        for (URL location : urls) {
+            try {
+                archives.add(archive(loader, location, true));
+            } catch (Exception e) {
+                // ignored
+            }
+        }
+        return archives;
+    }
+
+    public static Archive archive(final ClassLoader loader, final URL location, boolean forceDescriptor) {
+        try {
+            URL scanXml = loader.getResource(SCAN_XML);
+            if (scanXml == null && !forceDescriptor) {
+                return ClasspathArchive.archive(loader, location);
+            } else if (scanXml == null) {
+                return new ClassesArchive();
+            }
+
+            // read descriptors
+            ScanHandler scan;
+            if (scanXml != null) {
+                scan = read(scanXml);
+            } else {
+                scan = new ScanHandler();
+            }
+
+            final Archive packageArchive = packageArchive(scan.getPackages(), loader, location);
+            final Archive classesArchive = classesArchive(scan.getPackages(), scan.getClasses(), loader);
+
+            if (packageArchive != null && classesArchive != null) {
+                return new CompositeArchive(classesArchive, packageArchive);
+            } else if (packageArchive != null) {
+                return packageArchive;
+            }
+            return classesArchive;
+        } catch (IOException e) {
+            if (forceDescriptor) {
+                return new ClassesArchive();
+            }
+            return ClasspathArchive.archive(loader, location);
+        }
+    }
+
+    public static Archive packageArchive(final Set<String> packageNames, final ClassLoader loader, final URL url) {
+        if (!packageNames.isEmpty()) {
+            return new FilteredArchive(ClasspathArchive.archive(loader, url), filters(packageNames));
+        }
+        return null;
+    }
+
+    private static Filter filters(final Set<String> packageNames) {
+        final List<Filter> filters = new ArrayList<Filter>();
+        for (String packageName : packageNames) {
+            filters.add(new PackageFilter(packageName));
+        }
+        return new FilterList(filters);
+    }
+
+    public static Archive classesArchive(final Set<String> packages, final Set<String> classnames, final ClassLoader loader) {
+        Class<?>[] classes = new Class<?>[classnames.size()];
+        int i = 0;
+        for (String clazz : classnames) {
+            // skip classes managed by package filtering
+            if (packages != null && clazzInPackage(packages, clazz)) {
+                continue;
+            }
+
+            try {
+                classes[i++] = loader.loadClass(clazz);
+            } catch (ClassNotFoundException e) {
+                // ignored
+            }
+        }
+
+        if (i != classes.length) { // shouldn't occur
+            final Class<?>[] updatedClasses = new Class<?>[i];
+            System.arraycopy(classes, 0, updatedClasses, 0, i);
+            classes = updatedClasses;
+        }
+
+        return new ClassesArchive(classes);
+    }
+
+    private static boolean clazzInPackage(final Collection<String> packagename, final String clazz) {
+        for (String str : packagename) {
+            if (clazz.startsWith(str)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static ScanHandler read(final URL scanXml) throws IOException {
+        final SAXParser parser;
+        try {
+            synchronized (SAX_FACTORY) {
+                parser = SAX_FACTORY.newSAXParser();
+            }
+            final ScanHandler handler = new ScanHandler();
+            parser.parse(new BufferedInputStream(scanXml.openStream()), handler);
+            return handler;
+        } catch (Exception e) {
+            throw new IOException("can't parse " + scanXml.toExternalForm());
+        }
+    }
+
+    public static final class ScanHandler extends DefaultHandler {
+
+        private final Set<String> classes = new HashSet<String>();
+        private final Set<String> packages = new HashSet<String>();
+        private Set<String> current = null;
+
+        @Override
+        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+            if (qName.equals("class")) {
+                current = classes;
+            } else if (qName.equals("package")) {
+                current = packages;
+            }
+        }
+
+        @Override
+        public void characters(char ch[], int start, int length) throws SAXException {
+            if (current != null) {
+                current.add(new String(ch, start, length));
+            }
+        }
+
+        @Override
+        public void endElement(final String uri, final String localName, final String qName) throws SAXException {
+            current = null;
+        }
+
+        public Set<String> getPackages() {
+            return packages;
+        }
+
+        public Set<String> getClasses() {
+            return classes;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-core/src/main/java/jug/dao/SubjectDao.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-core/src/main/java/jug/dao/SubjectDao.java b/examples/polling-parent/polling-core/src/main/java/jug/dao/SubjectDao.java
index 2fb6fcb..824ca75 100644
--- a/examples/polling-parent/polling-core/src/main/java/jug/dao/SubjectDao.java
+++ b/examples/polling-parent/polling-core/src/main/java/jug/dao/SubjectDao.java
@@ -1,115 +1,115 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.dao;
-
-import jug.domain.Subject;
-import jug.domain.Value;
-import jug.domain.Vote;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import java.util.Collection;
-
-@Singleton
-@Lock(LockType.READ)
-public class SubjectDao {
-
-    @PersistenceContext(unitName = "polling")
-    private EntityManager em;
-
-    @Inject
-    private ReadSubjectDao readDao;
-
-    public Subject create(final String name, final String question) {
-        final Subject subject = new Subject();
-        subject.setName(name);
-        subject.setQuestion(question);
-
-        em.persist(subject);
-        return subject;
-    }
-
-    public Subject addVote(final Subject subject, final Vote vote) {
-        final Vote foundVote = retrieve(vote, Vote.class, vote.getId());
-        final Subject subjectToUpdate = retrieve(subject, Subject.class, subject.getId());
-
-        subjectToUpdate.getVotes().add(foundVote);
-        return subjectToUpdate;
-    }
-
-    public Subject findByName(final String name) {
-        return readDao.findByName(name);
-    }
-
-    public Collection<Subject> findAll() {
-        return readDao.findAll();
-    }
-
-    public int subjectLikeVoteNumber(final String subjectName) {
-        return subjectVoteNumber(subjectName, Value.I_LIKE);
-    }
-
-    public int subjectNotLikeVoteNumber(final String subjectName) {
-        return subjectVoteNumber(subjectName, Value.I_DONT_LIKE);
-    }
-
-    private int subjectVoteNumber(final String subjectName, final Value value) {
-        return em.createNamedQuery(Subject.COUNT_VOTE, Number.class)
-                 .setParameter("name", subjectName)
-                 .setParameter("value", value)
-                 .getSingleResult().intValue();
-    }
-
-    private <T> T retrieve(final T object, final Class<T> clazz, long id) {
-        if (em.contains(object)) {
-            return object;
-        }
-
-        final T t = em.find(clazz, id);
-        if (t == null) {
-            throw new IllegalArgumentException(clazz.getSimpleName() + " not found");
-        }
-        return t;
-    }
-
-    public Subject bestSubject() {
-        int bestScore = 0;
-        Subject best = null;
-        for (Subject subject : findAll()) {
-            int currentScore = subject.score();
-            if (best == null || bestScore < currentScore) {
-                bestScore = currentScore;
-                best = subject;
-            }
-        }
-        return best;
-    }
-
-    @Singleton
-    @Lock(LockType.READ)
-    @PersistenceContext(name = "polling")
-    public static interface ReadSubjectDao {
-
-        Subject findByName(final String name);
-
-        Collection<Subject> findAll();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.dao;
+
+import jug.domain.Subject;
+import jug.domain.Value;
+import jug.domain.Vote;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.util.Collection;
+
+@Singleton
+@Lock(LockType.READ)
+public class SubjectDao {
+
+    @PersistenceContext(unitName = "polling")
+    private EntityManager em;
+
+    @Inject
+    private ReadSubjectDao readDao;
+
+    public Subject create(final String name, final String question) {
+        final Subject subject = new Subject();
+        subject.setName(name);
+        subject.setQuestion(question);
+
+        em.persist(subject);
+        return subject;
+    }
+
+    public Subject addVote(final Subject subject, final Vote vote) {
+        final Vote foundVote = retrieve(vote, Vote.class, vote.getId());
+        final Subject subjectToUpdate = retrieve(subject, Subject.class, subject.getId());
+
+        subjectToUpdate.getVotes().add(foundVote);
+        return subjectToUpdate;
+    }
+
+    public Subject findByName(final String name) {
+        return readDao.findByName(name);
+    }
+
+    public Collection<Subject> findAll() {
+        return readDao.findAll();
+    }
+
+    public int subjectLikeVoteNumber(final String subjectName) {
+        return subjectVoteNumber(subjectName, Value.I_LIKE);
+    }
+
+    public int subjectNotLikeVoteNumber(final String subjectName) {
+        return subjectVoteNumber(subjectName, Value.I_DONT_LIKE);
+    }
+
+    private int subjectVoteNumber(final String subjectName, final Value value) {
+        return em.createNamedQuery(Subject.COUNT_VOTE, Number.class)
+                .setParameter("name", subjectName)
+                .setParameter("value", value)
+                .getSingleResult().intValue();
+    }
+
+    private <T> T retrieve(final T object, final Class<T> clazz, long id) {
+        if (em.contains(object)) {
+            return object;
+        }
+
+        final T t = em.find(clazz, id);
+        if (t == null) {
+            throw new IllegalArgumentException(clazz.getSimpleName() + " not found");
+        }
+        return t;
+    }
+
+    public Subject bestSubject() {
+        int bestScore = 0;
+        Subject best = null;
+        for (Subject subject : findAll()) {
+            int currentScore = subject.score();
+            if (best == null || bestScore < currentScore) {
+                bestScore = currentScore;
+                best = subject;
+            }
+        }
+        return best;
+    }
+
+    @Singleton
+    @Lock(LockType.READ)
+    @PersistenceContext(name = "polling")
+    public static interface ReadSubjectDao {
+
+        Subject findByName(final String name);
+
+        Collection<Subject> findAll();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-core/src/main/java/jug/dao/VoteDao.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-core/src/main/java/jug/dao/VoteDao.java b/examples/polling-parent/polling-core/src/main/java/jug/dao/VoteDao.java
index 40ca37d..7466fca 100644
--- a/examples/polling-parent/polling-core/src/main/java/jug/dao/VoteDao.java
+++ b/examples/polling-parent/polling-core/src/main/java/jug/dao/VoteDao.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.dao;
-
-import jug.domain.Value;
-import jug.domain.Vote;
-
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-@Singleton
-@Lock(LockType.READ)
-public class VoteDao {
-
-    @PersistenceContext(unitName = "polling")
-    private EntityManager em;
-
-    public Vote create(final Value voteValue) {
-        final Vote vote = new Vote();
-        vote.setValue(voteValue);
-
-        em.persist(vote);
-        return vote;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.dao;
+
+import jug.domain.Value;
+import jug.domain.Vote;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Singleton
+@Lock(LockType.READ)
+public class VoteDao {
+
+    @PersistenceContext(unitName = "polling")
+    private EntityManager em;
+
+    public Vote create(final Value voteValue) {
+        final Vote vote = new Vote();
+        vote.setValue(voteValue);
+
+        em.persist(vote);
+        return vote;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-core/src/test/java/jug/dao/SubjectDaoTest.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-core/src/test/java/jug/dao/SubjectDaoTest.java b/examples/polling-parent/polling-core/src/test/java/jug/dao/SubjectDaoTest.java
index 74ef984..9c84ab1 100644
--- a/examples/polling-parent/polling-core/src/test/java/jug/dao/SubjectDaoTest.java
+++ b/examples/polling-parent/polling-core/src/test/java/jug/dao/SubjectDaoTest.java
@@ -1,99 +1,99 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.dao;
-
-import jug.domain.Subject;
-import jug.domain.Value;
-import jug.domain.Vote;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.inject.Inject;
-import javax.naming.NamingException;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class SubjectDaoTest {
-
-    private static EJBContainer container;
-
-    @Inject
-    private SubjectDao subjectDao;
-
-    @Inject
-    private VoteDao voteDao;
-
-    @BeforeClass
-    public static void start() {
-        container = EJBContainer.createEJBContainer();
-    }
-
-    @Before
-    public void inject() throws NamingException {
-        container.getContext().bind("inject", this);
-    }
-
-    @AfterClass
-    public static void stop() {
-        container.close();
-    }
-
-    @Test
-    public void persistSimpleSubject() {
-        final Subject subject = subjectDao.create("TOMEE_JUG", "What do you think about this JUG?");
-        assertNotNull(subject);
-        assertEquals("TOMEE_JUG", subject.getName());
-    }
-
-    @Test
-    public void playWithVotes() {
-        Subject subject = subjectDao.create("TOMEE_JUG_2", "What do you think about this JUG?");
-
-        final Vote vote = voteDao.create(Value.I_LIKE);
-        subject = subjectDao.addVote(subject, vote);
-        assertEquals(1, subject.getVotes().size());
-
-        final Vote moreVote = voteDao.create(Value.I_LIKE);
-        subject = subjectDao.addVote(subject, moreVote);
-        assertEquals(2, subject.getVotes().size());
-
-        final Vote notLiked = voteDao.create(Value.I_DONT_LIKE);
-        subject = subjectDao.addVote(subject, notLiked);
-        assertEquals(3, subject.getVotes().size());
-
-        final Subject retrievedSubject = subjectDao.findByName("TOMEE_JUG_2");
-        assertNotNull(retrievedSubject);
-        assertNotNull(retrievedSubject.getVotes());
-        assertEquals(3, retrievedSubject.getVotes().size());
-    }
-
-    @Test
-    public void voteNumber() {
-        final Subject subject = subjectDao.create("TOMEE_JUG_3", "What do you think about this JUG?");
-
-        subjectDao.addVote(subject, voteDao.create(Value.I_LIKE));
-        subjectDao.addVote(subject, voteDao.create(Value.I_LIKE));
-        subjectDao.addVote(subject, voteDao.create(Value.I_DONT_LIKE));
-
-        assertEquals(2, subjectDao.subjectLikeVoteNumber("TOMEE_JUG_3"));
-        assertEquals(1, subjectDao.subjectNotLikeVoteNumber("TOMEE_JUG_3"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.dao;
+
+import jug.domain.Subject;
+import jug.domain.Value;
+import jug.domain.Vote;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.inject.Inject;
+import javax.naming.NamingException;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class SubjectDaoTest {
+
+    private static EJBContainer container;
+
+    @Inject
+    private SubjectDao subjectDao;
+
+    @Inject
+    private VoteDao voteDao;
+
+    @BeforeClass
+    public static void start() {
+        container = EJBContainer.createEJBContainer();
+    }
+
+    @Before
+    public void inject() throws NamingException {
+        container.getContext().bind("inject", this);
+    }
+
+    @AfterClass
+    public static void stop() {
+        container.close();
+    }
+
+    @Test
+    public void persistSimpleSubject() {
+        final Subject subject = subjectDao.create("TOMEE_JUG", "What do you think about this JUG?");
+        assertNotNull(subject);
+        assertEquals("TOMEE_JUG", subject.getName());
+    }
+
+    @Test
+    public void playWithVotes() {
+        Subject subject = subjectDao.create("TOMEE_JUG_2", "What do you think about this JUG?");
+
+        final Vote vote = voteDao.create(Value.I_LIKE);
+        subject = subjectDao.addVote(subject, vote);
+        assertEquals(1, subject.getVotes().size());
+
+        final Vote moreVote = voteDao.create(Value.I_LIKE);
+        subject = subjectDao.addVote(subject, moreVote);
+        assertEquals(2, subject.getVotes().size());
+
+        final Vote notLiked = voteDao.create(Value.I_DONT_LIKE);
+        subject = subjectDao.addVote(subject, notLiked);
+        assertEquals(3, subject.getVotes().size());
+
+        final Subject retrievedSubject = subjectDao.findByName("TOMEE_JUG_2");
+        assertNotNull(retrievedSubject);
+        assertNotNull(retrievedSubject.getVotes());
+        assertEquals(3, retrievedSubject.getVotes().size());
+    }
+
+    @Test
+    public void voteNumber() {
+        final Subject subject = subjectDao.create("TOMEE_JUG_3", "What do you think about this JUG?");
+
+        subjectDao.addVote(subject, voteDao.create(Value.I_LIKE));
+        subjectDao.addVote(subject, voteDao.create(Value.I_LIKE));
+        subjectDao.addVote(subject, voteDao.create(Value.I_DONT_LIKE));
+
+        assertEquals(2, subjectDao.subjectLikeVoteNumber("TOMEE_JUG_3"));
+        assertEquals(1, subjectDao.subjectNotLikeVoteNumber("TOMEE_JUG_3"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-domain/src/main/java/jug/domain/Result.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Result.java b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Result.java
index 7d52fd1..bc6e567 100644
--- a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Result.java
+++ b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Result.java
@@ -1,67 +1,67 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.domain;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement
-@XmlType(propOrder = {
-                         "likes",
-                         "unlikes",
-                         "sum"
-})
-public class Result {
-
-    private int likes;
-    private int unlikes;
-    private int sum;
-
-    public Result() {
-        // no-op
-    }
-
-    public Result(int likes, int unlikes) {
-        this.likes = likes;
-        this.unlikes = -Math.abs(unlikes);
-        sum = likes + unlikes;
-    }
-
-    public int getLikes() {
-        return likes;
-    }
-
-    public void setLikes(int likes) {
-        this.likes = likes;
-    }
-
-    public int getUnlikes() {
-        return unlikes;
-    }
-
-    public void setUnlikes(int unlikes) {
-        this.unlikes = unlikes;
-    }
-
-    public int getSum() {
-        return sum;
-    }
-
-    public void setSum(int sum) {
-        this.sum = sum;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.domain;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement
+@XmlType(propOrder = {
+        "likes",
+        "unlikes",
+        "sum"
+})
+public class Result {
+
+    private int likes;
+    private int unlikes;
+    private int sum;
+
+    public Result() {
+        // no-op
+    }
+
+    public Result(int likes, int unlikes) {
+        this.likes = likes;
+        this.unlikes = -Math.abs(unlikes);
+        sum = likes + unlikes;
+    }
+
+    public int getLikes() {
+        return likes;
+    }
+
+    public void setLikes(int likes) {
+        this.likes = likes;
+    }
+
+    public int getUnlikes() {
+        return unlikes;
+    }
+
+    public void setUnlikes(int unlikes) {
+        this.unlikes = unlikes;
+    }
+
+    public int getSum() {
+        return sum;
+    }
+
+    public void setSum(int sum) {
+        this.sum = sum;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-domain/src/main/java/jug/domain/Subject.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Subject.java b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Subject.java
index dfe41ca..ec78b4d 100644
--- a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Subject.java
+++ b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Subject.java
@@ -1,106 +1,106 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.domain;
-
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.Collection;
-
-@Entity
-@NamedQueries({
-                  @NamedQuery(name = Subject.FIND_ALL, query = "select s from Subject s"),
-                  @NamedQuery(name = Subject.FIND_BY_NAME_QUERY, query = "select s from Subject s where s.name = :name"),
-                  @NamedQuery(name = Subject.COUNT_VOTE, query = "select count(s) from Subject s left join s.votes v where v.value = :value and :name = s.name")
-              })
-@XmlRootElement
-public class Subject {
-
-    public static final String FIND_BY_NAME_QUERY = "Subject.findByName";
-    public static final String COUNT_VOTE = "Subject.countVoteNumber";
-    public static final String FIND_ALL = "Subject.findAll";
-
-    @Id
-    @GeneratedValue
-    private long id;
-
-    private String name;
-
-    private String question;
-
-    @OneToMany(fetch = FetchType.EAGER)
-    private Collection<Vote> votes = new ArrayList<Vote>();
-
-    public Subject() {
-        // no-op
-    }
-
-    public Subject(String name, String question) {
-        this.name = name;
-        this.question = question;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getQuestion() {
-        return question;
-    }
-
-    public void setQuestion(String question) {
-        this.question = question;
-    }
-
-    public Collection<Vote> getVotes() {
-        return votes;
-    }
-
-    public void setVotes(Collection<Vote> votes) {
-        this.votes = votes;
-    }
-
-    public int score() {
-        int s = 0;
-        for (Vote vote : votes) {
-            if (vote.getValue().equals(Value.I_LIKE)) {
-                s++;
-            } else {
-                s--;
-            }
-        }
-        return s;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.Collection;
+
+@Entity
+@NamedQueries({
+        @NamedQuery(name = Subject.FIND_ALL, query = "select s from Subject s"),
+        @NamedQuery(name = Subject.FIND_BY_NAME_QUERY, query = "select s from Subject s where s.name = :name"),
+        @NamedQuery(name = Subject.COUNT_VOTE, query = "select count(s) from Subject s left join s.votes v where v.value = :value and :name = s.name")
+})
+@XmlRootElement
+public class Subject {
+
+    public static final String FIND_BY_NAME_QUERY = "Subject.findByName";
+    public static final String COUNT_VOTE = "Subject.countVoteNumber";
+    public static final String FIND_ALL = "Subject.findAll";
+
+    @Id
+    @GeneratedValue
+    private long id;
+
+    private String name;
+
+    private String question;
+
+    @OneToMany(fetch = FetchType.EAGER)
+    private Collection<Vote> votes = new ArrayList<Vote>();
+
+    public Subject() {
+        // no-op
+    }
+
+    public Subject(String name, String question) {
+        this.name = name;
+        this.question = question;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getQuestion() {
+        return question;
+    }
+
+    public void setQuestion(String question) {
+        this.question = question;
+    }
+
+    public Collection<Vote> getVotes() {
+        return votes;
+    }
+
+    public void setVotes(Collection<Vote> votes) {
+        this.votes = votes;
+    }
+
+    public int score() {
+        int s = 0;
+        for (Vote vote : votes) {
+            if (vote.getValue().equals(Value.I_LIKE)) {
+                s++;
+            } else {
+                s--;
+            }
+        }
+        return s;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-domain/src/main/java/jug/domain/Value.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Value.java b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Value.java
index 518142a..c667d6a 100644
--- a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Value.java
+++ b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Value.java
@@ -1,22 +1,22 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.domain;
-
-public enum Value {
-    I_LIKE,
-    I_DONT_LIKE;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.domain;
+
+public enum Value {
+    I_LIKE,
+    I_DONT_LIKE;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-domain/src/main/java/jug/domain/Vote.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Vote.java b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Vote.java
index 605f66d..44f1684 100644
--- a/examples/polling-parent/polling-domain/src/main/java/jug/domain/Vote.java
+++ b/examples/polling-parent/polling-domain/src/main/java/jug/domain/Vote.java
@@ -1,52 +1,52 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.domain;
-
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Entity
-@XmlRootElement
-public class Vote {
-
-    @Id
-    @GeneratedValue
-    private long id;
-
-    @Enumerated(EnumType.STRING)
-    private Value value;
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public Value getValue() {
-        return value;
-    }
-
-    public void setValue(Value value) {
-        this.value = value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Entity
+@XmlRootElement
+public class Vote {
+
+    @Id
+    @GeneratedValue
+    private long id;
+
+    @Enumerated(EnumType.STRING)
+    private Value value;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public Value getValue() {
+        return value;
+    }
+
+    public void setValue(Value value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/monitoring/VoteCounter.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/monitoring/VoteCounter.java b/examples/polling-parent/polling-web/src/main/java/jug/monitoring/VoteCounter.java
index 1883d92..d50bca5 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/monitoring/VoteCounter.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/monitoring/VoteCounter.java
@@ -1,60 +1,60 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.monitoring;
-
-import jug.domain.Subject;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.management.Description;
-import javax.management.MBean;
-import javax.management.ManagedAttribute;
-import javax.management.ManagedOperation;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@MBean
-@ApplicationScoped
-@Description("count the number of vote by subject")
-public class VoteCounter {
-
-    private final Map<String, Subject> subjects = new ConcurrentHashMap<String, Subject>();
-
-    @ManagedAttribute
-    @Description("number of poll created/updated in this instance")
-    public int getSubjectNumber() {
-        return subjects.size();
-    }
-
-    @ManagedOperation
-    @Description("current score of the specified poll")
-    public String names() {
-        return subjects.keySet().toString();
-    }
-
-    @ManagedOperation
-    @Description("current score of the specified poll")
-    public String score(final String name) {
-        if (subjects.containsKey(name)) {
-            return Integer.toString(subjects.get(name).score());
-        }
-        return "poll not found";
-    }
-
-    public void putSubject(final Subject subject) {
-        subjects.put(subject.getName(), subject);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.monitoring;
+
+import jug.domain.Subject;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.management.Description;
+import javax.management.MBean;
+import javax.management.ManagedAttribute;
+import javax.management.ManagedOperation;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+@MBean
+@ApplicationScoped
+@Description("count the number of vote by subject")
+public class VoteCounter {
+
+    private final Map<String, Subject> subjects = new ConcurrentHashMap<String, Subject>();
+
+    @ManagedAttribute
+    @Description("number of poll created/updated in this instance")
+    public int getSubjectNumber() {
+        return subjects.size();
+    }
+
+    @ManagedOperation
+    @Description("current score of the specified poll")
+    public String names() {
+        return subjects.keySet().toString();
+    }
+
+    @ManagedOperation
+    @Description("current score of the specified poll")
+    public String score(final String name) {
+        if (subjects.containsKey(name)) {
+            return Integer.toString(subjects.get(name).score());
+        }
+        return "poll not found";
+    }
+
+    public void putSubject(final Subject subject) {
+        subjects.put(subject.getName(), subject);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/rest/PollingApplication.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/rest/PollingApplication.java b/examples/polling-parent/polling-web/src/main/java/jug/rest/PollingApplication.java
index b9501c7..e2fc60d 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/rest/PollingApplication.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/rest/PollingApplication.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.rest;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-import java.util.HashSet;
-import java.util.Set;
-
-@ApplicationPath("/api")
-public class PollingApplication extends Application {
-
-    public Set<Class<?>> getClasses() {
-        final Set<Class<?>> classes = new HashSet<Class<?>>();
-        classes.add(SubjectService.class);
-        return classes;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.rest;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+@ApplicationPath("/api")
+public class PollingApplication extends Application {
+
+    public Set<Class<?>> getClasses() {
+        final Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(SubjectService.class);
+        return classes;
+    }
+}


[25/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/datasource-versioning/README.md
----------------------------------------------------------------------
diff --git a/examples/datasource-versioning/README.md b/examples/datasource-versioning/README.md
index f88e391..f0adadc 100644
--- a/examples/datasource-versioning/README.md
+++ b/examples/datasource-versioning/README.md
@@ -1,386 +1,386 @@
-Title: DataSource Versioning
-
-This example shows you how to use versioned DataSources of the same provider using the classpath attribute.
-
-# Configuration
-
-The DataSource configuration can be made several ways and here we layout two common methods in the form of unit tests.
-Before we start, if you take a peek in the project pom.xml and look for the maven-dependency-plugin usage you will see that we pull in
-two completely different driver files for this example.
-
-# AlternateDataSourceTest.java
-This test utilizes the Arquillian testing framework. See [here](http://tomee.apache.org/arquillian-available-adapters.html) for more details.
-
-The example uses src/test/resources/arquillian.xml and src/test/conf/tomee.xml to define the DataSources.
-Note the differing driver version paths, yet still using the same provider (org.apache.derby.jdbc.EmbeddedDriver):
-
-    <tomee>
-
-      <Resource id="DatabaseOne" type="DataSource" classpath="${catalina.base}/../../drivers/derby-10.10.1.1.jar">
-        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
-        JdbcUrl jdbc:derby:databaseOne;create=true
-        UserName SA
-      </Resource>
-
-      <Resource id="DatabaseTwo" type="DataSource" classpath="${catalina.base}/../../drivers/derby-10.9.1.0.jar">
-        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
-        JdbcUrl jdbc:derby:databaseTwo;create=true
-        UserName SA
-      </Resource>
-
-    </tomee>
-	
-# Developer Information
-When testing within a Maven environment it is also possible to use direct maven coordinates rather than a file link, like so:
-
-    ....
-	<Resource id="DatabaseOne" type="DataSource" classpath="mvn:org.apache.derby:derby:10.10.1.1">
-	....
-	
-
-# AlternateDriverJarTest.java
-
-This test takes an embedded approach and as you can see the driver paths are specified as a DataSource parameter.
-Both examples demonstrate the same, in that two driver versions can be loaded and used within the same application.
-
-    @Configuration
-    public Properties config() {
-
-        final File drivers = new File(new File("target"), "drivers").getAbsoluteFile();
-
-        final Properties p = new Properties();
-        p.put("openejb.jdbc.datasource-creator", "dbcp-alternative");
-
-        File file = new File(drivers, "derby-10.10.1.1.jar");
-        Assert.assertTrue("Failed to find: " + file, file.exists());
-
-        p.put("JdbcOne", "new://Resource?type=DataSource&classpath="
-                + file.getAbsolutePath().replace("\\", "/"));
-        p.put("JdbcOne.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
-        p.put("JdbcOne.JdbcUrl", "jdbc:derby:memory:JdbcOne;create=true");
-        p.put("JdbcOne.UserName", USER);
-        p.put("JdbcOne.Password", PASSWORD);
-        p.put("JdbcOne.JtaManaged", "false");
-
-        file = new File(drivers, "derby-10.9.1.0.jar");
-        Assert.assertTrue("Failed to find: " + file, file.exists());
-
-        p.put("JdbcTwo", "new://Resource?type=DataSource&classpath="
-                + file.getAbsolutePath().replace("\\", "/"));
-        p.put("JdbcTwo.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
-        p.put("JdbcTwo.JdbcUrl", "jdbc:derby:memory:JdbcTwo;create=true");
-        p.put("JdbcTwo.UserName", USER);
-        p.put("JdbcTwo.Password", PASSWORD);
-        p.put("JdbcTwo.JtaManaged", "false");
-        return p;
-    }
-
-# Full Test Source for AlternateDataSourceTest.java
-
-    package org.superbiz;
-
-    import org.jboss.arquillian.container.test.api.Deployment;
-    import org.jboss.arquillian.junit.Arquillian;
-    import org.jboss.shrinkwrap.api.ShrinkWrap;
-    import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-    import org.jboss.shrinkwrap.api.spec.WebArchive;
-    import org.junit.Assert;
-    import org.junit.Test;
-    import org.junit.runner.RunWith;
-
-    import javax.annotation.Resource;
-    import javax.ejb.EJB;
-    import javax.ejb.Stateless;
-    import javax.sql.DataSource;
-    import java.sql.Connection;
-    import java.sql.DatabaseMetaData;
-    import java.sql.SQLException;
-
-    @RunWith(Arquillian.class)
-    public class AlternateDataSourceTest {
-
-        @Deployment
-        public static WebArchive createDeployment() {
-
-            return ShrinkWrap.create(WebArchive.class, "test.war")
-                .addClasses(DataSourceTester.class)
-                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml");
-            //We are using src/test/conf/tomee.xml, but this also works - .addAsResource(new ClassLoaderAsset("META-INF/resources.xml"), "META-INF/resources.xml");
-            //Or even using a persistence context - .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
-        }
-
-        @EJB
-        private DataSourceTester tester;
-
-        @Test
-        public void testDataSourceOne() throws Exception {
-            Assert.assertEquals("Should be using 10.10.1.1 - (1458268)", "10.10.1.1 - (1458268)", tester.getOne());
-        }
-
-        @Test
-        public void testDataSourceTwo() throws Exception {
-            Assert.assertEquals("Should be using 10.9.1.0 - (1344872)", "10.9.1.0 - (1344872)", tester.getTwo());
-        }
-
-        @Test
-        public void testDataSourceBoth() throws Exception {
-            Assert.assertEquals("Should be using 10.10.1.1 - (1458268)|10.9.1.0 - (1344872)", "10.10.1.1 - (1458268)|10.9.1.0 - (1344872)", tester.getBoth());
-        }
-
-        @Stateless
-        public static class DataSourceTester {
-
-            @Resource(name = "DatabaseOne")
-            DataSource dataSourceOne;
-
-            @Resource(name = "DatabaseTwo")
-            DataSource dataSourceTwo;
-
-            public String getOne() throws Exception {
-                return getVersion(dataSourceOne);
-            }
-
-            public String getTwo() throws Exception {
-                return getVersion(dataSourceTwo);
-            }
-
-            public String getBoth() throws Exception {
-                return getOne() + "|" + getTwo();
-            }
-
-            private static String getVersion(final DataSource ds) throws SQLException {
-                Connection con = null;
-                try {
-                    con = ds.getConnection();
-                    final DatabaseMetaData md = con.getMetaData();
-                    return md.getDriverVersion();
-                } finally {
-                    if (con != null) {
-                        con.close();
-                    }
-                }
-            }
-        }
-    }
-
-# Running
-
-    
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.AlternateDataSourceTest
-    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.Setup findHome
-    INFO: Unable to find home in: C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote
-    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
-    INFO: Downloading org.apache.openejb:apache-tomee:1.6.1-SNAPSHOT:zip:webprofile please wait...
-    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.Zips unzip
-    INFO: Extracting 'C:\Users\Andy\.m2\repository\org\apache\openejb\apache-tomee\1.6.1-SNAPSHOT\apache-tomee-1.6.1-SNAPSHOT-webprofile.zip' to 'C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote'
-    Apr 17, 2014 2:19:47 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
-    INFO: Downloaded container to: C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
-    INFO - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_45\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\SlikSvn\bin;C:\dev\apache-maven-3.2.1\bin;C:\dev\apache-ant-1.9.3\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\TortoiseSVN\bin;.
-    INFO - Initializing ProtocolHandler ["http-bio-55243"]
-    INFO - Initializing ProtocolHandler ["ajp-bio-55245"]
-    INFO - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
-    INFO - Optional service not installed: org.apache.tomee.webservices.TomeeJaxRsService
-    INFO - Optional service not installed: org.apache.tomee.webservices.TomeeJaxWsService
-    INFO - ********************************************************************************
-    INFO - OpenEJB http://tomee.apache.org/
-    INFO - Startup: Thu Apr 17 14:19:55 CEST 2014
-    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
-    INFO - Version: 4.6.1-SNAPSHOT
-    INFO - Build date: 20140417
-    INFO - Build time: 01:37
-    INFO - ********************************************************************************
-    INFO - openejb.home = C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
-    INFO - openejb.base = C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
-    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@22c2e2dd
-    INFO - Succeeded in installing singleton service
-    INFO - openejb configuration file is 'C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT\conf\tomee.xml'
-    INFO - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Configuring Service(id=DatabaseOne, type=Resource, provider-id=Default JDBC Database)
-    INFO - Configuring Service(id=DatabaseTwo, type=Resource, provider-id=Default JDBC Database)
-    INFO - Using 'openejb.system.apps=true'
-    INFO - Configuring enterprise application: openejb
-    INFO - Using openejb.deploymentId.format '{ejbName}'
-    INFO - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
-    INFO - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
-    INFO - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
-    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
-    INFO - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
-    INFO - Enterprise application "openejb" loaded.
-    INFO - Creating TransactionManager(id=Default Transaction Manager)
-    INFO - Creating SecurityService(id=Tomcat Security Service)
-    INFO - Creating Resource(id=DatabaseOne)
-    INFO - Disabling testOnBorrow since no validation query is provided
-    INFO - Creating Resource(id=DatabaseTwo)
-    INFO - Disabling testOnBorrow since no validation query is provided
-    INFO - Creating Container(id=Default Stateless Container)
-    INFO - Assembling app: openejb
-    INFO - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
-    INFO - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
-    INFO - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
-    INFO - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
-    INFO - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFO - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFO - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
-    INFO - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
-    INFO - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
-    INFO - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
-    INFO - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
-    INFO - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
-    INFO - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
-    INFO - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
-    INFO - Deployed Application(path=openejb)
-    INFO -   ** Bound Services **
-    INFO -   NAME                 IP              PORT
-    INFO - -------
-    INFO - Ready!
-    INFO - Initialization processed in 7959 ms
-    INFO - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
-    INFO - Creating Resource(id=UserDatabase)
-    INFO - Starting service Catalina
-    INFO - Starting Servlet Engine: Apache Tomcat (TomEE)/7.0.53 (1.6.1-SNAPSHOT)
-    INFO - Starting ProtocolHandler ["http-bio-55243"]
-    INFO - Starting ProtocolHandler ["ajp-bio-55245"]
-    INFO - Server startup in 288 ms
-    WARNING - StandardServer.await: Invalid command '' received
-    Apr 17, 2014 2:20:04 PM org.apache.openejb.client.EventLogger log
-    INFO: RemoteInitialContextCreated{providerUri=http://localhost:55243/tomee/ejb}
-    INFO - Extracting jar: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test.war
-    INFO - Extracted path: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
-    INFO - using default host: localhost
-    INFO - ------------------------- localhost -> /test
-    INFO - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
-    INFO - Configuring enterprise application: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
-    INFO - Auto-deploying ejb DataSourceTester: EjbDeployment(deployment-id=DataSourceTester)
-    INFO - Auto-linking resource-ref 'java:comp/env/DatabaseTwo' in bean DataSourceTester to Resource(id=DatabaseTwo)
-    INFO - Auto-linking resource-ref 'java:comp/env/DatabaseOne' in bean DataSourceTester to Resource(id=DatabaseOne)
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean org.superbiz.AlternateDataSourceTest: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Creating Container(id=Default Managed Container)
-    INFO - Using directory C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT\temp for stateful session passivation
-    INFO - Enterprise application "C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test" loaded.
-    INFO - Assembling app: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
-    INFO - Jndi(name=DataSourceTesterLocalBean) --> Ejb(deployment-id=DataSourceTester)
-    INFO - Jndi(name=global/test/DataSourceTester!org.superbiz.AlternateDataSourceTest$DataSourceTester) --> Ejb(deployment-id=DataSourceTester)
-    INFO - Jndi(name=global/test/DataSourceTester) --> Ejb(deployment-id=DataSourceTester)
-    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@22c2e2dd
-    INFO - OpenWebBeans Container is starting...
-    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
-    INFO - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
-    INFO - All injection points were validated successfully.
-    INFO - OpenWebBeans Container has started, it took 203 ms.
-    INFO - Created Ejb(deployment-id=DataSourceTester, ejb-name=DataSourceTester, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=DataSourceTester, ejb-name=DataSourceTester, container=Default Stateless Container)
-    INFO - Deployed Application(path=C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test)
-    Apr 17, 2014 2:20:11 PM org.apache.openejb.client.EventLogger log
-    INFO: RemoteInitialContextCreated{providerUri=http://localhost:55243/tomee/ejb}
-    INFO - Undeploying app: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
-    INFO: cleaning C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0
-    Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.155 sec
-    Running org.superbiz.AlternateDriverJarTest
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigUtils searchForConfiguration
-    INFO: Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=JdbcTwo, type=Resource, provider-id=Default JDBC Database)
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=JdbcOne, type=Resource, provider-id=Default JDBC Database)
-    Apr 17, 2014 2:20:13 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating TransactionManager(id=Default Transaction Manager)
-    Apr 17, 2014 2:20:14 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating SecurityService(id=Default Security Service)
-    Apr 17, 2014 2:20:14 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating Resource(id=JdbcTwo)
-    Apr 17, 2014 2:20:15 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating Resource(id=JdbcOne)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureApplication
-    INFO: Configuring enterprise application: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig createContainer
-    INFO: Auto-creating a container for bean org.superbiz.AlternateDriverJarTest: Container(type=MANAGED, id=Default Managed Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating Container(id=Default Managed Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.core.managed.SimplePassivater init
-    INFO: Using directory C:\Users\Andy\AppData\Local\Temp for stateful session passivation
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureService
-    INFO: Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig createContainer
-    INFO: Auto-creating a container for bean JdbcOne: Container(type=SINGLETON, id=Default Singleton Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createRecipe
-    INFO: Creating Container(id=Default Singleton Container)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig processResourceRef
-    INFO: Auto-linking resource-ref 'java:comp/env/JdbcOne' in bean JdbcOne to Resource(id=JdbcOne)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig processResourceRef
-    INFO: Auto-linking resource-ref 'java:comp/env/JdbcTwo' in bean JdbcTwo to Resource(id=JdbcTwo)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AppInfoBuilder build
-    INFO: Enterprise application "C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest" loaded.
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createApplication
-    INFO: Assembling app: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=JdbcOneLocalBean) --> Ejb(deployment-id=JdbcOne)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcOne!org.superbiz.AlternateDriverJarTest$JdbcOne) --> Ejb(deployment-id=JdbcOne)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcOne) --> Ejb(deployment-id=JdbcOne)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=JdbcTwoLocalBean) --> Ejb(deployment-id=JdbcTwo)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcTwo!org.superbiz.AlternateDriverJarTest$JdbcTwo) --> Ejb(deployment-id=JdbcTwo)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
-    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcTwo) --> Ejb(deployment-id=JdbcTwo)
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
-    INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@5ddd4e70
-    Apr 17, 2014 2:20:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
-    INFO: Succeeded in installing singleton service
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
-    INFO: OpenWebBeans Container is starting...
-    Apr 17, 2014 2:20:17 PM org.apache.webbeans.plugins.PluginLoader startUp
-    INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
-    Apr 17, 2014 2:20:17 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
-    INFO: All injection points were validated successfully.
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
-    INFO: OpenWebBeans Container has started, it took 223 ms.
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
-    INFO: Created Ejb(deployment-id=JdbcTwo, ejb-name=JdbcTwo, container=Default Singleton Container)
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
-    INFO: Created Ejb(deployment-id=JdbcOne, ejb-name=JdbcOne, container=Default Singleton Container)
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
-    INFO: Started Ejb(deployment-id=JdbcTwo, ejb-name=JdbcTwo, container=Default Singleton Container)
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
-    INFO: Started Ejb(deployment-id=JdbcOne, ejb-name=JdbcOne, container=Default Singleton Container)
-    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler createApplication
-    INFO: Deployed Application(path=C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest)
-    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyApplication
-    INFO: Undeploying app: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
-    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyResource
-    INFO: Closing DataSource: JdbcTwo
-    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyResource
-    INFO: Closing DataSource: JdbcOne
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.857 sec
-    INFO - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
-    INFO - Pausing ProtocolHandler ["http-bio-55243"]
-    INFO - Pausing ProtocolHandler ["ajp-bio-55245"]
-    INFO - Stopping service Catalina
-    INFO - Stopping ProtocolHandler ["http-bio-55243"]
-    INFO - Stopping ProtocolHandler ["ajp-bio-55245"]
-    INFO - Stopping server services
-    INFO - Undeploying app: openejb
-    INFO - Closing DataSource: DatabaseOne
-    INFO - Closing DataSource: DatabaseTwo
-    INFO - Destroying ProtocolHandler ["http-bio-55243"]
-    INFO - Destroying ProtocolHandler ["ajp-bio-55245"]
-
-    Results :
-
-    Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
+Title: DataSource Versioning
+
+This example shows you how to use versioned DataSources of the same provider using the classpath attribute.
+
+# Configuration
+
+The DataSource configuration can be made several ways and here we layout two common methods in the form of unit tests.
+Before we start, if you take a peek in the project pom.xml and look for the maven-dependency-plugin usage you will see that we pull in
+two completely different driver files for this example.
+
+# AlternateDataSourceTest.java
+This test utilizes the Arquillian testing framework. See [here](http://tomee.apache.org/arquillian-available-adapters.html) for more details.
+
+The example uses src/test/resources/arquillian.xml and src/test/conf/tomee.xml to define the DataSources.
+Note the differing driver version paths, yet still using the same provider (org.apache.derby.jdbc.EmbeddedDriver):
+
+    <tomee>
+
+      <Resource id="DatabaseOne" type="DataSource" classpath="${catalina.base}/../../drivers/derby-10.10.1.1.jar">
+        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
+        JdbcUrl jdbc:derby:databaseOne;create=true
+        UserName SA
+      </Resource>
+
+      <Resource id="DatabaseTwo" type="DataSource" classpath="${catalina.base}/../../drivers/derby-10.9.1.0.jar">
+        JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
+        JdbcUrl jdbc:derby:databaseTwo;create=true
+        UserName SA
+      </Resource>
+
+    </tomee>
+	
+# Developer Information
+When testing within a Maven environment it is also possible to use direct maven coordinates rather than a file link, like so:
+
+    ....
+	<Resource id="DatabaseOne" type="DataSource" classpath="mvn:org.apache.derby:derby:10.10.1.1">
+	....
+	
+
+# AlternateDriverJarTest.java
+
+This test takes an embedded approach and as you can see the driver paths are specified as a DataSource parameter.
+Both examples demonstrate the same, in that two driver versions can be loaded and used within the same application.
+
+    @Configuration
+    public Properties config() {
+
+        final File drivers = new File(new File("target"), "drivers").getAbsoluteFile();
+
+        final Properties p = new Properties();
+        p.put("openejb.jdbc.datasource-creator", "dbcp-alternative");
+
+        File file = new File(drivers, "derby-10.10.1.1.jar");
+        Assert.assertTrue("Failed to find: " + file, file.exists());
+
+        p.put("JdbcOne", "new://Resource?type=DataSource&classpath="
+                + file.getAbsolutePath().replace("\\", "/"));
+        p.put("JdbcOne.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+        p.put("JdbcOne.JdbcUrl", "jdbc:derby:memory:JdbcOne;create=true");
+        p.put("JdbcOne.UserName", USER);
+        p.put("JdbcOne.Password", PASSWORD);
+        p.put("JdbcOne.JtaManaged", "false");
+
+        file = new File(drivers, "derby-10.9.1.0.jar");
+        Assert.assertTrue("Failed to find: " + file, file.exists());
+
+        p.put("JdbcTwo", "new://Resource?type=DataSource&classpath="
+                + file.getAbsolutePath().replace("\\", "/"));
+        p.put("JdbcTwo.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+        p.put("JdbcTwo.JdbcUrl", "jdbc:derby:memory:JdbcTwo;create=true");
+        p.put("JdbcTwo.UserName", USER);
+        p.put("JdbcTwo.Password", PASSWORD);
+        p.put("JdbcTwo.JtaManaged", "false");
+        return p;
+    }
+
+# Full Test Source for AlternateDataSourceTest.java
+
+    package org.superbiz;
+
+    import org.jboss.arquillian.container.test.api.Deployment;
+    import org.jboss.arquillian.junit.Arquillian;
+    import org.jboss.shrinkwrap.api.ShrinkWrap;
+    import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+    import org.jboss.shrinkwrap.api.spec.WebArchive;
+    import org.junit.Assert;
+    import org.junit.Test;
+    import org.junit.runner.RunWith;
+
+    import javax.annotation.Resource;
+    import javax.ejb.EJB;
+    import javax.ejb.Stateless;
+    import javax.sql.DataSource;
+    import java.sql.Connection;
+    import java.sql.DatabaseMetaData;
+    import java.sql.SQLException;
+
+    @RunWith(Arquillian.class)
+    public class AlternateDataSourceTest {
+
+        @Deployment
+        public static WebArchive createDeployment() {
+
+            return ShrinkWrap.create(WebArchive.class, "test.war")
+                .addClasses(DataSourceTester.class)
+                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml");
+            //We are using src/test/conf/tomee.xml, but this also works - .addAsResource(new ClassLoaderAsset("META-INF/resources.xml"), "META-INF/resources.xml");
+            //Or even using a persistence context - .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
+        }
+
+        @EJB
+        private DataSourceTester tester;
+
+        @Test
+        public void testDataSourceOne() throws Exception {
+            Assert.assertEquals("Should be using 10.10.1.1 - (1458268)", "10.10.1.1 - (1458268)", tester.getOne());
+        }
+
+        @Test
+        public void testDataSourceTwo() throws Exception {
+            Assert.assertEquals("Should be using 10.9.1.0 - (1344872)", "10.9.1.0 - (1344872)", tester.getTwo());
+        }
+
+        @Test
+        public void testDataSourceBoth() throws Exception {
+            Assert.assertEquals("Should be using 10.10.1.1 - (1458268)|10.9.1.0 - (1344872)", "10.10.1.1 - (1458268)|10.9.1.0 - (1344872)", tester.getBoth());
+        }
+
+        @Stateless
+        public static class DataSourceTester {
+
+            @Resource(name = "DatabaseOne")
+            DataSource dataSourceOne;
+
+            @Resource(name = "DatabaseTwo")
+            DataSource dataSourceTwo;
+
+            public String getOne() throws Exception {
+                return getVersion(dataSourceOne);
+            }
+
+            public String getTwo() throws Exception {
+                return getVersion(dataSourceTwo);
+            }
+
+            public String getBoth() throws Exception {
+                return getOne() + "|" + getTwo();
+            }
+
+            private static String getVersion(final DataSource ds) throws SQLException {
+                Connection con = null;
+                try {
+                    con = ds.getConnection();
+                    final DatabaseMetaData md = con.getMetaData();
+                    return md.getDriverVersion();
+                } finally {
+                    if (con != null) {
+                        con.close();
+                    }
+                }
+            }
+        }
+    }
+
+# Running
+
+    
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.AlternateDataSourceTest
+    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.Setup findHome
+    INFO: Unable to find home in: C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote
+    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
+    INFO: Downloading org.apache.openejb:apache-tomee:1.6.1-SNAPSHOT:zip:webprofile please wait...
+    Apr 17, 2014 2:19:45 PM org.apache.openejb.arquillian.common.Zips unzip
+    INFO: Extracting 'C:\Users\Andy\.m2\repository\org\apache\openejb\apache-tomee\1.6.1-SNAPSHOT\apache-tomee-1.6.1-SNAPSHOT-webprofile.zip' to 'C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote'
+    Apr 17, 2014 2:19:47 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
+    INFO: Downloaded container to: C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
+    INFO - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_45\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\SlikSvn\bin;C:\dev\apache-maven-3.2.1\bin;C:\dev\apache-ant-1.9.3\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\TortoiseSVN\bin;.
+    INFO - Initializing ProtocolHandler ["http-bio-55243"]
+    INFO - Initializing ProtocolHandler ["ajp-bio-55245"]
+    INFO - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
+    INFO - Optional service not installed: org.apache.tomee.webservices.TomeeJaxRsService
+    INFO - Optional service not installed: org.apache.tomee.webservices.TomeeJaxWsService
+    INFO - ********************************************************************************
+    INFO - OpenEJB http://tomee.apache.org/
+    INFO - Startup: Thu Apr 17 14:19:55 CEST 2014
+    INFO - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFO - Version: 7.0.0-SNAPSHOT
+    INFO - Build date: 20140417
+    INFO - Build time: 01:37
+    INFO - ********************************************************************************
+    INFO - openejb.home = C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
+    INFO - openejb.base = C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT
+    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@22c2e2dd
+    INFO - Succeeded in installing singleton service
+    INFO - openejb configuration file is 'C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT\conf\tomee.xml'
+    INFO - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Configuring Service(id=DatabaseOne, type=Resource, provider-id=Default JDBC Database)
+    INFO - Configuring Service(id=DatabaseTwo, type=Resource, provider-id=Default JDBC Database)
+    INFO - Using 'openejb.system.apps=true'
+    INFO - Configuring enterprise application: openejb
+    INFO - Using openejb.deploymentId.format '{ejbName}'
+    INFO - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
+    INFO - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
+    INFO - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
+    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+    INFO - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
+    INFO - Enterprise application "openejb" loaded.
+    INFO - Creating TransactionManager(id=Default Transaction Manager)
+    INFO - Creating SecurityService(id=Tomcat Security Service)
+    INFO - Creating Resource(id=DatabaseOne)
+    INFO - Disabling testOnBorrow since no validation query is provided
+    INFO - Creating Resource(id=DatabaseTwo)
+    INFO - Disabling testOnBorrow since no validation query is provided
+    INFO - Creating Container(id=Default Stateless Container)
+    INFO - Assembling app: openejb
+    INFO - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
+    INFO - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
+    INFO - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
+    INFO - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
+    INFO - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFO - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFO - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+    INFO - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
+    INFO - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
+    INFO - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
+    INFO - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+    INFO - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+    INFO - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+    INFO - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
+    INFO - Deployed Application(path=openejb)
+    INFO -   ** Bound Services **
+    INFO -   NAME                 IP              PORT
+    INFO - -------
+    INFO - Ready!
+    INFO - Initialization processed in 7959 ms
+    INFO - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
+    INFO - Creating Resource(id=UserDatabase)
+    INFO - Starting service Catalina
+    INFO - Starting Servlet Engine: Apache Tomcat (TomEE)/7.0.53 (1.6.1-SNAPSHOT)
+    INFO - Starting ProtocolHandler ["http-bio-55243"]
+    INFO - Starting ProtocolHandler ["ajp-bio-55245"]
+    INFO - Server startup in 288 ms
+    WARNING - StandardServer.await: Invalid command '' received
+    Apr 17, 2014 2:20:04 PM org.apache.openejb.client.EventLogger log
+    INFO: RemoteInitialContextCreated{providerUri=http://localhost:55243/tomee/ejb}
+    INFO - Extracting jar: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test.war
+    INFO - Extracted path: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
+    INFO - using default host: localhost
+    INFO - ------------------------- localhost -> /test
+    INFO - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
+    INFO - Configuring enterprise application: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
+    INFO - Auto-deploying ejb DataSourceTester: EjbDeployment(deployment-id=DataSourceTester)
+    INFO - Auto-linking resource-ref 'java:comp/env/DatabaseTwo' in bean DataSourceTester to Resource(id=DatabaseTwo)
+    INFO - Auto-linking resource-ref 'java:comp/env/DatabaseOne' in bean DataSourceTester to Resource(id=DatabaseOne)
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean org.superbiz.AlternateDataSourceTest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Creating Container(id=Default Managed Container)
+    INFO - Using directory C:\dev\svn\tomee\examples\datasource-versioning\target\apache-tomee-remote\apache-tomee-webprofile-1.6.1-SNAPSHOT\temp for stateful session passivation
+    INFO - Enterprise application "C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test" loaded.
+    INFO - Assembling app: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
+    INFO - Jndi(name=DataSourceTesterLocalBean) --> Ejb(deployment-id=DataSourceTester)
+    INFO - Jndi(name=global/test/DataSourceTester!org.superbiz.AlternateDataSourceTest$DataSourceTester) --> Ejb(deployment-id=DataSourceTester)
+    INFO - Jndi(name=global/test/DataSourceTester) --> Ejb(deployment-id=DataSourceTester)
+    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@22c2e2dd
+    INFO - OpenWebBeans Container is starting...
+    INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+    INFO - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
+    INFO - All injection points were validated successfully.
+    INFO - OpenWebBeans Container has started, it took 203 ms.
+    INFO - Created Ejb(deployment-id=DataSourceTester, ejb-name=DataSourceTester, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=DataSourceTester, ejb-name=DataSourceTester, container=Default Stateless Container)
+    INFO - Deployed Application(path=C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test)
+    Apr 17, 2014 2:20:11 PM org.apache.openejb.client.EventLogger log
+    INFO: RemoteInitialContextCreated{providerUri=http://localhost:55243/tomee/ejb}
+    INFO - Undeploying app: C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0\test
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
+    INFO: cleaning C:\dev\svn\tomee\examples\datasource-versioning\target\arquillian-test-working-dir\0
+    Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.155 sec
+    Running org.superbiz.AlternateDriverJarTest
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigUtils searchForConfiguration
+    INFO: Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=JdbcTwo, type=Resource, provider-id=Default JDBC Database)
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=JdbcOne, type=Resource, provider-id=Default JDBC Database)
+    Apr 17, 2014 2:20:13 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating TransactionManager(id=Default Transaction Manager)
+    Apr 17, 2014 2:20:14 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating SecurityService(id=Default Security Service)
+    Apr 17, 2014 2:20:14 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating Resource(id=JdbcTwo)
+    Apr 17, 2014 2:20:15 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating Resource(id=JdbcOne)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureApplication
+    INFO: Configuring enterprise application: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig createContainer
+    INFO: Auto-creating a container for bean org.superbiz.AlternateDriverJarTest: Container(type=MANAGED, id=Default Managed Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating Container(id=Default Managed Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.core.managed.SimplePassivater init
+    INFO: Using directory C:\Users\Andy\AppData\Local\Temp for stateful session passivation
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.ConfigurationFactory configureService
+    INFO: Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig createContainer
+    INFO: Auto-creating a container for bean JdbcOne: Container(type=SINGLETON, id=Default Singleton Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createRecipe
+    INFO: Creating Container(id=Default Singleton Container)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig processResourceRef
+    INFO: Auto-linking resource-ref 'java:comp/env/JdbcOne' in bean JdbcOne to Resource(id=JdbcOne)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AutoConfig processResourceRef
+    INFO: Auto-linking resource-ref 'java:comp/env/JdbcTwo' in bean JdbcTwo to Resource(id=JdbcTwo)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.config.AppInfoBuilder build
+    INFO: Enterprise application "C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest" loaded.
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.Assembler createApplication
+    INFO: Assembling app: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=JdbcOneLocalBean) --> Ejb(deployment-id=JdbcOne)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcOne!org.superbiz.AlternateDriverJarTest$JdbcOne) --> Ejb(deployment-id=JdbcOne)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcOne) --> Ejb(deployment-id=JdbcOne)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=JdbcTwoLocalBean) --> Ejb(deployment-id=JdbcTwo)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcTwo!org.superbiz.AlternateDriverJarTest$JdbcTwo) --> Ejb(deployment-id=JdbcTwo)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.assembler.classic.JndiBuilder bind
+    INFO: Jndi(name=global/AlternateDriverJarTest/app/JdbcTwo) --> Ejb(deployment-id=JdbcTwo)
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
+    INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@5ddd4e70
+    Apr 17, 2014 2:20:16 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
+    INFO: Succeeded in installing singleton service
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
+    INFO: OpenWebBeans Container is starting...
+    Apr 17, 2014 2:20:17 PM org.apache.webbeans.plugins.PluginLoader startUp
+    INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
+    Apr 17, 2014 2:20:17 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
+    INFO: All injection points were validated successfully.
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
+    INFO: OpenWebBeans Container has started, it took 223 ms.
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
+    INFO: Created Ejb(deployment-id=JdbcTwo, ejb-name=JdbcTwo, container=Default Singleton Container)
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
+    INFO: Created Ejb(deployment-id=JdbcOne, ejb-name=JdbcOne, container=Default Singleton Container)
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
+    INFO: Started Ejb(deployment-id=JdbcTwo, ejb-name=JdbcTwo, container=Default Singleton Container)
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler startEjbs
+    INFO: Started Ejb(deployment-id=JdbcOne, ejb-name=JdbcOne, container=Default Singleton Container)
+    Apr 17, 2014 2:20:17 PM org.apache.openejb.assembler.classic.Assembler createApplication
+    INFO: Deployed Application(path=C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest)
+    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyApplication
+    INFO: Undeploying app: C:\dev\svn\tomee\examples\datasource-versioning\AlternateDriverJarTest
+    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyResource
+    INFO: Closing DataSource: JdbcTwo
+    Apr 17, 2014 2:20:20 PM org.apache.openejb.assembler.classic.Assembler destroyResource
+    INFO: Closing DataSource: JdbcOne
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.857 sec
+    INFO - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
+    INFO - Pausing ProtocolHandler ["http-bio-55243"]
+    INFO - Pausing ProtocolHandler ["ajp-bio-55245"]
+    INFO - Stopping service Catalina
+    INFO - Stopping ProtocolHandler ["http-bio-55243"]
+    INFO - Stopping ProtocolHandler ["ajp-bio-55245"]
+    INFO - Stopping server services
+    INFO - Undeploying app: openejb
+    INFO - Closing DataSource: DatabaseOne
+    INFO - Closing DataSource: DatabaseTwo
+    INFO - Destroying ProtocolHandler ["http-bio-55243"]
+    INFO - Destroying ProtocolHandler ["ajp-bio-55245"]
+
+    Results :
+
+    Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/datasource-versioning/src/test/java/org/superbiz/AlternateDataSourceTest.java
----------------------------------------------------------------------
diff --git a/examples/datasource-versioning/src/test/java/org/superbiz/AlternateDataSourceTest.java b/examples/datasource-versioning/src/test/java/org/superbiz/AlternateDataSourceTest.java
index 252429e..2aa2386 100644
--- a/examples/datasource-versioning/src/test/java/org/superbiz/AlternateDataSourceTest.java
+++ b/examples/datasource-versioning/src/test/java/org/superbiz/AlternateDataSourceTest.java
@@ -40,8 +40,8 @@ public class AlternateDataSourceTest {
     public static WebArchive createDeployment() {
 
         return ShrinkWrap.create(WebArchive.class, "test.war")
-            .addClasses(DataSourceTester.class)
-            .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml");
+                .addClasses(DataSourceTester.class)
+                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml");
         //We are using src/test/conf/tomee.xml, but this also works - .addAsResource(new ClassLoaderAsset("META-INF/resources.xml"), "META-INF/resources.xml");
         //Or even using a persistence context - .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/main/java/org/superbiz/cdi/decorators/AccessDeniedException.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/AccessDeniedException.java b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/AccessDeniedException.java
index af038e4..ce38e68 100644
--- a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/AccessDeniedException.java
+++ b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/AccessDeniedException.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-import javax.ejb.ApplicationException;
-
-/**
- * @version $Revision$ $Date$
- */
-@ApplicationException
-public class AccessDeniedException extends RuntimeException {
-
-    public AccessDeniedException(String s) {
-        super(s);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+import javax.ejb.ApplicationException;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@ApplicationException
+public class AccessDeniedException extends RuntimeException {
+
+    public AccessDeniedException(String s) {
+        super(s);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/main/java/org/superbiz/cdi/decorators/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/Calculator.java b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/Calculator.java
index 55f368c..dec43bf 100644
--- a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/Calculator.java
+++ b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/Calculator.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-/**
- * @version $Revision$ $Date$
- */
-public interface Calculator {
-
-    public int add(int a, int b);
-
-    public int subtract(int a, int b);
-
-    public int multiply(int a, int b);
-
-    public int divide(int a, int b);
-
-    public int remainder(int a, int b);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface Calculator {
+
+    public int add(int a, int b);
+
+    public int subtract(int a, int b);
+
+    public int multiply(int a, int b);
+
+    public int divide(int a, int b);
+
+    public int remainder(int a, int b);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorBean.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorBean.java b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorBean.java
index af4824c..7d6c6e4 100644
--- a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorBean.java
+++ b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorBean.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class CalculatorBean implements Calculator {
-    public int add(int a, int b) {
-        return a + b;
-    }
-
-    public int subtract(int a, int b) {
-        return a - b;
-    }
-
-    public int multiply(int a, int b) {
-        return a * b;
-    }
-
-    public int divide(int a, int b) {
-        return a / b;
-    }
-
-    public int remainder(int a, int b) {
-        return a % b;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class CalculatorBean implements Calculator {
+    public int add(int a, int b) {
+        return a + b;
+    }
+
+    public int subtract(int a, int b) {
+        return a - b;
+    }
+
+    public int multiply(int a, int b) {
+        return a * b;
+    }
+
+    public int divide(int a, int b) {
+        return a / b;
+    }
+
+    public int remainder(int a, int b) {
+        return a % b;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorLogging.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorLogging.java b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorLogging.java
index 5ed8890..3d21a42 100644
--- a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorLogging.java
+++ b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorLogging.java
@@ -1,60 +1,60 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-import java.util.logging.Logger;
-
-@Decorator
-public class CalculatorLogging implements Calculator {
-
-    private Logger logger = Logger.getLogger("Calculator");
-
-    @Inject
-    @Delegate
-    private Calculator calculator;
-
-    @Override
-    public int add(int a, int b) {
-        logger.fine(String.format("add(%s, %s)", a, b));
-        return calculator.add(a, b);
-    }
-
-    @Override
-    public int subtract(int a, int b) {
-        return calculator.subtract(a, b);
-    }
-
-    @Override
-    public int multiply(int a, int b) {
-        logger.finest(String.format("multiply(%s, %s)", a, b));
-        return calculator.multiply(a, b);
-    }
-
-    @Override
-    public int divide(int a, int b) {
-        return calculator.divide(a, b);
-    }
-
-    @Override
-    public int remainder(int a, int b) {
-        logger.info(String.format("remainder(%s, %s)", a, b));
-        return calculator.remainder(a, b);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+import java.util.logging.Logger;
+
+@Decorator
+public class CalculatorLogging implements Calculator {
+
+    private Logger logger = Logger.getLogger("Calculator");
+
+    @Inject
+    @Delegate
+    private Calculator calculator;
+
+    @Override
+    public int add(int a, int b) {
+        logger.fine(String.format("add(%s, %s)", a, b));
+        return calculator.add(a, b);
+    }
+
+    @Override
+    public int subtract(int a, int b) {
+        return calculator.subtract(a, b);
+    }
+
+    @Override
+    public int multiply(int a, int b) {
+        logger.finest(String.format("multiply(%s, %s)", a, b));
+        return calculator.multiply(a, b);
+    }
+
+    @Override
+    public int divide(int a, int b) {
+        return calculator.divide(a, b);
+    }
+
+    @Override
+    public int remainder(int a, int b) {
+        logger.info(String.format("remainder(%s, %s)", a, b));
+        return calculator.remainder(a, b);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorSecurity.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorSecurity.java b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorSecurity.java
index aee4e25..00409a9 100644
--- a/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorSecurity.java
+++ b/examples/decorators/src/main/java/org/superbiz/cdi/decorators/CalculatorSecurity.java
@@ -1,65 +1,65 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-import javax.annotation.Resource;
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.ejb.SessionContext;
-import javax.inject.Inject;
-
-@Decorator
-public class CalculatorSecurity implements Calculator {
-
-    @Inject
-    @Delegate
-    private Calculator calculator;
-
-    @Resource
-    private SessionContext sessionContext;
-
-    @Override
-    public int add(int a, int b) {
-        return calculator.add(a, b);
-    }
-
-    @Override
-    public int subtract(int a, int b) {
-        // Caller must pass a security check to call subtract
-        if (!sessionContext.isCallerInRole("Manager")) {
-            throw new AccessDeniedException(sessionContext.getCallerPrincipal().getName());
-        }
-
-        return calculator.subtract(a, b);
-    }
-
-    @Override
-    public int multiply(int a, int b) {
-        return calculator.multiply(a, b);
-    }
-
-    @Override
-    public int divide(int a, int b) {
-        return calculator.divide(a, b);
-    }
-
-    @Override
-    public int remainder(int a, int b) {
-        return calculator.remainder(a, b);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+import javax.annotation.Resource;
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.ejb.SessionContext;
+import javax.inject.Inject;
+
+@Decorator
+public class CalculatorSecurity implements Calculator {
+
+    @Inject
+    @Delegate
+    private Calculator calculator;
+
+    @Resource
+    private SessionContext sessionContext;
+
+    @Override
+    public int add(int a, int b) {
+        return calculator.add(a, b);
+    }
+
+    @Override
+    public int subtract(int a, int b) {
+        // Caller must pass a security check to call subtract
+        if (!sessionContext.isCallerInRole("Manager")) {
+            throw new AccessDeniedException(sessionContext.getCallerPrincipal().getName());
+        }
+
+        return calculator.subtract(a, b);
+    }
+
+    @Override
+    public int multiply(int a, int b) {
+        return calculator.multiply(a, b);
+    }
+
+    @Override
+    public int divide(int a, int b) {
+        return calculator.divide(a, b);
+    }
+
+    @Override
+    public int remainder(int a, int b) {
+        return calculator.remainder(a, b);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/decorators/src/test/java/org/superbiz/cdi/decorators/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/decorators/src/test/java/org/superbiz/cdi/decorators/CalculatorTest.java b/examples/decorators/src/test/java/org/superbiz/cdi/decorators/CalculatorTest.java
index 01bdd2e..610969e 100644
--- a/examples/decorators/src/test/java/org/superbiz/cdi/decorators/CalculatorTest.java
+++ b/examples/decorators/src/test/java/org/superbiz/cdi/decorators/CalculatorTest.java
@@ -1,116 +1,116 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.decorators;
-
-import junit.framework.TestCase;
-
-import javax.annotation.security.RunAs;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.embeddable.EJBContainer;
-import java.util.concurrent.Callable;
-
-public class CalculatorTest extends TestCase {
-
-    @EJB
-    private Calculator calculator;
-
-    @EJB
-    private ManagerBean manager;
-
-    /**
-     * Bootstrap the Embedded EJB Container
-     *
-     * @throws Exception
-     */
-    protected void setUp() throws Exception {
-        EJBContainer.createEJBContainer().getContext().bind("inject", this);
-    }
-
-    /**
-     * Test Add method
-     */
-    public void testAdd() {
-
-        assertEquals(10, calculator.add(4, 6));
-
-    }
-
-    /**
-     * Test Subtract method
-     */
-    public void testSubtract() {
-
-        try {
-            calculator.subtract(4, 6);
-
-            fail("AccessDeniedException should have been thrown for unauthenticated access");
-        } catch (AccessDeniedException expected) {
-            // pass
-        }
-
-        final int result = manager.call(new Callable<Integer>() {
-            public Integer call() {
-                return calculator.subtract(4, 6);
-            }
-        });
-
-        assertEquals(-2, result);
-
-    }
-
-    /**
-     * Test Multiply method
-     */
-    public void testMultiply() {
-
-        assertEquals(24, calculator.multiply(4, 6));
-
-    }
-
-    /**
-     * Test Divide method
-     */
-    public void testDivide() {
-
-        assertEquals(2, calculator.divide(12, 6));
-
-    }
-
-    /**
-     * Test Remainder method
-     */
-    public void testRemainder() {
-
-        assertEquals(4, calculator.remainder(46, 6));
-
-    }
-
-    @Stateless
-    @RunAs("Manager")
-    public static class ManagerBean {
-
-        public <V> V call(Callable<V> callable) {
-            try {
-                return callable.call();
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.decorators;
+
+import junit.framework.TestCase;
+
+import javax.annotation.security.RunAs;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.ejb.embeddable.EJBContainer;
+import java.util.concurrent.Callable;
+
+public class CalculatorTest extends TestCase {
+
+    @EJB
+    private Calculator calculator;
+
+    @EJB
+    private ManagerBean manager;
+
+    /**
+     * Bootstrap the Embedded EJB Container
+     *
+     * @throws Exception
+     */
+    protected void setUp() throws Exception {
+        EJBContainer.createEJBContainer().getContext().bind("inject", this);
+    }
+
+    /**
+     * Test Add method
+     */
+    public void testAdd() {
+
+        assertEquals(10, calculator.add(4, 6));
+
+    }
+
+    /**
+     * Test Subtract method
+     */
+    public void testSubtract() {
+
+        try {
+            calculator.subtract(4, 6);
+
+            fail("AccessDeniedException should have been thrown for unauthenticated access");
+        } catch (AccessDeniedException expected) {
+            // pass
+        }
+
+        final int result = manager.call(new Callable<Integer>() {
+            public Integer call() {
+                return calculator.subtract(4, 6);
+            }
+        });
+
+        assertEquals(-2, result);
+
+    }
+
+    /**
+     * Test Multiply method
+     */
+    public void testMultiply() {
+
+        assertEquals(24, calculator.multiply(4, 6));
+
+    }
+
+    /**
+     * Test Divide method
+     */
+    public void testDivide() {
+
+        assertEquals(2, calculator.divide(12, 6));
+
+    }
+
+    /**
+     * Test Remainder method
+     */
+    public void testRemainder() {
+
+        assertEquals(4, calculator.remainder(46, 6));
+
+    }
+
+    @Stateless
+    @RunAs("Manager")
+    public static class ManagerBean {
+
+        public <V> V call(Callable<V> callable) {
+            try {
+                return callable.call();
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/Counter.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/Counter.java b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/Counter.java
index c6d71f2..cb97600 100644
--- a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/Counter.java
+++ b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/Counter.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.config;
-
-import org.apache.deltaspike.core.api.config.ConfigProperty;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class Counter {
-
-    @Inject
-    @ConfigProperty(name = "loop.size")
-    private Integer iterations;
-
-    public int loop() {
-        for (int i = 0; i < iterations; i++) {
-            System.out.println("Iteration #" + i);
-        }
-        return iterations;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.config;
+
+import org.apache.deltaspike.core.api.config.ConfigProperty;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+@ApplicationScoped
+public class Counter {
+
+    @Inject
+    @ConfigProperty(name = "loop.size")
+    private Integer iterations;
+
+    public int loop() {
+        for (int i = 0; i < iterations; i++) {
+            System.out.println("Iteration #" + i);
+        }
+        return iterations;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSource.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSource.java b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSource.java
index 85a912b..5a5dd7c 100644
--- a/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSource.java
+++ b/examples/deltaspike-configproperty/src/main/java/org/superbiz/deltaspike/config/MyConfigSource.java
@@ -1,79 +1,79 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.deltaspike.config;
-
-import org.apache.deltaspike.core.impl.config.BaseConfigSource;
-import org.apache.deltaspike.core.util.PropertyFileUtils;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-public class MyConfigSource extends BaseConfigSource {
-
-    private static final Logger LOGGER = Logger.getLogger(MyConfigSource.class.getName());
-    private static final String MY_CONF_FILE_NAME = "my-app-config.properties";
-
-    private final Properties properties;
-
-    public MyConfigSource() {
-        final Enumeration<URL> in;
-        try {
-            in = Thread.currentThread().getContextClassLoader().getResources(MY_CONF_FILE_NAME);
-        } catch (IOException e) {
-            throw new IllegalArgumentException("can't find " + MY_CONF_FILE_NAME, e);
-        }
-
-        properties = new Properties();
-
-        while (in.hasMoreElements()) {
-            final Properties currentProps = PropertyFileUtils.loadProperties(in.nextElement());
-            for (Map.Entry<Object, Object> key : currentProps.entrySet()) { // some check
-                if (properties.containsKey(key.getKey().toString())) {
-                    LOGGER.warning("found " + key.getKey() + " multiple times, only one value will be available.");
-                }
-            }
-            properties.putAll(currentProps);
-        }
-
-        initOrdinal(401); // before other sources
-    }
-
-    @Override
-    public Map<String, String> getProperties() {
-        return Collections.emptyMap(); // not scannable
-    }
-
-    @Override
-    public String getPropertyValue(String key) {
-        return properties.getProperty(key);
-    }
-
-    @Override
-    public String getConfigName() {
-        return MY_CONF_FILE_NAME;
-    }
-
-    @Override
-    public boolean isScannable() {
-        return false;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.deltaspike.config;
+
+import org.apache.deltaspike.core.impl.config.BaseConfigSource;
+import org.apache.deltaspike.core.util.PropertyFileUtils;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+public class MyConfigSource extends BaseConfigSource {
+
+    private static final Logger LOGGER = Logger.getLogger(MyConfigSource.class.getName());
+    private static final String MY_CONF_FILE_NAME = "my-app-config.properties";
+
+    private final Properties properties;
+
+    public MyConfigSource() {
+        final Enumeration<URL> in;
+        try {
+            in = Thread.currentThread().getContextClassLoader().getResources(MY_CONF_FILE_NAME);
+        } catch (IOException e) {
+            throw new IllegalArgumentException("can't find " + MY_CONF_FILE_NAME, e);
+        }
+
+        properties = new Properties();
+
+        while (in.hasMoreElements()) {
+            final Properties currentProps = PropertyFileUtils.loadProperties(in.nextElement());
+            for (Map.Entry<Object, Object> key : currentProps.entrySet()) { // some check
+                if (properties.containsKey(key.getKey().toString())) {
+                    LOGGER.warning("found " + key.getKey() + " multiple times, only one value will be available.");
+                }
+            }
+            properties.putAll(currentProps);
+        }
+
+        initOrdinal(401); // before other sources
+    }
+
+    @Override
+    public Map<String, String> getProperties() {
+        return Collections.emptyMap(); // not scannable
+    }
+
+    @Override
+    public String getPropertyValue(String key) {
+        return properties.getProperty(key);
+    }
+
+    @Override
+    public String getConfigName() {
+        return MY_CONF_FILE_NAME;
+    }
+
+    @Override
+    public boolean isScannable() {
+        return false;
+    }
+}


[06/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/CalculatorWs.java
----------------------------------------------------------------------
diff --git a/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/CalculatorWs.java b/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/CalculatorWs.java
index d6e633f..b8e37c3 100644
--- a/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/CalculatorWs.java
+++ b/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/CalculatorWs.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.ws;
-
-import javax.jws.WebService;
-
-@WebService(targetNamespace = "http://superbiz.org/wsdl")
-public interface CalculatorWs {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.ws;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://superbiz.org/wsdl")
+public interface CalculatorWs {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java b/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
index 7ea0cce..426c97a 100644
--- a/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
+++ b/examples/simple-webservice/src/test/java/org/superbiz/calculator/ws/CalculatorTest.java
@@ -1,62 +1,62 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.ws;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class CalculatorTest {
-
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-		
-        // properties.setProperty("httpejbd.print", "true");
-        // properties.setProperty("httpejbd.indent.xml", "true");
-        // properties.setProperty("logging.level.OpenEJB.server.http", "FINE");
-        EJBContainer.createEJBContainer(properties);
-    }
-
-    @Test
-    public void test() throws Exception {
-        Service calculatorService = Service.create(
-                                                      new URL("http://localhost:" + port + "/simple-webservice/Calculator?wsdl"),
-                                                      new QName("http://superbiz.org/wsdl", "CalculatorService"));
-
-        assertNotNull(calculatorService);
-
-        CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
-        assertEquals(10, calculator.sum(4, 6));
-        assertEquals(12, calculator.multiply(3, 4));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.ws;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class CalculatorTest {
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        // properties.setProperty("httpejbd.print", "true");
+        // properties.setProperty("httpejbd.indent.xml", "true");
+        // properties.setProperty("logging.level.OpenEJB.server.http", "FINE");
+        EJBContainer.createEJBContainer(properties);
+    }
+
+    @Test
+    public void test() throws Exception {
+        Service calculatorService = Service.create(
+                new URL("http://localhost:" + port + "/simple-webservice/Calculator?wsdl"),
+                new QName("http://superbiz.org/wsdl", "CalculatorService"));
+
+        assertNotNull(calculatorService);
+
+        CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
+        assertEquals(10, calculator.sum(4, 6));
+        assertEquals(12, calculator.multiply(3, 4));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/Metatype.java
----------------------------------------------------------------------
diff --git a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/Metatype.java b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/Metatype.java
index 6a8fead..d4c61a8 100644
--- a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/Metatype.java
+++ b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/Metatype.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamic.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Metatype {
-
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamic.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Metatype {
+
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/SpringRepository.java
----------------------------------------------------------------------
diff --git a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/SpringRepository.java b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/SpringRepository.java
index 9f905f6..2b2d26d 100644
--- a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/SpringRepository.java
+++ b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/api/SpringRepository.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamic.api;
-
-import org.apache.openejb.api.Proxy;
-import org.superbiz.dynamic.framework.SpringDataProxy;
-
-import javax.ejb.Stateless;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Stateless
-@Proxy(SpringDataProxy.class)
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface SpringRepository {
-
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamic.api;
+
+import org.apache.openejb.api.Proxy;
+import org.superbiz.dynamic.framework.SpringDataProxy;
+
+import javax.ejb.Stateless;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Stateless
+@Proxy(SpringDataProxy.class)
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SpringRepository {
+
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/framework/SpringDataProxy.java
----------------------------------------------------------------------
diff --git a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/framework/SpringDataProxy.java b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/framework/SpringDataProxy.java
index 16f6c6d..662c95e 100644
--- a/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/framework/SpringDataProxy.java
+++ b/examples/spring-data-proxy-meta/src/main/java/org/superbiz/dynamic/framework/SpringDataProxy.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamic.framework;
-
-import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
-import org.springframework.data.repository.Repository;
-
-import javax.annotation.Resource;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class SpringDataProxy implements InvocationHandler {
-
-    @PersistenceContext(unitName = "dynamic")
-    private EntityManager em;
-
-    @Resource(name = "implementingInterfaceClass")
-    private Class<Repository<?, ?>> implementingInterfaceClass; // implicitly for this kind of proxy
-
-    private final AtomicReference<Repository<?, ?>> repository = new AtomicReference<Repository<?, ?>>();
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        if (repository.get() == null) {
-            synchronized (this) {
-                if (repository.get() == null) {
-                    repository.set(new JpaRepositoryFactory(em).getRepository(implementingInterfaceClass));
-                }
-            }
-        }
-        return method.invoke(repository.get(), args);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamic.framework;
+
+import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
+import org.springframework.data.repository.Repository;
+
+import javax.annotation.Resource;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class SpringDataProxy implements InvocationHandler {
+
+    @PersistenceContext(unitName = "dynamic")
+    private EntityManager em;
+
+    @Resource(name = "implementingInterfaceClass")
+    private Class<Repository<?, ?>> implementingInterfaceClass; // implicitly for this kind of proxy
+
+    private final AtomicReference<Repository<?, ?>> repository = new AtomicReference<Repository<?, ?>>();
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        if (repository.get() == null) {
+            synchronized (this) {
+                if (repository.get() == null) {
+                    repository.set(new JpaRepositoryFactory(em).getRepository(implementingInterfaceClass));
+                }
+            }
+        }
+        return method.invoke(repository.get(), args);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/spring-data-proxy/src/main/java/org/superbiz/dynamic/SpringDataProxy.java
----------------------------------------------------------------------
diff --git a/examples/spring-data-proxy/src/main/java/org/superbiz/dynamic/SpringDataProxy.java b/examples/spring-data-proxy/src/main/java/org/superbiz/dynamic/SpringDataProxy.java
index 2704223..c36abf0 100644
--- a/examples/spring-data-proxy/src/main/java/org/superbiz/dynamic/SpringDataProxy.java
+++ b/examples/spring-data-proxy/src/main/java/org/superbiz/dynamic/SpringDataProxy.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.dynamic;
-
-import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
-import org.springframework.data.repository.Repository;
-
-import javax.annotation.Resource;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class SpringDataProxy implements InvocationHandler {
-
-    @PersistenceContext
-    private EntityManager em;
-
-    @Resource(name = "implementingInterfaceClass")
-    private Class<Repository<?, ?>> implementingInterfaceClass; // implicitly for this kind of proxy
-
-    private final AtomicReference<Repository<?, ?>> repository = new AtomicReference<Repository<?, ?>>();
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        if (repository.get() == null) {
-            synchronized (this) {
-                if (repository.get() == null) {
-                    repository.set(new JpaRepositoryFactory(em).getRepository(implementingInterfaceClass));
-                }
-            }
-        }
-        return method.invoke(repository.get(), args);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.dynamic;
+
+import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
+import org.springframework.data.repository.Repository;
+
+import javax.annotation.Resource;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class SpringDataProxy implements InvocationHandler {
+
+    @PersistenceContext
+    private EntityManager em;
+
+    @Resource(name = "implementingInterfaceClass")
+    private Class<Repository<?, ?>> implementingInterfaceClass; // implicitly for this kind of proxy
+
+    private final AtomicReference<Repository<?, ?>> repository = new AtomicReference<Repository<?, ?>>();
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        if (repository.get() == null) {
+            synchronized (this) {
+                if (repository.get() == null) {
+                    repository.set(new JpaRepositoryFactory(em).getRepository(implementingInterfaceClass));
+                }
+            }
+        }
+        return method.invoke(repository.get(), args);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/struts/src/main/java/org/superbiz/struts/AddUser.java
----------------------------------------------------------------------
diff --git a/examples/struts/src/main/java/org/superbiz/struts/AddUser.java b/examples/struts/src/main/java/org/superbiz/struts/AddUser.java
index 034feac..3fdef15 100644
--- a/examples/struts/src/main/java/org/superbiz/struts/AddUser.java
+++ b/examples/struts/src/main/java/org/superbiz/struts/AddUser.java
@@ -1,80 +1,80 @@
-/*
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-*/
-package org.superbiz.struts;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-public class AddUser {
-
-    private int id;
-    private String firstName;
-    private String lastName;
-    private String errorMessage;
-
-    public String getFirstName() {
-        return firstName;
-    }
-
-    public void setFirstName(String firstName) {
-        this.firstName = firstName;
-    }
-
-    public String getLastName() {
-        return lastName;
-    }
-
-    public void setLastName(String lastName) {
-        this.lastName = lastName;
-    }
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-    public void setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String execute() {
-
-        try {
-            UserService service = null;
-            Properties props = new Properties();
-            props.put(Context.INITIAL_CONTEXT_FACTORY,
-                      "org.apache.openejb.core.LocalInitialContextFactory");
-            Context ctx = new InitialContext(props);
-            service = (UserService) ctx.lookup("UserServiceImplLocal");
-            service.add(new User(id, firstName, lastName));
-        } catch (Exception e) {
-            this.errorMessage = e.getMessage();
-            return "failure";
-        }
-
-        return "success";
-    }
-}
+/*
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+package org.superbiz.struts;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+public class AddUser {
+
+    private int id;
+    private String firstName;
+    private String lastName;
+    private String errorMessage;
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String execute() {
+
+        try {
+            UserService service = null;
+            Properties props = new Properties();
+            props.put(Context.INITIAL_CONTEXT_FACTORY,
+                    "org.apache.openejb.core.LocalInitialContextFactory");
+            Context ctx = new InitialContext(props);
+            service = (UserService) ctx.lookup("UserServiceImplLocal");
+            service.add(new User(id, firstName, lastName));
+        } catch (Exception e) {
+            this.errorMessage = e.getMessage();
+            return "failure";
+        }
+
+        return "success";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/struts/src/main/java/org/superbiz/struts/FindUser.java
----------------------------------------------------------------------
diff --git a/examples/struts/src/main/java/org/superbiz/struts/FindUser.java b/examples/struts/src/main/java/org/superbiz/struts/FindUser.java
index 2344da9..b46a722 100644
--- a/examples/struts/src/main/java/org/superbiz/struts/FindUser.java
+++ b/examples/struts/src/main/java/org/superbiz/struts/FindUser.java
@@ -1,71 +1,71 @@
-/*
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-package org.superbiz.struts;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-public class FindUser {
-
-    private int id;
-    private String errorMessage;
-    private User user;
-
-    public User getUser() {
-        return user;
-    }
-
-    public void setUser(User user) {
-        this.user = user;
-    }
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-    public void setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String execute() {
-
-        try {
-            UserService service = null;
-            Properties props = new Properties();
-            props.put(Context.INITIAL_CONTEXT_FACTORY,
-                      "org.apache.openejb.core.LocalInitialContextFactory");
-            Context ctx = new InitialContext(props);
-            service = (UserService) ctx.lookup("UserServiceImplLocal");
-            this.user = service.find(id);
-        } catch (Exception e) {
-            this.errorMessage = e.getMessage();
-            return "failure";
-        }
-
-        return "success";
-    }
-}
+/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+package org.superbiz.struts;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+public class FindUser {
+
+    private int id;
+    private String errorMessage;
+    private User user;
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String execute() {
+
+        try {
+            UserService service = null;
+            Properties props = new Properties();
+            props.put(Context.INITIAL_CONTEXT_FACTORY,
+                    "org.apache.openejb.core.LocalInitialContextFactory");
+            Context ctx = new InitialContext(props);
+            service = (UserService) ctx.lookup("UserServiceImplLocal");
+            this.user = service.find(id);
+        } catch (Exception e) {
+            this.errorMessage = e.getMessage();
+            return "failure";
+        }
+
+        return "success";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/struts/src/main/java/org/superbiz/struts/ListAllUsers.java
----------------------------------------------------------------------
diff --git a/examples/struts/src/main/java/org/superbiz/struts/ListAllUsers.java b/examples/struts/src/main/java/org/superbiz/struts/ListAllUsers.java
index 2c4d447..98ecd2e 100644
--- a/examples/struts/src/main/java/org/superbiz/struts/ListAllUsers.java
+++ b/examples/struts/src/main/java/org/superbiz/struts/ListAllUsers.java
@@ -1,72 +1,72 @@
-/*
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-package org.superbiz.struts;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.List;
-import java.util.Properties;
-
-public class ListAllUsers {
-
-    private int id;
-    private String errorMessage;
-    private List<User> users;
-
-    public List<User> getUsers() {
-        return users;
-    }
-
-    public void setUsers(List<User> users) {
-        this.users = users;
-    }
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-    public void setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String execute() {
-
-        try {
-            UserService service = null;
-            Properties props = new Properties();
-            props.put(Context.INITIAL_CONTEXT_FACTORY,
-                      "org.apache.openejb.core.LocalInitialContextFactory");
-            Context ctx = new InitialContext(props);
-            service = (UserService) ctx.lookup("UserServiceImplLocal");
-            this.users = service.findAll();
-        } catch (Exception e) {
-            this.errorMessage = e.getMessage();
-            return "failure";
-        }
-
-        return "success";
-    }
-}
+/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+package org.superbiz.struts;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.List;
+import java.util.Properties;
+
+public class ListAllUsers {
+
+    private int id;
+    private String errorMessage;
+    private List<User> users;
+
+    public List<User> getUsers() {
+        return users;
+    }
+
+    public void setUsers(List<User> users) {
+        this.users = users;
+    }
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String execute() {
+
+        try {
+            UserService service = null;
+            Properties props = new Properties();
+            props.put(Context.INITIAL_CONTEXT_FACTORY,
+                    "org.apache.openejb.core.LocalInitialContextFactory");
+            Context ctx = new InitialContext(props);
+            service = (UserService) ctx.lookup("UserServiceImplLocal");
+            this.users = service.findAll();
+        } catch (Exception e) {
+            this.errorMessage = e.getMessage();
+            return "failure";
+        }
+
+        return "success";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/telephone-stateful/src/main/java/org/superbiz/telephone/Telephone.java
----------------------------------------------------------------------
diff --git a/examples/telephone-stateful/src/main/java/org/superbiz/telephone/Telephone.java b/examples/telephone-stateful/src/main/java/org/superbiz/telephone/Telephone.java
index cff3f9b..41fbd49 100644
--- a/examples/telephone-stateful/src/main/java/org/superbiz/telephone/Telephone.java
+++ b/examples/telephone-stateful/src/main/java/org/superbiz/telephone/Telephone.java
@@ -1,26 +1,26 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.telephone;
-
-public interface Telephone {
-
-    void speak(String words);
-
-    String listen();
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.telephone;
+
+public interface Telephone {
+
+    void speak(String words);
+
+    String listen();
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/telephone-stateful/src/main/java/org/superbiz/telephone/TelephoneBean.java
----------------------------------------------------------------------
diff --git a/examples/telephone-stateful/src/main/java/org/superbiz/telephone/TelephoneBean.java b/examples/telephone-stateful/src/main/java/org/superbiz/telephone/TelephoneBean.java
index ae466ac..c9ae5da 100644
--- a/examples/telephone-stateful/src/main/java/org/superbiz/telephone/TelephoneBean.java
+++ b/examples/telephone-stateful/src/main/java/org/superbiz/telephone/TelephoneBean.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.telephone;
-
-import javax.ejb.Remote;
-import javax.ejb.Stateful;
-import java.util.ArrayList;
-import java.util.List;
-
-@Remote
-@Stateful
-public class TelephoneBean implements Telephone {
-
-    private static final String[] answers = {
-                                                "How nice.",
-                                                "Oh, of course.",
-                                                "Interesting.",
-                                                "Really?",
-                                                "No.",
-                                                "Definitely.",
-                                                "I wondered about that.",
-                                                "Good idea.",
-                                                "You don't say!",
-    };
-
-    private final List<String> conversation = new ArrayList<String>();
-
-    @Override
-    public void speak(final String words) {
-        conversation.add(words);
-    }
-
-    @Override
-    public String listen() {
-        if (conversation.size() == 0) {
-            return "Nothing has been said";
-        }
-
-        final String lastThingSaid = conversation.get(conversation.size() - 1);
-        return answers[Math.abs(lastThingSaid.hashCode()) % answers.length];
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.telephone;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+import java.util.ArrayList;
+import java.util.List;
+
+@Remote
+@Stateful
+public class TelephoneBean implements Telephone {
+
+    private static final String[] answers = {
+            "How nice.",
+            "Oh, of course.",
+            "Interesting.",
+            "Really?",
+            "No.",
+            "Definitely.",
+            "I wondered about that.",
+            "Good idea.",
+            "You don't say!",
+    };
+
+    private final List<String> conversation = new ArrayList<String>();
+
+    @Override
+    public void speak(final String words) {
+        conversation.add(words);
+    }
+
+    @Override
+    public String listen() {
+        if (conversation.size() == 0) {
+            return "Nothing has been said";
+        }
+
+        final String lastThingSaid = conversation.get(conversation.size() - 1);
+        return answers[Math.abs(lastThingSaid.hashCode()) % answers.length];
+    }
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
----------------------------------------------------------------------
diff --git a/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java b/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
index 474003f..740467b 100644
--- a/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
+++ b/examples/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
@@ -1,115 +1,115 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.telephone;
-
-import junit.framework.TestCase;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TelephoneTest extends TestCase {
-
-    //START SNIPPET: setup
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("ejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    @Override
-    protected void setUp() throws Exception {
-        final Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("ejbd.port", "" + port);
-		
-        // Uncomment these properties to change the defaults
-        //properties.setProperty("ejbd.bind", "localhost");
-        //properties.setProperty("ejbd.threads", "200");
-        //properties.setProperty("ejbd.disabled", "false");
-        //properties.setProperty("ejbd.only_from", "127.0.0.1,192.168.1.1");
-
-        new InitialContext(properties);
-    }
-    //END SNIPPET: setup
-
-    /**
-     * Lookup the Telephone bean via its remote interface but using the LocalInitialContextFactory
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: localcontext
-    public void testTalkOverLocalNetwork() throws Exception {
-
-        final Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        final InitialContext localContext = new InitialContext(properties);
-
-        final Telephone telephone = (Telephone) localContext.lookup("TelephoneBeanRemote");
-
-        telephone.speak("Did you know I am talking directly through the embedded container?");
-
-        assertEquals("Interesting.", telephone.listen());
-
-        telephone.speak("Yep, I'm using the bean's remote interface but since the ejb container is embedded " +
-                        "in the same vm I'm just using the LocalInitialContextFactory.");
-
-        assertEquals("Really?", telephone.listen());
-
-        telephone.speak("Right, you really only have to use the RemoteInitialContextFactory if you're in a different vm.");
-
-        assertEquals("Oh, of course.", telephone.listen());
-    }
-    //END SNIPPET: localcontext
-
-    /**
-     * Lookup the Telephone bean via its remote interface using the RemoteInitialContextFactory
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: remotecontext
-    public void testTalkOverRemoteNetwork() throws Exception {
-        final Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-        properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:" + port);
-        final InitialContext remoteContext = new InitialContext(properties);
-
-        final Telephone telephone = (Telephone) remoteContext.lookup("TelephoneBeanRemote");
-
-        telephone.speak("Is this a local call?");
-
-        assertEquals("No.", telephone.listen());
-
-        telephone.speak("This would be a lot cooler if I was connecting from another VM then, huh?");
-
-        assertEquals("I wondered about that.", telephone.listen());
-
-        telephone.speak("I suppose I should hangup and call back over the LocalInitialContextFactory.");
-
-        assertEquals("Good idea.", telephone.listen());
-
-        telephone.speak("I'll remember this though in case I ever have to call you accross a network.");
-
-        assertEquals("Definitely.", telephone.listen());
-    }
-    //END SNIPPET: remotecontext
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.telephone;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TelephoneTest extends TestCase {
+
+    //START SNIPPET: setup
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("ejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @Override
+    protected void setUp() throws Exception {
+        final Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("ejbd.port", "" + port);
+
+        // Uncomment these properties to change the defaults
+        //properties.setProperty("ejbd.bind", "localhost");
+        //properties.setProperty("ejbd.threads", "200");
+        //properties.setProperty("ejbd.disabled", "false");
+        //properties.setProperty("ejbd.only_from", "127.0.0.1,192.168.1.1");
+
+        new InitialContext(properties);
+    }
+    //END SNIPPET: setup
+
+    /**
+     * Lookup the Telephone bean via its remote interface but using the LocalInitialContextFactory
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: localcontext
+    public void testTalkOverLocalNetwork() throws Exception {
+
+        final Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        final InitialContext localContext = new InitialContext(properties);
+
+        final Telephone telephone = (Telephone) localContext.lookup("TelephoneBeanRemote");
+
+        telephone.speak("Did you know I am talking directly through the embedded container?");
+
+        assertEquals("Interesting.", telephone.listen());
+
+        telephone.speak("Yep, I'm using the bean's remote interface but since the ejb container is embedded " +
+                "in the same vm I'm just using the LocalInitialContextFactory.");
+
+        assertEquals("Really?", telephone.listen());
+
+        telephone.speak("Right, you really only have to use the RemoteInitialContextFactory if you're in a different vm.");
+
+        assertEquals("Oh, of course.", telephone.listen());
+    }
+    //END SNIPPET: localcontext
+
+    /**
+     * Lookup the Telephone bean via its remote interface using the RemoteInitialContextFactory
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: remotecontext
+    public void testTalkOverRemoteNetwork() throws Exception {
+        final Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+        properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:" + port);
+        final InitialContext remoteContext = new InitialContext(properties);
+
+        final Telephone telephone = (Telephone) remoteContext.lookup("TelephoneBeanRemote");
+
+        telephone.speak("Is this a local call?");
+
+        assertEquals("No.", telephone.listen());
+
+        telephone.speak("This would be a lot cooler if I was connecting from another VM then, huh?");
+
+        assertEquals("I wondered about that.", telephone.listen());
+
+        telephone.speak("I suppose I should hangup and call back over the LocalInitialContextFactory.");
+
+        assertEquals("Good idea.", telephone.listen());
+
+        telephone.speak("I'll remember this though in case I ever have to call you accross a network.");
+
+        assertEquals("Definitely.", telephone.listen());
+    }
+    //END SNIPPET: remotecontext
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movie.java b/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movie.java
index d51142a..9f4d4a7 100644
--- a/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movie.java
+++ b/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.testinjection;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.testinjection;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movies.java b/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movies.java
index 58fd742..dbab1b7 100644
--- a/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movies.java
+++ b/examples/testcase-injection/src/main/java/org/superbiz/testinjection/Movies.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.testinjection;
-
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-import static javax.ejb.TransactionAttributeType.MANDATORY;
-
-//START SNIPPET: code
-@Stateful
-@TransactionAttribute(MANDATORY)
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.testinjection;
+
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+
+//START SNIPPET: code
+@Stateful
+@TransactionAttribute(MANDATORY)
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testcase-injection/src/test/java/org/superbiz/testinjection/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/testcase-injection/src/test/java/org/superbiz/testinjection/MoviesTest.java b/examples/testcase-injection/src/test/java/org/superbiz/testinjection/MoviesTest.java
index 728229b..d02389d 100644
--- a/examples/testcase-injection/src/test/java/org/superbiz/testinjection/MoviesTest.java
+++ b/examples/testcase-injection/src/test/java/org/superbiz/testinjection/MoviesTest.java
@@ -1,75 +1,75 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.testinjection;
-
-import junit.framework.TestCase;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.transaction.UserTransaction;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    @EJB
-    private Movies movies;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
-    }
-
-    public void test() throws Exception {
-
-        userTransaction.begin();
-
-        try {
-            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
-            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-
-        } finally {
-            userTransaction.commit();
-        }
-
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.testinjection;
+
+import junit.framework.TestCase;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.UserTransaction;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    @EJB
+    private Movies movies;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer.createEJBContainer(p).getContext().bind("inject", this);
+    }
+
+    public void test() throws Exception {
+
+        userTransaction.begin();
+
+        try {
+            entityManager.persist(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            entityManager.persist(new Movie("Joel Coen", "Fargo", 1996));
+            entityManager.persist(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+        } finally {
+            userTransaction.commit();
+        }
+
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movie.java b/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movie.java
index b5df45c..73fdf33 100644
--- a/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movie.java
+++ b/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movies.java b/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movies.java
index b3ba8e8..100598b 100644
--- a/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movies.java
+++ b/examples/testing-security-2/src/main/java/org/superbiz/injection/secure/Movies.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-//START SNIPPET: code
-
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    @RolesAllowed({"Employee", "Manager"})
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @RolesAllowed({"Manager"})
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @PermitAll
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+//START SNIPPET: code
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    @RolesAllowed({"Employee", "Manager"})
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @RolesAllowed({"Manager"})
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @PermitAll
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code


[27/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-realm/src/main/java/org/superbiz/SecuredServlet.java
----------------------------------------------------------------------
diff --git a/examples/cdi-realm/src/main/java/org/superbiz/SecuredServlet.java b/examples/cdi-realm/src/main/java/org/superbiz/SecuredServlet.java
index 884db32..ec1a18f 100644
--- a/examples/cdi-realm/src/main/java/org/superbiz/SecuredServlet.java
+++ b/examples/cdi-realm/src/main/java/org/superbiz/SecuredServlet.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-@WebServlet("/servlet")
-public class SecuredServlet extends HttpServlet {
-    @Override
-    protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
-        resp.getWriter().write("Servlet!");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet("/servlet")
+public class SecuredServlet extends HttpServlet {
+    @Override
+    protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+        resp.getWriter().write("Servlet!");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java b/examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java
index d89d691..9f22037 100644
--- a/examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java
+++ b/examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java
@@ -1,102 +1,102 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import org.apache.http.HttpHost;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.AuthCache;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.impl.auth.BasicScheme;
-import org.apache.http.impl.client.BasicAuthCache;
-import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.apache.openejb.arquillian.common.IO;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.asset.FileAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
-@RunWith(Arquillian.class)
-public class AuthBeanTest {
-    @Deployment(testable = false)
-    public static WebArchive createDeployment() {
-        return ShrinkWrap.create(WebArchive.class, "low-typed-realm.war")
-                .addClasses(SecuredServlet.class, AuthBean.class)
-                .addAsManifestResource(new FileAsset(new File("src/main/webapp/META-INF/context.xml")), "context.xml")
-                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
-    }
-
-    @ArquillianResource
-    private URL webapp;
-
-    @Test
-    public void success() throws IOException {
-        assertEquals("200 Servlet!", get("userA", "test"));
-    }
-
-    @Test
-    public void failure() throws IOException {
-        assertThat(get("userA", "oops, wrong password"), startsWith("401"));
-    }
-
-    private String get(final String user, final String password) {
-        final BasicCredentialsProvider basicCredentialsProvider = new BasicCredentialsProvider();
-        basicCredentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
-        final CloseableHttpClient client = HttpClients.custom()
-                .setDefaultCredentialsProvider(basicCredentialsProvider).build();
-
-        final HttpHost httpHost = new HttpHost(webapp.getHost(), webapp.getPort(), webapp.getProtocol());
-        final AuthCache authCache = new BasicAuthCache();
-        final BasicScheme basicAuth = new BasicScheme();
-        authCache.put(httpHost, basicAuth);
-        final HttpClientContext context = HttpClientContext.create();
-        context.setAuthCache(authCache);
-
-        final HttpGet get = new HttpGet(webapp.toExternalForm() + "servlet");
-        CloseableHttpResponse response = null;
-        try {
-            response = client.execute(httpHost, get, context);
-            return response.getStatusLine().getStatusCode() + " " + EntityUtils.toString(response.getEntity());
-        } catch (final IOException e) {
-            throw new IllegalStateException(e);
-        } finally {
-            try {
-                IO.close(response);
-            } catch (final IOException e) {
-                // no-op
-            }
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.AuthCache;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.impl.auth.BasicScheme;
+import org.apache.http.impl.client.BasicAuthCache;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.apache.openejb.arquillian.common.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import static org.hamcrest.CoreMatchers.startsWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+@RunWith(Arquillian.class)
+public class AuthBeanTest {
+    @Deployment(testable = false)
+    public static WebArchive createDeployment() {
+        return ShrinkWrap.create(WebArchive.class, "low-typed-realm.war")
+                .addClasses(SecuredServlet.class, AuthBean.class)
+                .addAsManifestResource(new FileAsset(new File("src/main/webapp/META-INF/context.xml")), "context.xml")
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+    }
+
+    @ArquillianResource
+    private URL webapp;
+
+    @Test
+    public void success() throws IOException {
+        assertEquals("200 Servlet!", get("userA", "test"));
+    }
+
+    @Test
+    public void failure() throws IOException {
+        assertThat(get("userA", "oops, wrong password"), startsWith("401"));
+    }
+
+    private String get(final String user, final String password) {
+        final BasicCredentialsProvider basicCredentialsProvider = new BasicCredentialsProvider();
+        basicCredentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
+        final CloseableHttpClient client = HttpClients.custom()
+                .setDefaultCredentialsProvider(basicCredentialsProvider).build();
+
+        final HttpHost httpHost = new HttpHost(webapp.getHost(), webapp.getPort(), webapp.getProtocol());
+        final AuthCache authCache = new BasicAuthCache();
+        final BasicScheme basicAuth = new BasicScheme();
+        authCache.put(httpHost, basicAuth);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAuthCache(authCache);
+
+        final HttpGet get = new HttpGet(webapp.toExternalForm() + "servlet");
+        CloseableHttpResponse response = null;
+        try {
+            response = client.execute(httpHost, get, context);
+            return response.getStatusLine().getStatusCode() + " " + EntityUtils.toString(response.getEntity());
+        } catch (final IOException e) {
+            throw new IllegalStateException(e);
+        } finally {
+            try {
+                IO.close(response);
+            } catch (final IOException e) {
+                // no-op
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-request-scope/README.md
----------------------------------------------------------------------
diff --git a/examples/cdi-request-scope/README.md b/examples/cdi-request-scope/README.md
index 12bcef9..4658c45 100644
--- a/examples/cdi-request-scope/README.md
+++ b/examples/cdi-request-scope/README.md
@@ -1,150 +1,150 @@
-Title: CDI @RequestScoped
-
-This example show the use of `@RequestScoped` annotation for injected objects. An object
-which is defined as `@RequestScoped` is created once for every request and is shared by all the
-bean that inject it throughout a request.
-
-# Example
-
-This example depicts a similar scenario to cdi-application-scope. A restaurant guest orders
-a soup from the waiter. The order is passed to the chef who prepares it and passes it back
-the waiter who in turn delivers it to the guest.
-
-## Waiter
-
-The `Waiter` session bean receives a request from the test class via the `orderSoup()` method.
-A `Soup` insance will be created in this method and will be shared throughout the request with
-the `Chef` bean. The method passes the request to the `Chef` bean. It then returns the name of
-the soup to the test class. 
-
-    @Stateless
-    public class Waiter {
-
-        @Inject
-        private Soup soup;
-
-        @EJB
-        private Chef chef;
-
-        public String orderSoup(String name){
-            soup.setName(name);
-            return chef.prepareSoup().getName();
-        }
-    }
-
-## Soup
-
-The `Soup` class is an injectable POJO, defined as `@RequestScoped`. This means that an instance
-will be created only once for every request and will be shared by all the beans injecting it.
-
-    @RequestScoped
-    public class Soup {
-
-        private String name = "Soup of the day";
-
-        @PostConstruct
-        public void afterCreate() {
-            System.out.println("Soup created");
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name){
-            this.name = name;
-        }
-    }
-
-## Chef
-
-The `Chef` class is a simple session bean with an injected `Soup` field. Normally, the soup
-parameter would be passed as a `prepareSoup()` argument, but for the need of this example
-it's passed by the request context. 
-
-    @Stateless
-    public class Chef {
-
-        @Inject
-        private Soup soup;
-
-        public Soup prepareSoup() {
-            return soup;
-        }
-    }
-
-# Test Case
-
-This is the entry class for this example.
-
-    public class RestaurantTest {
-
-        private static String TOMATO_SOUP = "Tomato Soup";
-        private EJBContainer container;
-
-        @EJB
-        private Waiter joe;
-
-        @Before
-        public void startContainer() throws Exception {
-            container = EJBContainer.createEJBContainer();
-            container.getContext().bind("inject", this);
-        }
-
-        @Test
-        public void orderSoup(){
-            String soup = joe.orderSoup(TOMATO_SOUP);
-            assertEquals(TOMATO_SOUP, soup);
-            soup = joe.orderSoup(POTATO_SOUP);
-            assertEquals(POTATO_SOUP, soup);
-        }
-
-        @After
-        public void closeContainer() throws Exception {
-            container.close();
-        }
-    }
-
-# Running
-
-In the output you can see that there were two `Soup` instances created - one for
-each request.
-
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.cdi.requestscope.RestaurantTest
-    Apache OpenEJB 4.0.0-beta-2-SNAPSHOT    build: 20111224-11:09
-    http://tomee.apache.org/
-    INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-    INFO - openejb.base = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Found EjbModule in classpath: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope\target\classes
-    INFO - Beginning load: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope\target\classes
-    INFO - Configuring enterprise application: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean cdi-request-scope.Comp: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
-    INFO - Auto-creating a container for bean Chef: Container(type=STATELESS, id=Default Stateless Container)
-    INFO - Enterprise application "c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope" loaded.
-    INFO - Assembling app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-    INFO - Jndi(name="java:global/cdi-request-scope/Chef!org.superbiz.cdi.requestscope.Chef")
-    INFO - Jndi(name="java:global/cdi-request-scope/Chef")
-    INFO - Jndi(name="java:global/cdi-request-scope/Waiter!org.superbiz.cdi.requestscope.Waiter")
-    INFO - Jndi(name="java:global/cdi-request-scope/Waiter")
-    INFO - Created Ejb(deployment-id=Chef, ejb-name=Chef, container=Default Stateless Container)
-    INFO - Created Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=Chef, ejb-name=Chef, container=Default Stateless Container)
-    INFO - Started Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
-    INFO - Deployed Application(path=c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope)
-    Soup created
-    Soup created
-    INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.412 sec
-
-    Results :
-
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
+Title: CDI @RequestScoped
+
+This example show the use of `@RequestScoped` annotation for injected objects. An object
+which is defined as `@RequestScoped` is created once for every request and is shared by all the
+bean that inject it throughout a request.
+
+# Example
+
+This example depicts a similar scenario to cdi-application-scope. A restaurant guest orders
+a soup from the waiter. The order is passed to the chef who prepares it and passes it back
+the waiter who in turn delivers it to the guest.
+
+## Waiter
+
+The `Waiter` session bean receives a request from the test class via the `orderSoup()` method.
+A `Soup` insance will be created in this method and will be shared throughout the request with
+the `Chef` bean. The method passes the request to the `Chef` bean. It then returns the name of
+the soup to the test class. 
+
+    @Stateless
+    public class Waiter {
+
+        @Inject
+        private Soup soup;
+
+        @EJB
+        private Chef chef;
+
+        public String orderSoup(String name){
+            soup.setName(name);
+            return chef.prepareSoup().getName();
+        }
+    }
+
+## Soup
+
+The `Soup` class is an injectable POJO, defined as `@RequestScoped`. This means that an instance
+will be created only once for every request and will be shared by all the beans injecting it.
+
+    @RequestScoped
+    public class Soup {
+
+        private String name = "Soup of the day";
+
+        @PostConstruct
+        public void afterCreate() {
+            System.out.println("Soup created");
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name){
+            this.name = name;
+        }
+    }
+
+## Chef
+
+The `Chef` class is a simple session bean with an injected `Soup` field. Normally, the soup
+parameter would be passed as a `prepareSoup()` argument, but for the need of this example
+it's passed by the request context. 
+
+    @Stateless
+    public class Chef {
+
+        @Inject
+        private Soup soup;
+
+        public Soup prepareSoup() {
+            return soup;
+        }
+    }
+
+# Test Case
+
+This is the entry class for this example.
+
+    public class RestaurantTest {
+
+        private static String TOMATO_SOUP = "Tomato Soup";
+        private EJBContainer container;
+
+        @EJB
+        private Waiter joe;
+
+        @Before
+        public void startContainer() throws Exception {
+            container = EJBContainer.createEJBContainer();
+            container.getContext().bind("inject", this);
+        }
+
+        @Test
+        public void orderSoup(){
+            String soup = joe.orderSoup(TOMATO_SOUP);
+            assertEquals(TOMATO_SOUP, soup);
+            soup = joe.orderSoup(POTATO_SOUP);
+            assertEquals(POTATO_SOUP, soup);
+        }
+
+        @After
+        public void closeContainer() throws Exception {
+            container.close();
+        }
+    }
+
+# Running
+
+In the output you can see that there were two `Soup` instances created - one for
+each request.
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.cdi.requestscope.RestaurantTest
+    Apache OpenEJB 7.0.0-SNAPSHOT    build: 20111224-11:09
+    http://tomee.apache.org/
+    INFO - openejb.home = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
+    INFO - openejb.base = C:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Found EjbModule in classpath: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope\target\classes
+    INFO - Beginning load: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope\target\classes
+    INFO - Configuring enterprise application: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean cdi-request-scope.Comp: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+    INFO - Auto-creating a container for bean Chef: Container(type=STATELESS, id=Default Stateless Container)
+    INFO - Enterprise application "c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope" loaded.
+    INFO - Assembling app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
+    INFO - Jndi(name="java:global/cdi-request-scope/Chef!org.superbiz.cdi.requestscope.Chef")
+    INFO - Jndi(name="java:global/cdi-request-scope/Chef")
+    INFO - Jndi(name="java:global/cdi-request-scope/Waiter!org.superbiz.cdi.requestscope.Waiter")
+    INFO - Jndi(name="java:global/cdi-request-scope/Waiter")
+    INFO - Created Ejb(deployment-id=Chef, ejb-name=Chef, container=Default Stateless Container)
+    INFO - Created Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=Chef, ejb-name=Chef, container=Default Stateless Container)
+    INFO - Started Ejb(deployment-id=Waiter, ejb-name=Waiter, container=Default Stateless Container)
+    INFO - Deployed Application(path=c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope)
+    Soup created
+    Soup created
+    INFO - Undeploying app: c:\Users\Daniel\workspaces\openejb\openejb\examples\cdi-request-scope
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.412 sec
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
----------------------------------------------------------------------
diff --git a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
index 941a847..7185113 100644
--- a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
+++ b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Chef.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.requestscope;
-
-import javax.ejb.Stateless;
-import javax.inject.Inject;
-
-@Stateless
-public class Chef {
-
-    @Inject
-    private Soup soup;
-
-    public Soup prepareSoup() {
-        return soup;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.requestscope;
+
+import javax.ejb.Stateless;
+import javax.inject.Inject;
+
+@Stateless
+public class Chef {
+
+    @Inject
+    private Soup soup;
+
+    public Soup prepareSoup() {
+        return soup;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
----------------------------------------------------------------------
diff --git a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
index ed428fb..3bce620 100644
--- a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
+++ b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Soup.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.requestscope;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.RequestScoped;
-
-@RequestScoped
-public class Soup {
-
-    private String name = "Soup of the day";
-
-    @PostConstruct
-    public void afterCreate() {
-        System.out.println("Soup created");
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.requestscope;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+public class Soup {
+
+    private String name = "Soup of the day";
+
+    @PostConstruct
+    public void afterCreate() {
+        System.out.println("Soup created");
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
----------------------------------------------------------------------
diff --git a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
index 84c2849..53559a7 100644
--- a/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
+++ b/examples/cdi-request-scope/src/main/java/org/superbiz/cdi/requestscope/Waiter.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.requestscope;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.inject.Inject;
-
-@Stateless
-public class Waiter {
-
-    @Inject
-    private Soup soup;
-
-    @EJB
-    private Chef chef;
-
-    public String orderSoup(String name) {
-        soup.setName(name);
-        return chef.prepareSoup().getName();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.requestscope;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import javax.inject.Inject;
+
+@Stateless
+public class Waiter {
+
+    @Inject
+    private Soup soup;
+
+    @EJB
+    private Chef chef;
+
+    public String orderSoup(String name) {
+        soup.setName(name);
+        return chef.prepareSoup().getName();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java b/examples/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
index 612f65f..fa64175 100644
--- a/examples/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
+++ b/examples/cdi-request-scope/src/test/java/org/superbiz/cdi/requestscope/RestaurantTest.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.cdi.requestscope;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-
-import static org.junit.Assert.assertEquals;
-
-public class RestaurantTest {
-
-    private static final String TOMATO_SOUP = "Tomato Soup";
-    private static final String POTATO_SOUP = "Potato Soup";
-    private EJBContainer container;
-
-    @EJB
-    private Waiter joe;
-
-    @Before
-    public void startContainer() throws Exception {
-        container = EJBContainer.createEJBContainer();
-        container.getContext().bind("inject", this);
-    }
-
-    @Test
-    public void orderSoup() {
-        String soup = joe.orderSoup(TOMATO_SOUP);
-        assertEquals(TOMATO_SOUP, soup);
-        soup = joe.orderSoup(POTATO_SOUP);
-        assertEquals(POTATO_SOUP, soup);
-    }
-
-    @After
-    public void closeContainer() throws Exception {
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.requestscope;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+
+import static org.junit.Assert.assertEquals;
+
+public class RestaurantTest {
+
+    private static final String TOMATO_SOUP = "Tomato Soup";
+    private static final String POTATO_SOUP = "Potato Soup";
+    private EJBContainer container;
+
+    @EJB
+    private Waiter joe;
+
+    @Before
+    public void startContainer() throws Exception {
+        container = EJBContainer.createEJBContainer();
+        container.getContext().bind("inject", this);
+    }
+
+    @Test
+    public void orderSoup() {
+        String soup = joe.orderSoup(TOMATO_SOUP);
+        assertEquals(TOMATO_SOUP, soup);
+        soup = joe.orderSoup(POTATO_SOUP);
+        assertEquals(POTATO_SOUP, soup);
+    }
+
+    @After
+    public void closeContainer() throws Exception {
+        container.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/AnswerBean.java
----------------------------------------------------------------------
diff --git a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/AnswerBean.java b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/AnswerBean.java
index bc8327b..2ba85a7 100644
--- a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/AnswerBean.java
+++ b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/AnswerBean.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.cdi.session;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.RequestScoped;
-import javax.inject.Inject;
-
-// just to take care to refresh it, otherwise using postcontruct you can see kind of cache effect on session bean
-@RequestScoped
-public class AnswerBean {
-
-    @Inject
-    private SessionBean bean;
-
-    private String value;
-
-    @PostConstruct
-    public void init() {
-        value = '{' + bean.getName() + '}';
-    }
-
-    public String value() {
-        return value;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.session;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+
+// just to take care to refresh it, otherwise using postcontruct you can see kind of cache effect on session bean
+@RequestScoped
+public class AnswerBean {
+
+    @Inject
+    private SessionBean bean;
+
+    private String value;
+
+    @PostConstruct
+    public void init() {
+        value = '{' + bean.getName() + '}';
+    }
+
+    public String value() {
+        return value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/InputServlet.java
----------------------------------------------------------------------
diff --git a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/InputServlet.java b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/InputServlet.java
index 21b056f..220408b 100644
--- a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/InputServlet.java
+++ b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/InputServlet.java
@@ -1,44 +1,44 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.cdi.session;
-
-import javax.inject.Inject;
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-@WebServlet(name = "input-servlet", urlPatterns = {"/set-name"})
-public class InputServlet extends HttpServlet {
-
-    @Inject
-    private SessionBean bean;
-
-    @Override
-    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-        final String name = req.getParameter("name");
-        if (name == null || name.isEmpty()) {
-            resp.getWriter().write("please add a parameter name=xxx");
-        } else {
-            bean.setName(name);
-            resp.getWriter().write("done, go to /name servlet");
-        }
-
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.session;
+
+import javax.inject.Inject;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(name = "input-servlet", urlPatterns = {"/set-name"})
+public class InputServlet extends HttpServlet {
+
+    @Inject
+    private SessionBean bean;
+
+    @Override
+    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        final String name = req.getParameter("name");
+        if (name == null || name.isEmpty()) {
+            resp.getWriter().write("please add a parameter name=xxx");
+        } else {
+            bean.setName(name);
+            resp.getWriter().write("done, go to /name servlet");
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/OutputServlet.java
----------------------------------------------------------------------
diff --git a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/OutputServlet.java b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/OutputServlet.java
index d65edf9..11f623d 100644
--- a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/OutputServlet.java
+++ b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/OutputServlet.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.cdi.session;
-
-import javax.inject.Inject;
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-@WebServlet(name = "output-servlet", urlPatterns = {"/name"})
-public class OutputServlet extends HttpServlet {
-
-    @Inject
-    private AnswerBean bean;
-
-    @Override
-    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-        final String name = bean.value();
-        if (name == null || name.isEmpty()) {
-            resp.getWriter().write("please go to servlet /set-name please");
-        } else {
-            resp.getWriter().write("name = " + name);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.session;
+
+import javax.inject.Inject;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(name = "output-servlet", urlPatterns = {"/name"})
+public class OutputServlet extends HttpServlet {
+
+    @Inject
+    private AnswerBean bean;
+
+    @Override
+    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        final String name = bean.value();
+        if (name == null || name.isEmpty()) {
+            resp.getWriter().write("please go to servlet /set-name please");
+        } else {
+            resp.getWriter().write("name = " + name);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/SessionBean.java
----------------------------------------------------------------------
diff --git a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/SessionBean.java b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/SessionBean.java
index f17ac80..0381af1 100644
--- a/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/SessionBean.java
+++ b/examples/cdi-session-scope/src/main/java/org/superbiz/cdi/session/SessionBean.java
@@ -1,34 +1,34 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.cdi.session;
-
-import javax.enterprise.context.SessionScoped;
-import java.io.Serializable;
-
-@SessionScoped
-public class SessionBean implements Serializable {
-
-    private String name;
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.cdi.session;
+
+import javax.enterprise.context.SessionScoped;
+import java.io.Serializable;
+
+@SessionScoped
+public class SessionBean implements Serializable {
+
+    private String name;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
----------------------------------------------------------------------
diff --git a/examples/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java b/examples/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
index 0ac6472..adace70 100644
--- a/examples/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
+++ b/examples/change-jaxws-url/src/test/java/org/superbiz/jaxws/Rot13Test.java
@@ -1,51 +1,51 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.jaxws;
-
-import org.apache.ziplock.IO;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.net.URL;
-
-@RunWith(Arquillian.class)
-public class Rot13Test {
-
-    @ArquillianResource
-    private URL url;
-
-    @Deployment(testable = false)
-    public static WebArchive war() {
-        return ShrinkWrap.create(WebArchive.class)
-            .addClass(Rot13.class)
-            .addAsWebInfResource(new ClassLoaderAsset("META-INF/openejb-jar.xml"), ArchivePaths.create("openejb-jar.xml"));
-    }
-
-    @Test
-    public void checkWSDLIsDeployedWhereItIsConfigured() throws Exception {
-        final String wsdl = IO.slurp(new URL(url.toExternalForm() + "tool/rot13?wsdl"));
-        Assert.assertTrue(wsdl.contains("Rot13"));
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jaxws;
+
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.net.URL;
+
+@RunWith(Arquillian.class)
+public class Rot13Test {
+
+    @ArquillianResource
+    private URL url;
+
+    @Deployment(testable = false)
+    public static WebArchive war() {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClass(Rot13.class)
+                .addAsWebInfResource(new ClassLoaderAsset("META-INF/openejb-jar.xml"), ArchivePaths.create("openejb-jar.xml"));
+    }
+
+    @Test
+    public void checkWSDLIsDeployedWhereItIsConfigured() throws Exception {
+        final String wsdl = IO.slurp(new URL(url.toExternalForm() + "tool/rot13?wsdl"));
+        Assert.assertTrue(wsdl.contains("Rot13"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/client-resource-lookup-preview/src/test/java/org/superbiz/client/SenderTest.java
----------------------------------------------------------------------
diff --git a/examples/client-resource-lookup-preview/src/test/java/org/superbiz/client/SenderTest.java b/examples/client-resource-lookup-preview/src/test/java/org/superbiz/client/SenderTest.java
index a45bdad..be1b6de 100644
--- a/examples/client-resource-lookup-preview/src/test/java/org/superbiz/client/SenderTest.java
+++ b/examples/client-resource-lookup-preview/src/test/java/org/superbiz/client/SenderTest.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.client;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Queue;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class SenderTest {
-
-    @BeforeClass
-    public static void configureClientResources() {
-        // can be set this way or with the key Resource/<type>
-        // in fact we create on client side a mini jndi tree
-        // the key is the jndi name (the one used for the lookup)
-        System.setProperty("aConnectionFactory", "connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:11616");
-        System.setProperty("aQueue", "queue:org.apache.activemq.command.ActiveMQQueue:LISTENER");
-    }
-
-    @Test
-    public void send() throws Exception {
-        final Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-        final Context context = new InitialContext(properties);
-
-        final Queue destination = (Queue) context.lookup("java:aQueue");
-        assertNotNull(destination);
-        assertEquals("LISTENER", destination.getQueueName());
-
-        final ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("java:aConnectionFactory");
-        assertNotNull(connectionFactory);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.client;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class SenderTest {
+
+    @BeforeClass
+    public static void configureClientResources() {
+        // can be set this way or with the key Resource/<type>
+        // in fact we create on client side a mini jndi tree
+        // the key is the jndi name (the one used for the lookup)
+        System.setProperty("aConnectionFactory", "connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:11616");
+        System.setProperty("aQueue", "queue:org.apache.activemq.command.ActiveMQQueue:LISTENER");
+    }
+
+    @Test
+    public void send() throws Exception {
+        final Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+        final Context context = new InitialContext(properties);
+
+        final Queue destination = (Queue) context.lookup("java:aQueue");
+        assertNotNull(destination);
+        assertEquals("LISTENER", destination.getQueueName());
+
+        final ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("java:aConnectionFactory");
+        assertNotNull(connectionFactory);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPerson.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPerson.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPerson.java
index f1bdc2b..3f2dfee 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPerson.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPerson.java
@@ -1,126 +1,126 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import javax.ejb.Init;
-import javax.ejb.Local;
-import javax.ejb.LocalHome;
-import javax.ejb.Remote;
-import javax.ejb.RemoteHome;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Properties;
-
-/**
- * This is an EJB 3 style pojo stateful session bean
- * it does not need to implement javax.ejb.SessionBean
- */
-//START SNIPPET: code
-
-// EJB 3.0 Style business interfaces
-// Each of these interfaces are already annotated in the classes
-// themselves with @Remote and @Local, so annotating them here
-// in the bean class again is not really required.
-@Remote({FriendlyPersonRemote.class})
-@Local({FriendlyPersonLocal.class})
-
-// EJB 2.1 Style component interfaces
-// These interfaces, however, must be annotated here in the bean class.
-// Use of @RemoteHome in the FriendlyPersonEjbHome class itself is not allowed.
-// Use of @LocalHome in the FriendlyPersonEjbLocalHome class itself is also not allowed.
-@RemoteHome(FriendlyPersonEjbHome.class)
-@LocalHome(FriendlyPersonEjbLocalHome.class)
-
-@Stateful
-public class FriendlyPerson implements FriendlyPersonLocal, FriendlyPersonRemote {
-
-    private final HashMap<String, MessageFormat> greetings;
-    private final Properties languagePreferences;
-
-    private String defaultLanguage;
-
-    public FriendlyPerson() {
-        greetings = new HashMap();
-        languagePreferences = new Properties();
-        defaultLanguage = Locale.getDefault().getLanguage();
-
-        addGreeting("en", "Hello {0}!");
-        addGreeting("es", "Hola {0}!");
-        addGreeting("fr", "Bonjour {0}!");
-        addGreeting("pl", "Witaj {0}!");
-    }
-
-    /**
-     * This method corresponds to the FriendlyPersonEjbHome.create() method
-     * and the FriendlyPersonEjbLocalHome.create()
-     * <p/>
-     * If you do not have an EJBHome or EJBLocalHome interface, this method
-     * can be deleted.
-     */
-    @Init
-    public void create() {
-    }
-
-    /**
-     * This method corresponds to the following methods:
-     * - EJBObject.remove()
-     * - EJBHome.remove(ejbObject)
-     * - EJBLocalObject.remove()
-     * - EJBLocalHome.remove(ejbObject)
-     * <p/>
-     * If you do not have an EJBHome or EJBLocalHome interface, this method
-     * can be deleted.
-     */
-    @Remove
-    public void remove() {
-    }
-
-    public String greet(String friend) {
-        String language = languagePreferences.getProperty(friend, defaultLanguage);
-        return greet(language, friend);
-    }
-
-    public String greet(String language, String friend) {
-        MessageFormat greeting = greetings.get(language);
-        if (greeting == null) {
-            Locale locale = new Locale(language);
-            return "Sorry, I don't speak " + locale.getDisplayLanguage() + ".";
-        }
-
-        return greeting.format(new Object[]{friend});
-    }
-
-    public void addGreeting(String language, String message) {
-        greetings.put(language, new MessageFormat(message));
-    }
-
-    public void setLanguagePreferences(String friend, String language) {
-        languagePreferences.put(friend, language);
-    }
-
-    public String getDefaultLanguage() {
-        return defaultLanguage;
-    }
-
-    public void setDefaultLanguage(String defaultLanguage) {
-        this.defaultLanguage = defaultLanguage;
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.ejb.Init;
+import javax.ejb.Local;
+import javax.ejb.LocalHome;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Properties;
+
+/**
+ * This is an EJB 3 style pojo stateful session bean
+ * it does not need to implement javax.ejb.SessionBean
+ */
+//START SNIPPET: code
+
+// EJB 3.0 Style business interfaces
+// Each of these interfaces are already annotated in the classes
+// themselves with @Remote and @Local, so annotating them here
+// in the bean class again is not really required.
+@Remote({FriendlyPersonRemote.class})
+@Local({FriendlyPersonLocal.class})
+
+// EJB 2.1 Style component interfaces
+// These interfaces, however, must be annotated here in the bean class.
+// Use of @RemoteHome in the FriendlyPersonEjbHome class itself is not allowed.
+// Use of @LocalHome in the FriendlyPersonEjbLocalHome class itself is also not allowed.
+@RemoteHome(FriendlyPersonEjbHome.class)
+@LocalHome(FriendlyPersonEjbLocalHome.class)
+
+@Stateful
+public class FriendlyPerson implements FriendlyPersonLocal, FriendlyPersonRemote {
+
+    private final HashMap<String, MessageFormat> greetings;
+    private final Properties languagePreferences;
+
+    private String defaultLanguage;
+
+    public FriendlyPerson() {
+        greetings = new HashMap();
+        languagePreferences = new Properties();
+        defaultLanguage = Locale.getDefault().getLanguage();
+
+        addGreeting("en", "Hello {0}!");
+        addGreeting("es", "Hola {0}!");
+        addGreeting("fr", "Bonjour {0}!");
+        addGreeting("pl", "Witaj {0}!");
+    }
+
+    /**
+     * This method corresponds to the FriendlyPersonEjbHome.create() method
+     * and the FriendlyPersonEjbLocalHome.create()
+     * <p/>
+     * If you do not have an EJBHome or EJBLocalHome interface, this method
+     * can be deleted.
+     */
+    @Init
+    public void create() {
+    }
+
+    /**
+     * This method corresponds to the following methods:
+     * - EJBObject.remove()
+     * - EJBHome.remove(ejbObject)
+     * - EJBLocalObject.remove()
+     * - EJBLocalHome.remove(ejbObject)
+     * <p/>
+     * If you do not have an EJBHome or EJBLocalHome interface, this method
+     * can be deleted.
+     */
+    @Remove
+    public void remove() {
+    }
+
+    public String greet(String friend) {
+        String language = languagePreferences.getProperty(friend, defaultLanguage);
+        return greet(language, friend);
+    }
+
+    public String greet(String language, String friend) {
+        MessageFormat greeting = greetings.get(language);
+        if (greeting == null) {
+            Locale locale = new Locale(language);
+            return "Sorry, I don't speak " + locale.getDisplayLanguage() + ".";
+        }
+
+        return greeting.format(new Object[]{friend});
+    }
+
+    public void addGreeting(String language, String message) {
+        greetings.put(language, new MessageFormat(message));
+    }
+
+    public void setLanguagePreferences(String friend, String language) {
+        languagePreferences.put(friend, language);
+    }
+
+    public String getDefaultLanguage() {
+        return defaultLanguage;
+    }
+
+    public void setDefaultLanguage(String defaultLanguage) {
+        this.defaultLanguage = defaultLanguage;
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbHome.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbHome.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbHome.java
index 634ea9d..ae301a4 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbHome.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbHome.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-//START SNIPPET: code
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBHome;
-import java.rmi.RemoteException;
-
-public interface FriendlyPersonEjbHome extends EJBHome {
-
-    FriendlyPersonEjbObject create() throws CreateException, RemoteException;
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+//START SNIPPET: code
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+import java.rmi.RemoteException;
+
+public interface FriendlyPersonEjbHome extends EJBHome {
+
+    FriendlyPersonEjbObject create() throws CreateException, RemoteException;
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalHome.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalHome.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalHome.java
index 8e20836..ac00b76 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalHome.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalHome.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-//START SNIPPET: code
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBLocalHome;
-import java.rmi.RemoteException;
-
-public interface FriendlyPersonEjbLocalHome extends EJBLocalHome {
-
-    FriendlyPersonEjbLocalObject create() throws CreateException, RemoteException;
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+//START SNIPPET: code
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+import java.rmi.RemoteException;
+
+public interface FriendlyPersonEjbLocalHome extends EJBLocalHome {
+
+    FriendlyPersonEjbLocalObject create() throws CreateException, RemoteException;
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalObject.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalObject.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalObject.java
index f729962..7b11e8e 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalObject.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbLocalObject.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-import javax.ejb.EJBLocalObject;
-
-public interface FriendlyPersonEjbLocalObject extends EJBLocalObject {
-
-    String greet(String friend);
-
-    String greet(String language, String friend);
-
-    void addGreeting(String language, String message);
-
-    void setLanguagePreferences(String friend, String language);
-
-    String getDefaultLanguage();
-
-    void setDefaultLanguage(String defaultLanguage);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import javax.ejb.EJBLocalObject;
+
+public interface FriendlyPersonEjbLocalObject extends EJBLocalObject {
+
+    String greet(String friend);
+
+    String greet(String language, String friend);
+
+    void addGreeting(String language, String message);
+
+    void setLanguagePreferences(String friend, String language);
+
+    String getDefaultLanguage();
+
+    void setDefaultLanguage(String defaultLanguage);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbObject.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbObject.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbObject.java
index d1642de..277111d 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbObject.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonEjbObject.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-//START SNIPPET: code
-
-import javax.ejb.EJBObject;
-import java.rmi.RemoteException;
-
-public interface FriendlyPersonEjbObject extends EJBObject {
-
-    String greet(String friend) throws RemoteException;
-
-    String greet(String language, String friend) throws RemoteException;
-
-    void addGreeting(String language, String message) throws RemoteException;
-
-    void setLanguagePreferences(String friend, String language) throws RemoteException;
-
-    String getDefaultLanguage() throws RemoteException;
-
-    void setDefaultLanguage(String defaultLanguage) throws RemoteException;
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+//START SNIPPET: code
+
+import javax.ejb.EJBObject;
+import java.rmi.RemoteException;
+
+public interface FriendlyPersonEjbObject extends EJBObject {
+
+    String greet(String friend) throws RemoteException;
+
+    String greet(String language, String friend) throws RemoteException;
+
+    void addGreeting(String language, String message) throws RemoteException;
+
+    void setLanguagePreferences(String friend, String language) throws RemoteException;
+
+    String getDefaultLanguage() throws RemoteException;
+
+    void setDefaultLanguage(String defaultLanguage) throws RemoteException;
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonLocal.java
----------------------------------------------------------------------
diff --git a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonLocal.java b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonLocal.java
index 2371215..551bee3 100644
--- a/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonLocal.java
+++ b/examples/component-interfaces/src/main/java/org/superbiz/FriendlyPersonLocal.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz;
-
-//START SNIPPET: code
-
-import javax.ejb.Local;
-
-@Local
-public interface FriendlyPersonLocal {
-
-    String greet(String friend);
-
-    String greet(String language, String friend);
-
-    void addGreeting(String language, String message);
-
-    void setLanguagePreferences(String friend, String language);
-
-    String getDefaultLanguage();
-
-    void setDefaultLanguage(String defaultLanguage);
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+//START SNIPPET: code
+
+import javax.ejb.Local;
+
+@Local
+public interface FriendlyPersonLocal {
+
+    String greet(String friend);
+
+    String greet(String language, String friend);
+
+    void addGreeting(String language, String message);
+
+    void setLanguagePreferences(String friend, String language);
+
+    String getDefaultLanguage();
+
+    void setDefaultLanguage(String defaultLanguage);
+
+}
+//END SNIPPET: code


[30/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorResponse.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorResponse.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorResponse.java
index c5c7d37..b544f06 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorResponse.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorResponse.java
@@ -1,77 +1,77 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp1.messages;
-
-import javax.ws.rs.core.Response;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Date;
-
-@XmlRootElement
-public class ErrorResponse implements Serializable {
-    private static final long serialVersionUID = 8888101217538645771L;
-
-    private Long id;
-    private Response.Status status;
-    private String message;
-
-    public ErrorResponse() {
-        this.id = new Date().getTime();
-    }
-
-    public ErrorResponse(final Response.Status status, final String message) {
-        this.id = new Date().getTime();
-        this.status = status;
-        this.message = message;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(final Long id) {
-        this.id = id;
-    }
-
-    public Response.Status getStatus() {
-        return status;
-    }
-
-    @XmlAttribute
-    public void setStatus(final Response.Status status) {
-        this.status = status;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    @XmlAttribute
-    public void setMessage(final String message) {
-        this.message = message;
-    }
-
-    //    @Override
-//    public String toString() {
-//        return "{" + "id:" + id + ", status:" + status + ", message:" + message + '}';
-//    }
-    @Override
-    public String toString() {
-        return "ErrorResponse:" + "id=" + id + ", status=" + status + ", message=" + message;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.messages;
+
+import javax.ws.rs.core.Response;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.Date;
+
+@XmlRootElement
+public class ErrorResponse implements Serializable {
+    private static final long serialVersionUID = 8888101217538645771L;
+
+    private Long id;
+    private Response.Status status;
+    private String message;
+
+    public ErrorResponse() {
+        this.id = new Date().getTime();
+    }
+
+    public ErrorResponse(final Response.Status status, final String message) {
+        this.id = new Date().getTime();
+        this.status = status;
+        this.message = message;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(final Long id) {
+        this.id = id;
+    }
+
+    public Response.Status getStatus() {
+        return status;
+    }
+
+    @XmlAttribute
+    public void setStatus(final Response.Status status) {
+        this.status = status;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    @XmlAttribute
+    public void setMessage(final String message) {
+        this.message = message;
+    }
+
+    //    @Override
+//    public String toString() {
+//        return "{" + "id:" + id + ", status:" + status + ", message:" + message + '}';
+//    }
+    @Override
+    public String toString() {
+        return "ErrorResponse:" + "id=" + id + ", status=" + status + ", message=" + message;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/provider/ConstraintViolationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/provider/ConstraintViolationExceptionMapper.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/provider/ConstraintViolationExceptionMapper.java
index 4f19422..1dc9496 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/provider/ConstraintViolationExceptionMapper.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/provider/ConstraintViolationExceptionMapper.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp1.provider;
-
-import org.superbiz.webapp1.messages.ErrorList;
-import org.superbiz.webapp1.messages.ErrorResponse;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-@Provider
-@Produces(MediaType.APPLICATION_JSON)
-public class ConstraintViolationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
-
-    @Context
-    private HttpHeaders headers;
-
-    @Override
-    public Response toResponse(final ConstraintViolationException t) {
-        final MediaType type = headers.getMediaType();
-        final Locale locale = headers.getLanguage();
-
-        final Object responsObject = getConstraintViolationErrors(t);
-        return Response.status(Response.Status.NOT_ACCEPTABLE).type(type).language(locale).entity(responsObject).build();
-    }
-
-    private static Object getConstraintViolationErrors(final ConstraintViolationException ex) {
-        final List<ErrorResponse> errors = new ArrayList<ErrorResponse>();
-        for (final ConstraintViolation violation : ex.getConstraintViolations()) {
-            final ErrorResponse error = new ErrorResponse();
-            error.setMessage(violation.getMessage());
-            errors.add(error);
-        }
-        return new ErrorList<ErrorResponse>(errors);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.provider;
+
+import org.superbiz.webapp1.messages.ErrorList;
+import org.superbiz.webapp1.messages.ErrorResponse;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+@Provider
+@Produces(MediaType.APPLICATION_JSON)
+public class ConstraintViolationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
+
+    @Context
+    private HttpHeaders headers;
+
+    @Override
+    public Response toResponse(final ConstraintViolationException t) {
+        final MediaType type = headers.getMediaType();
+        final Locale locale = headers.getLanguage();
+
+        final Object responsObject = getConstraintViolationErrors(t);
+        return Response.status(Response.Status.NOT_ACCEPTABLE).type(type).language(locale).entity(responsObject).build();
+    }
+
+    private static Object getConstraintViolationErrors(final ConstraintViolationException ex) {
+        final List<ErrorResponse> errors = new ArrayList<ErrorResponse>();
+        for (final ConstraintViolation violation : ex.getConstraintViolations()) {
+            final ErrorResponse error = new ErrorResponse();
+            error.setMessage(violation.getMessage());
+            errors.add(error);
+        }
+        return new ErrorList<ErrorResponse>(errors);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/service/WebApp1Service.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/service/WebApp1Service.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/service/WebApp1Service.java
index a5799ad..cb03bde 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/service/WebApp1Service.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/service/WebApp1Service.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp1.service;
-
-import javax.ejb.Singleton;
-import javax.validation.constraints.Pattern;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("test")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-@Singleton
-public class WebApp1Service {
-
-    @POST
-    public Response getInfo(@Pattern(regexp = "valid") final String input) {
-        return Response.ok().build();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.service;
+
+import javax.ejb.Singleton;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("test")
+@Consumes(MediaType.APPLICATION_JSON)
+@Produces(MediaType.APPLICATION_JSON)
+@Singleton
+public class WebApp1Service {
+
+    @POST
+    public Response getInfo(@Pattern(regexp = "valid") final String input) {
+        return Response.ok().build();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp2/pom.xml b/examples/bval-evaluation-redeployment/WebApp2/pom.xml
index 972a687..bb2aba2 100644
--- a/examples/bval-evaluation-redeployment/WebApp2/pom.xml
+++ b/examples/bval-evaluation-redeployment/WebApp2/pom.xml
@@ -28,7 +28,6 @@
   </parent>
 
   <artifactId>WebApp2</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
   <packaging>war</packaging>
 
   <name>WebApp2</name>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorList.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorList.java b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorList.java
index c3a5237..9e555ca 100644
--- a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorList.java
+++ b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorList.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp2.messages;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import java.util.ArrayList;
-import java.util.Collection;
-
-@XmlRootElement
-@XmlSeeAlso(ErrorResponse.class)
-public class ErrorList<T> extends ArrayList<T> {
-
-    private static final long serialVersionUID = -8861634470374757349L;
-
-    public ErrorList() {
-    }
-
-    public ErrorList(final Collection<? extends T> clctn) {
-        addAll(clctn);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp2.messages;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.ArrayList;
+import java.util.Collection;
+
+@XmlRootElement
+@XmlSeeAlso(ErrorResponse.class)
+public class ErrorList<T> extends ArrayList<T> {
+
+    private static final long serialVersionUID = -8861634470374757349L;
+
+    public ErrorList() {
+    }
+
+    public ErrorList(final Collection<? extends T> clctn) {
+        addAll(clctn);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorResponse.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorResponse.java b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorResponse.java
index 4a2928f..12fbb5f 100644
--- a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorResponse.java
+++ b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/messages/ErrorResponse.java
@@ -1,77 +1,77 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp2.messages;
-
-import javax.ws.rs.core.Response;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Date;
-
-@XmlRootElement
-public class ErrorResponse implements Serializable {
-    private static final long serialVersionUID = 8888101217538645771L;
-
-    private Long id;
-    private Response.Status status;
-    private String message;
-
-    public ErrorResponse() {
-        this.id = new Date().getTime();
-    }
-
-    public ErrorResponse(final Response.Status status, final String message) {
-        this.id = new Date().getTime();
-        this.status = status;
-        this.message = message;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(final Long id) {
-        this.id = id;
-    }
-
-    public Response.Status getStatus() {
-        return status;
-    }
-
-    @XmlAttribute
-    public void setStatus(final Response.Status status) {
-        this.status = status;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    @XmlAttribute
-    public void setMessage(final String message) {
-        this.message = message;
-    }
-
-    //    @Override
-//    public String toString() {
-//        return "{" + "id:" + id + ", status:" + status + ", message:" + message + '}';
-//    }
-    @Override
-    public String toString() {
-        return "ErrorResponse:" + "id=" + id + ", status=" + status + ", message=" + message;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp2.messages;
+
+import javax.ws.rs.core.Response;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.Date;
+
+@XmlRootElement
+public class ErrorResponse implements Serializable {
+    private static final long serialVersionUID = 8888101217538645771L;
+
+    private Long id;
+    private Response.Status status;
+    private String message;
+
+    public ErrorResponse() {
+        this.id = new Date().getTime();
+    }
+
+    public ErrorResponse(final Response.Status status, final String message) {
+        this.id = new Date().getTime();
+        this.status = status;
+        this.message = message;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(final Long id) {
+        this.id = id;
+    }
+
+    public Response.Status getStatus() {
+        return status;
+    }
+
+    @XmlAttribute
+    public void setStatus(final Response.Status status) {
+        this.status = status;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    @XmlAttribute
+    public void setMessage(final String message) {
+        this.message = message;
+    }
+
+    //    @Override
+//    public String toString() {
+//        return "{" + "id:" + id + ", status:" + status + ", message:" + message + '}';
+//    }
+    @Override
+    public String toString() {
+        return "ErrorResponse:" + "id=" + id + ", status=" + status + ", message=" + message;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/provider/ConstraintViolationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/provider/ConstraintViolationExceptionMapper.java b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/provider/ConstraintViolationExceptionMapper.java
index c6d73ae..2d12935 100644
--- a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/provider/ConstraintViolationExceptionMapper.java
+++ b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/provider/ConstraintViolationExceptionMapper.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp2.provider;
-
-import org.superbiz.webapp2.messages.ErrorList;
-import org.superbiz.webapp2.messages.ErrorResponse;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-@Provider
-@Produces(MediaType.APPLICATION_JSON)
-public class ConstraintViolationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
-
-    @Context
-    private HttpHeaders headers;
-
-    @Override
-    public Response toResponse(final ConstraintViolationException t) {
-        final MediaType type = headers.getMediaType();
-        final Locale locale = headers.getLanguage();
-
-        final Object responsObject = getConstraintViolationErrors(t);
-        return Response.status(Response.Status.NOT_ACCEPTABLE).type(type).language(locale).entity(responsObject).build();
-    }
-
-    private static Object getConstraintViolationErrors(final ConstraintViolationException ex) {
-        final List<ErrorResponse> errors = new ArrayList<ErrorResponse>();
-        for (final ConstraintViolation violation : ex.getConstraintViolations()) {
-            final ErrorResponse error = new ErrorResponse();
-            error.setMessage(violation.getMessage());
-            errors.add(error);
-        }
-        return new ErrorList<ErrorResponse>(errors);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp2.provider;
+
+import org.superbiz.webapp2.messages.ErrorList;
+import org.superbiz.webapp2.messages.ErrorResponse;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+@Provider
+@Produces(MediaType.APPLICATION_JSON)
+public class ConstraintViolationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
+
+    @Context
+    private HttpHeaders headers;
+
+    @Override
+    public Response toResponse(final ConstraintViolationException t) {
+        final MediaType type = headers.getMediaType();
+        final Locale locale = headers.getLanguage();
+
+        final Object responsObject = getConstraintViolationErrors(t);
+        return Response.status(Response.Status.NOT_ACCEPTABLE).type(type).language(locale).entity(responsObject).build();
+    }
+
+    private static Object getConstraintViolationErrors(final ConstraintViolationException ex) {
+        final List<ErrorResponse> errors = new ArrayList<ErrorResponse>();
+        for (final ConstraintViolation violation : ex.getConstraintViolations()) {
+            final ErrorResponse error = new ErrorResponse();
+            error.setMessage(violation.getMessage());
+            errors.add(error);
+        }
+        return new ErrorList<ErrorResponse>(errors);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/service/WebApp2Service.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/service/WebApp2Service.java b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/service/WebApp2Service.java
index 86d020b..0c55163 100644
--- a/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/service/WebApp2Service.java
+++ b/examples/bval-evaluation-redeployment/WebApp2/src/main/java/org/superbiz/webapp2/service/WebApp2Service.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.webapp2.service;
-
-import javax.ejb.Singleton;
-import javax.validation.constraints.Pattern;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Singleton
-@Path("test")
-@Consumes(MediaType.APPLICATION_JSON)
-@Produces(MediaType.APPLICATION_JSON)
-public class WebApp2Service {
-
-    @POST
-    public Response getInfo(@Pattern(regexp = "valid") final String input) {
-        return Response.ok().build();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp2.service;
+
+import javax.ejb.Singleton;
+import javax.validation.constraints.Pattern;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Singleton
+@Path("test")
+@Consumes(MediaType.APPLICATION_JSON)
+@Produces(MediaType.APPLICATION_JSON)
+public class WebApp2Service {
+
+    @POST
+    public Response getInfo(@Pattern(regexp = "valid") final String input) {
+        return Response.ok().build();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/runner/src/test/java/RedeploymentTest.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/runner/src/test/java/RedeploymentTest.java b/examples/bval-evaluation-redeployment/runner/src/test/java/RedeploymentTest.java
index 0b1fc87..c7f3dd9 100644
--- a/examples/bval-evaluation-redeployment/runner/src/test/java/RedeploymentTest.java
+++ b/examples/bval-evaluation-redeployment/runner/src/test/java/RedeploymentTest.java
@@ -1,87 +1,87 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.jboss.arquillian.container.test.api.Deployer;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.ws.rs.core.MediaType;
-import java.io.File;
-
-@RunWith(Arquillian.class)
-public class RedeploymentTest {
-
-    public RedeploymentTest() {
-    }
-
-    @Deployment(name = "webapp1", managed = false)
-    public static Archive<?> webapp1() {
-        return ShrinkWrap.createFromZipFile(WebArchive.class, new File("../WebApp1/target/WebApp1-1.1.0-SNAPSHOT.war"));
-    }
-
-    @Deployment(name = "webapp2", managed = false)
-    public static Archive<?> webapp2() {
-        return ShrinkWrap.createFromZipFile(WebArchive.class, new File("../WebApp2/target/WebApp2-1.1.0-SNAPSHOT.war"));
-    }
-
-    @ArquillianResource
-    private Deployer deployer;
-
-    @Test
-    public void validateTest() throws Exception {
-
-        final String port = System.getProperty("server.http.port", "8080");
-        System.out.println("");
-        System.out.println("===========================================");
-        System.out.println("Running test on port: " + port);
-
-        deployer.deploy("webapp1");
-        int result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
-            .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
-        System.out.println(result);
-        Assert.assertEquals(406, result);
-
-        //Not interested in webapp2 output
-        // deployer.undeploy("webapp2");
-        deployer.deploy("webapp2");
-
-        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
-            .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
-        System.out.println(result);
-        Assert.assertEquals(406, result);
-        deployer.undeploy("webapp2");
-        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
-            .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
-        System.out.println(result);
-        Assert.assertEquals(406, result);
-        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
-            .type(MediaType.APPLICATION_JSON_TYPE).post("valid").getStatus();
-        System.out.println(result);
-        Assert.assertEquals(200, result);
-        System.out.println("===========================================");
-        System.out.println("");
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.jboss.arquillian.container.test.api.Deployer;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ws.rs.core.MediaType;
+import java.io.File;
+
+@RunWith(Arquillian.class)
+public class RedeploymentTest {
+
+    public RedeploymentTest() {
+    }
+
+    @Deployment(name = "webapp1", managed = false)
+    public static Archive<?> webapp1() {
+        return ShrinkWrap.createFromZipFile(WebArchive.class, new File("../WebApp1/target/WebApp1-1.1.0-SNAPSHOT.war"));
+    }
+
+    @Deployment(name = "webapp2", managed = false)
+    public static Archive<?> webapp2() {
+        return ShrinkWrap.createFromZipFile(WebArchive.class, new File("../WebApp2/target/WebApp2-1.1.0-SNAPSHOT.war"));
+    }
+
+    @ArquillianResource
+    private Deployer deployer;
+
+    @Test
+    public void validateTest() throws Exception {
+
+        final String port = System.getProperty("server.http.port", "8080");
+        System.out.println("");
+        System.out.println("===========================================");
+        System.out.println("Running test on port: " + port);
+
+        deployer.deploy("webapp1");
+        int result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
+                .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
+        System.out.println(result);
+        Assert.assertEquals(406, result);
+
+        //Not interested in webapp2 output
+        // deployer.undeploy("webapp2");
+        deployer.deploy("webapp2");
+
+        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
+                .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
+        System.out.println(result);
+        Assert.assertEquals(406, result);
+        deployer.undeploy("webapp2");
+        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
+                .type(MediaType.APPLICATION_JSON_TYPE).post("validd").getStatus();
+        System.out.println(result);
+        Assert.assertEquals(406, result);
+        result = WebClient.create("http://localhost:" + port + "/WebApp1/test/")
+                .type(MediaType.APPLICATION_JSON_TYPE).post("valid").getStatus();
+        System.out.println(result);
+        Assert.assertEquals(200, result);
+        System.out.println("===========================================");
+        System.out.println("");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/README.md
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/README.md b/examples/cdi-alternative-and-stereotypes/README.md
index 26f8c93..c728514 100644
--- a/examples/cdi-alternative-and-stereotypes/README.md
+++ b/examples/cdi-alternative-and-stereotypes/README.md
@@ -1,126 +1,126 @@
-# Introduction
-
-CDI is a revolution for Java EE world. This specification is the best one to avoid coupling between classes.
-
-This example simply aims to override bindings at runtime to simplify mocking work.
-
-It uses two kind of mocks:
-1) a mock with no implementation in the classloader
-2) a mock with an implementation in the classloader
-
-The mock answer from CDI is called *alternative*.
-
-Annotating `@Alternative` a class will mean it will replace any implementation if there is no other implementation
-or if it is forced (through `META-INF/beans.xml`).
-
-# Code explanation
-## main code
-
-We use an EJB `Jouney` to modelize a journey where the vehicle and the society can change. Here an EJB is used simply
-because it simplifies the test. A jouney wraps the vehicle and society information.
-
-We define then two interfaces to inject it in the `Journey` EJB: `Vehicle` and `Society`.
-
-Finally we add an implementation for `Scociety` interface: `LowCostCompanie`.
-
-If we don't go further `Journey` object will not be able to be created because no `Vehicle` implementation is available.
-
-Note: if we suppose we have a `Vehicle` implementation, the injected Society should be `LowCostCompanie`.
-
-## test code
-
-The goal here is to test our `Journey` EJB. So we have to provide a `Vehicle` implementation: `SuperCar`.
-
-We want to force the `Society` implementation (for any reason) by our test implementation: `AirOpenEJB`.
-
-One solution could simply be to add `@Alternative` annotation on `AirOpenEJB` and activate it through
-the `META-INF/beans.xml` file.
-
-Here we want to write more explicit code. So we want to replace the `@Alternative` annotation by `@Mock` one.
-
-So we simply define an `@Mock` annotation for classes, resolvable at runtime which is a stereotype (`@Stereotype`)
-which replace `@Alternative`.
-
-Here is the annotation:
-
-    @Stereotype // we define a stereotype
-    @Retention(RUNTIME) // resolvable at runtime
-    @Target(TYPE) // this annotation is a class level one
-    @Alternative // it replace @Alternative
-    public @interface Mock {}
-
-Note: you can add more CDI annotations after `@Alternative` and it will get the behavior expected (the scope for instance).
-
-So now we have our `@Mock` annotation which is a stereotype able to replace `@Alternative` annotation
-we simply add this annotation to our mocks.
-
-If you run it now you'll have this exception:
-
-    javax.enterprise.inject.UnsatisfiedResolutionException: Api type [org.superbiz.cdi.stereotype.Vehicle] is not found with the qualifiers
-    Qualifiers: [@javax.enterprise.inject.Default()]
-    for injection into Field Injection Point, field name :  vehicle, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[java.lang.Object,org.superbiz.cdi.stereotype.Journey], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
-
-It means the stereotype is not activated. To do it simply add it to your `META-INF/beans.xml`:
-
-    <alternatives>
-      <stereotype>org.superbiz.cdi.stereotype.Mock</stereotype>
-    </alternatives>
-
-Note: if you don't specify `AirOpenEJB` as `@Alternative` (done through our mock annotation) you'll get this exception:
-
-    Caused by: javax.enterprise.inject.AmbiguousResolutionException: There is more than one api type with : org.superbiz.cdi.stereotype.Society with qualifiers : Qualifiers: [@javax.enterprise.inject.Default()]
-    for injection into Field Injection Point, field name :  society, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[org.superbiz.cdi.stereotype.Journey,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
-    found beans:
-    AirOpenEJB, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.AirOpenEJB,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
-    LowCostCompanie, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.LowCostCompanie,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
-
-which simply means two implementations are available for the same injection point (`Journey.society`).
-
-# Conclusion
-
-With CDI it is really easy to define annotations with a strong meaning. You can define business annotations
-or simply technical annotations to simplify your code (as we did with the mock annotation).
-
-Note: if for instance you used qualifiers to inject societies you could have put all these qualifiers on
-the mock class or defined a `@SocietyMock` annotation to be able to inject the same implementation for
-all qualifiers in your tests.
-
-# Output
-
-    Running org.superbiz.cdi.stereotype.StereotypeTest
-    Apache OpenEJB 4.0.0-beta-2-SNAPSHOT    build: 20111030-07:54
-    http://tomee.apache.org/
-    INFO - openejb.home = /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
-    INFO - openejb.base = /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
-    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Found EjbModule in classpath: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/test-classes
-    INFO - Found EjbModule in classpath: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/classes
-    INFO - Beginning load: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/test-classes
-    INFO - Beginning load: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/classes
-    INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
-    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
-    INFO - Auto-creating a container for bean cdi-alternative-and-stereotypes_test.Comp: Container(type=MANAGED, id=Default Managed Container)
-    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
-    INFO - Auto-creating a container for bean Journey: Container(type=SINGLETON, id=Default Singleton Container)
-    INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes" loaded.
-    INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes_test.Comp!org.apache.openejb.BeanContext$Comp")
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes_test.Comp")
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes.Comp!org.apache.openejb.BeanContext$Comp")
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes.Comp")
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/Journey!org.superbiz.cdi.stereotype.Journey")
-    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/Journey")
-    INFO - Jndi(name="java:global/EjbModule162291475/org.superbiz.cdi.stereotype.StereotypeTest!org.superbiz.cdi.stereotype.StereotypeTest")
-    INFO - Jndi(name="java:global/EjbModule162291475/org.superbiz.cdi.stereotype.StereotypeTest")
-    INFO - Created Ejb(deployment-id=cdi-alternative-and-stereotypes_test.Comp, ejb-name=cdi-alternative-and-stereotypes_test.Comp, container=Default Managed Container)
-    INFO - Created Ejb(deployment-id=cdi-alternative-and-stereotypes.Comp, ejb-name=cdi-alternative-and-stereotypes.Comp, container=Default Managed Container)
-    INFO - Created Ejb(deployment-id=org.superbiz.cdi.stereotype.StereotypeTest, ejb-name=org.superbiz.cdi.stereotype.StereotypeTest, container=Default Managed Container)
-    INFO - Created Ejb(deployment-id=Journey, ejb-name=Journey, container=Default Singleton Container)
-    INFO - Started Ejb(deployment-id=cdi-alternative-and-stereotypes_test.Comp, ejb-name=cdi-alternative-and-stereotypes_test.Comp, container=Default Managed Container)
-    INFO - Started Ejb(deployment-id=cdi-alternative-and-stereotypes.Comp, ejb-name=cdi-alternative-and-stereotypes.Comp, container=Default Managed Container)
-    INFO - Started Ejb(deployment-id=org.superbiz.cdi.stereotype.StereotypeTest, ejb-name=org.superbiz.cdi.stereotype.StereotypeTest, container=Default Managed Container)
-    INFO - Started Ejb(deployment-id=Journey, ejb-name=Journey, container=Default Singleton Container)
-    INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes)
-    INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
+# Introduction
+
+CDI is a revolution for Java EE world. This specification is the best one to avoid coupling between classes.
+
+This example simply aims to override bindings at runtime to simplify mocking work.
+
+It uses two kind of mocks:
+1) a mock with no implementation in the classloader
+2) a mock with an implementation in the classloader
+
+The mock answer from CDI is called *alternative*.
+
+Annotating `@Alternative` a class will mean it will replace any implementation if there is no other implementation
+or if it is forced (through `META-INF/beans.xml`).
+
+# Code explanation
+## main code
+
+We use an EJB `Jouney` to modelize a journey where the vehicle and the society can change. Here an EJB is used simply
+because it simplifies the test. A jouney wraps the vehicle and society information.
+
+We define then two interfaces to inject it in the `Journey` EJB: `Vehicle` and `Society`.
+
+Finally we add an implementation for `Scociety` interface: `LowCostCompanie`.
+
+If we don't go further `Journey` object will not be able to be created because no `Vehicle` implementation is available.
+
+Note: if we suppose we have a `Vehicle` implementation, the injected Society should be `LowCostCompanie`.
+
+## test code
+
+The goal here is to test our `Journey` EJB. So we have to provide a `Vehicle` implementation: `SuperCar`.
+
+We want to force the `Society` implementation (for any reason) by our test implementation: `AirOpenEJB`.
+
+One solution could simply be to add `@Alternative` annotation on `AirOpenEJB` and activate it through
+the `META-INF/beans.xml` file.
+
+Here we want to write more explicit code. So we want to replace the `@Alternative` annotation by `@Mock` one.
+
+So we simply define an `@Mock` annotation for classes, resolvable at runtime which is a stereotype (`@Stereotype`)
+which replace `@Alternative`.
+
+Here is the annotation:
+
+    @Stereotype // we define a stereotype
+    @Retention(RUNTIME) // resolvable at runtime
+    @Target(TYPE) // this annotation is a class level one
+    @Alternative // it replace @Alternative
+    public @interface Mock {}
+
+Note: you can add more CDI annotations after `@Alternative` and it will get the behavior expected (the scope for instance).
+
+So now we have our `@Mock` annotation which is a stereotype able to replace `@Alternative` annotation
+we simply add this annotation to our mocks.
+
+If you run it now you'll have this exception:
+
+    javax.enterprise.inject.UnsatisfiedResolutionException: Api type [org.superbiz.cdi.stereotype.Vehicle] is not found with the qualifiers
+    Qualifiers: [@javax.enterprise.inject.Default()]
+    for injection into Field Injection Point, field name :  vehicle, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[java.lang.Object,org.superbiz.cdi.stereotype.Journey], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
+
+It means the stereotype is not activated. To do it simply add it to your `META-INF/beans.xml`:
+
+    <alternatives>
+      <stereotype>org.superbiz.cdi.stereotype.Mock</stereotype>
+    </alternatives>
+
+Note: if you don't specify `AirOpenEJB` as `@Alternative` (done through our mock annotation) you'll get this exception:
+
+    Caused by: javax.enterprise.inject.AmbiguousResolutionException: There is more than one api type with : org.superbiz.cdi.stereotype.Society with qualifiers : Qualifiers: [@javax.enterprise.inject.Default()]
+    for injection into Field Injection Point, field name :  society, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[org.superbiz.cdi.stereotype.Journey,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
+    found beans:
+    AirOpenEJB, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.AirOpenEJB,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
+    LowCostCompanie, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.LowCostCompanie,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
+
+which simply means two implementations are available for the same injection point (`Journey.society`).
+
+# Conclusion
+
+With CDI it is really easy to define annotations with a strong meaning. You can define business annotations
+or simply technical annotations to simplify your code (as we did with the mock annotation).
+
+Note: if for instance you used qualifiers to inject societies you could have put all these qualifiers on
+the mock class or defined a `@SocietyMock` annotation to be able to inject the same implementation for
+all qualifiers in your tests.
+
+# Output
+
+    Running org.superbiz.cdi.stereotype.StereotypeTest
+    Apache OpenEJB 7.0.0-SNAPSHOT    build: 20111030-07:54
+    http://tomee.apache.org/
+    INFO - openejb.home = /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
+    INFO - openejb.base = /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
+    INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Found EjbModule in classpath: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/test-classes
+    INFO - Found EjbModule in classpath: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/classes
+    INFO - Beginning load: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/test-classes
+    INFO - Beginning load: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes/target/classes
+    INFO - Configuring enterprise application: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean cdi-alternative-and-stereotypes_test.Comp: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+    INFO - Auto-creating a container for bean Journey: Container(type=SINGLETON, id=Default Singleton Container)
+    INFO - Enterprise application "/opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes" loaded.
+    INFO - Assembling app: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes_test.Comp!org.apache.openejb.BeanContext$Comp")
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes_test.Comp")
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes.Comp!org.apache.openejb.BeanContext$Comp")
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/cdi-alternative-and-stereotypes.Comp")
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/Journey!org.superbiz.cdi.stereotype.Journey")
+    INFO - Jndi(name="java:global/cdi-alternative-and-stereotypes/Journey")
+    INFO - Jndi(name="java:global/EjbModule162291475/org.superbiz.cdi.stereotype.StereotypeTest!org.superbiz.cdi.stereotype.StereotypeTest")
+    INFO - Jndi(name="java:global/EjbModule162291475/org.superbiz.cdi.stereotype.StereotypeTest")
+    INFO - Created Ejb(deployment-id=cdi-alternative-and-stereotypes_test.Comp, ejb-name=cdi-alternative-and-stereotypes_test.Comp, container=Default Managed Container)
+    INFO - Created Ejb(deployment-id=cdi-alternative-and-stereotypes.Comp, ejb-name=cdi-alternative-and-stereotypes.Comp, container=Default Managed Container)
+    INFO - Created Ejb(deployment-id=org.superbiz.cdi.stereotype.StereotypeTest, ejb-name=org.superbiz.cdi.stereotype.StereotypeTest, container=Default Managed Container)
+    INFO - Created Ejb(deployment-id=Journey, ejb-name=Journey, container=Default Singleton Container)
+    INFO - Started Ejb(deployment-id=cdi-alternative-and-stereotypes_test.Comp, ejb-name=cdi-alternative-and-stereotypes_test.Comp, container=Default Managed Container)
+    INFO - Started Ejb(deployment-id=cdi-alternative-and-stereotypes.Comp, ejb-name=cdi-alternative-and-stereotypes.Comp, container=Default Managed Container)
+    INFO - Started Ejb(deployment-id=org.superbiz.cdi.stereotype.StereotypeTest, ejb-name=org.superbiz.cdi.stereotype.StereotypeTest, container=Default Managed Container)
+    INFO - Started Ejb(deployment-id=Journey, ejb-name=Journey, container=Default Singleton Container)
+    INFO - Deployed Application(path=/opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes)
+    INFO - Undeploying app: /opt/dev/openejb/openejb-trunk/examples/cdi-alternative-and-stereotypes

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Journey.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Journey.java b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Journey.java
index 5d02857..d5f3645 100644
--- a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Journey.java
+++ b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Journey.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-
-@Singleton
-public class Journey {
-
-    @Inject
-    private Vehicle vehicle;
-    @Inject
-    private Society society;
-
-    public String vehicle() {
-        return vehicle.name();
-    }
-
-    public String category() {
-        return society.category();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+
+@Singleton
+public class Journey {
+
+    @Inject
+    private Vehicle vehicle;
+    @Inject
+    private Society society;
+
+    public String vehicle() {
+        return vehicle.name();
+    }
+
+    public String category() {
+        return society.category();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/LowCostCompanie.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/LowCostCompanie.java b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/LowCostCompanie.java
index c57eaee..f3d634e 100644
--- a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/LowCostCompanie.java
+++ b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/LowCostCompanie.java
@@ -1,26 +1,26 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-public class LowCostCompanie implements Society {
-
-    @Override
-    public String category() {
-        return "maybe you'll leave...";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+public class LowCostCompanie implements Society {
+
+    @Override
+    public String category() {
+        return "maybe you'll leave...";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Society.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Society.java b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Society.java
index 465e4c5..d6e7007 100644
--- a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Society.java
+++ b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Society.java
@@ -1,23 +1,23 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-public interface Society {
-
-    String category();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+public interface Society {
+
+    String category();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Vehicle.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Vehicle.java b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Vehicle.java
index 84b11b7..ce1a39c 100644
--- a/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Vehicle.java
+++ b/examples/cdi-alternative-and-stereotypes/src/main/java/org/superbiz/cdi/stereotype/Vehicle.java
@@ -1,23 +1,23 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-public interface Vehicle {
-
-    String name();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+public interface Vehicle {
+
+    String name();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/AirOpenEJB.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/AirOpenEJB.java b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/AirOpenEJB.java
index bbf54a8..e289ddb 100644
--- a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/AirOpenEJB.java
+++ b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/AirOpenEJB.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-/**
- * without @Mock annotation which specifies this class as an alternative
- * you'll have this exception:
- * <p/>
- * Caused by: javax.enterprise.inject.AmbiguousResolutionException: There is more than one api type with : org.superbiz.cdi.stereotype.Society with qualifiers : Qualifiers: [@javax.enterprise.inject.Default()]
- * for injection into Field Injection Point, field name :  society, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[org.superbiz.cdi.stereotype.Journey,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
- * found beans:
- * AirOpenEJB, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.AirOpenEJB,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
- * LowCostCompanie, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.LowCostCompanie,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
- * <p/>
- * because 2 implementations match the same injection point (Journey.society).
- */
-@Mock
-public class AirOpenEJB implements Society {
-
-    @Override
-    public String category() {
-        return "simply the best";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+/**
+ * without @Mock annotation which specifies this class as an alternative
+ * you'll have this exception:
+ * <p/>
+ * Caused by: javax.enterprise.inject.AmbiguousResolutionException: There is more than one api type with : org.superbiz.cdi.stereotype.Society with qualifiers : Qualifiers: [@javax.enterprise.inject.Default()]
+ * for injection into Field Injection Point, field name :  society, Bean Owner : [Journey, Name:null, WebBeans Type:ENTERPRISE, API Types:[org.superbiz.cdi.stereotype.Journey,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
+ * found beans:
+ * AirOpenEJB, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.AirOpenEJB,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
+ * LowCostCompanie, Name:null, WebBeans Type:MANAGED, API Types:[org.superbiz.cdi.stereotype.Society,org.superbiz.cdi.stereotype.LowCostCompanie,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
+ * <p/>
+ * because 2 implementations match the same injection point (Journey.society).
+ */
+@Mock
+public class AirOpenEJB implements Society {
+
+    @Override
+    public String category() {
+        return "simply the best";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/Mock.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/Mock.java b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/Mock.java
index 805e1bb..7b116f9 100644
--- a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/Mock.java
+++ b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/Mock.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-import javax.enterprise.inject.Alternative;
-import javax.enterprise.inject.Stereotype;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-// defining a stereotype for class level
-@Stereotype
-@Retention(RUNTIME)
-@Target(TYPE)
-
-// here define all annotations you want to replace by this one.
-// this stereotype define an alternative
-@Alternative
-public @interface Mock {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+import javax.enterprise.inject.Alternative;
+import javax.enterprise.inject.Stereotype;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+// defining a stereotype for class level
+@Stereotype
+@Retention(RUNTIME)
+@Target(TYPE)
+
+// here define all annotations you want to replace by this one.
+// this stereotype define an alternative
+@Alternative
+public @interface Mock {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/StereotypeTest.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/StereotypeTest.java b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/StereotypeTest.java
index 4f999ce..eef8799 100644
--- a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/StereotypeTest.java
+++ b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/StereotypeTest.java
@@ -1,56 +1,56 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.NamingException;
-
-import static org.junit.Assert.assertEquals;
-
-public class StereotypeTest {
-
-    private static EJBContainer container;
-    private static Journey journey;
-
-    @BeforeClass
-    public static void start() throws NamingException {
-        container = EJBContainer.createEJBContainer();
-        journey = (Journey) container.getContext().lookup("java:global/cdi-alternative-and-stereotypes/Journey");
-    }
-
-    @AfterClass
-    public static void shutdown() {
-        if (container != null) {
-            container.close();
-        }
-    }
-
-    @Test
-    public void assertVehicleInjected() {
-        assertEquals("the fastest", journey.vehicle());
-    }
-
-    @Test
-    public void assertMockOverrideWorks() {
-        assertEquals("simply the best", journey.category());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
+
+import static org.junit.Assert.assertEquals;
+
+public class StereotypeTest {
+
+    private static EJBContainer container;
+    private static Journey journey;
+
+    @BeforeClass
+    public static void start() throws NamingException {
+        container = EJBContainer.createEJBContainer();
+        journey = (Journey) container.getContext().lookup("java:global/cdi-alternative-and-stereotypes/Journey");
+    }
+
+    @AfterClass
+    public static void shutdown() {
+        if (container != null) {
+            container.close();
+        }
+    }
+
+    @Test
+    public void assertVehicleInjected() {
+        assertEquals("the fastest", journey.vehicle());
+    }
+
+    @Test
+    public void assertMockOverrideWorks() {
+        assertEquals("simply the best", journey.category());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/SuperCar.java
----------------------------------------------------------------------
diff --git a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/SuperCar.java b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/SuperCar.java
index ae27fc4..2d14191 100644
--- a/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/SuperCar.java
+++ b/examples/cdi-alternative-and-stereotypes/src/test/java/org/superbiz/cdi/stereotype/SuperCar.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.cdi.stereotype;
-
-@Mock
-public class SuperCar implements Vehicle {
-
-    @Override
-    public String name() {
-        return "the fastest";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.cdi.stereotype;
+
+@Mock
+public class SuperCar implements Vehicle {
+
+    @Override
+    public String name() {
+        return "the fastest";
+    }
+}


[22/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/DynamicMBeanHandler.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/DynamicMBeanHandler.java b/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/DynamicMBeanHandler.java
index 5f86374..d07a705 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/DynamicMBeanHandler.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/DynamicMBeanHandler.java
@@ -1,260 +1,260 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean;
-
-import javax.annotation.PreDestroy;
-import javax.management.Attribute;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Need a @PreDestroy method to disconnect the remote host when used in remote mode.
- */
-public class DynamicMBeanHandler implements InvocationHandler {
-
-    private final Map<Method, ConnectionInfo> infos = new ConcurrentHashMap<Method, ConnectionInfo>();
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        final String methodName = method.getName();
-        if (method.getDeclaringClass().equals(Object.class) && "toString".equals(methodName)) {
-            return getClass().getSimpleName() + " Proxy";
-        }
-        if (method.getAnnotation(PreDestroy.class) != null) {
-            return destroy();
-        }
-
-        final ConnectionInfo info = getConnectionInfo(method);
-        final MBeanInfo infos = info.getMBeanInfo();
-        if (methodName.startsWith("set") && methodName.length() > 3 && args != null && args.length == 1
-            && (Void.TYPE.equals(method.getReturnType()) || Void.class.equals(method.getReturnType()))) {
-            final String attributeName = attributeName(infos, methodName, method.getParameterTypes()[0]);
-            info.setAttribute(new Attribute(attributeName, args[0]));
-            return null;
-        } else if (methodName.startsWith("get") && (args == null || args.length == 0) && methodName.length() > 3) {
-            final String attributeName = attributeName(infos, methodName, method.getReturnType());
-            return info.getAttribute(attributeName);
-        }
-        // operation
-        return info.invoke(methodName, args, getSignature(method));
-    }
-
-    public Object destroy() {
-        for (ConnectionInfo info : infos.values()) {
-            info.clean();
-        }
-        infos.clear();
-        return null;
-    }
-
-    private String[] getSignature(Method method) {
-        String[] args = new String[method.getParameterTypes().length];
-        for (int i = 0; i < method.getParameterTypes().length; i++) {
-            args[i] = method.getParameterTypes()[i].getName();
-        }
-        return args; // note: null should often work...
-    }
-
-    private String attributeName(MBeanInfo infos, String methodName, Class<?> type) {
-        String found = null;
-        String foundBackUp = null; // without checking the type
-        final String attributeName = methodName.substring(3, methodName.length());
-        final String lowerName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4, methodName.length());
-
-        for (MBeanAttributeInfo attribute : infos.getAttributes()) {
-            final String name = attribute.getName();
-            if (attributeName.equals(name)) {
-                foundBackUp = attributeName;
-                if (attribute.getType().equals(type.getName())) {
-                    found = name;
-                }
-            } else if (found == null && ((lowerName.equals(name) && !attributeName.equals(name))
-                                         || lowerName.equalsIgnoreCase(name))) {
-                foundBackUp = name;
-                if (attribute.getType().equals(type.getName())) {
-                    found = name;
-                }
-            }
-        }
-
-        if (found == null && foundBackUp == null) {
-            throw new UnsupportedOperationException("cannot find attribute " + attributeName);
-        }
-
-        if (found != null) {
-            return found;
-        }
-        return foundBackUp;
-    }
-
-    private synchronized ConnectionInfo getConnectionInfo(Method method) throws Exception {
-        if (!infos.containsKey(method)) {
-            synchronized (infos) {
-                if (!infos.containsKey(method)) { // double check for synchro
-                    org.superbiz.dynamic.mbean.ObjectName on = method.getAnnotation(org.superbiz.dynamic.mbean.ObjectName.class);
-                    if (on == null) {
-                        Class<?> current = method.getDeclaringClass();
-                        do {
-                            on = method.getDeclaringClass().getAnnotation(org.superbiz.dynamic.mbean.ObjectName.class);
-                            current = current.getSuperclass();
-                        } while (on == null && current != null);
-                        if (on == null) {
-                            throw new UnsupportedOperationException("class or method should define the objectName to use for invocation: " + method.toGenericString());
-                        }
-                    }
-                    final ConnectionInfo info;
-                    if (on.url().isEmpty()) {
-                        info = new LocalConnectionInfo();
-                        ((LocalConnectionInfo) info).server = ManagementFactory.getPlatformMBeanServer(); // could use an id...
-                    } else {
-                        info = new RemoteConnectionInfo();
-                        final Map<String, String[]> environment = new HashMap<String, String[]>();
-                        if (!on.user().isEmpty()) {
-                            environment.put(JMXConnector.CREDENTIALS, new String[]{on.user(), on.password()});
-                        }
-                        // ((RemoteConnectionInfo) info).connector = JMXConnectorFactory.newJMXConnector(new JMXServiceURL(on.url()), environment);
-                        ((RemoteConnectionInfo) info).connector = JMXConnectorFactory.connect(new JMXServiceURL(on.url()), environment);
-
-                    }
-                    info.objectName = new ObjectName(on.value());
-
-                    infos.put(method, info);
-                }
-            }
-        }
-        return infos.get(method);
-    }
-
-    private abstract static class ConnectionInfo {
-
-        protected ObjectName objectName;
-
-        public abstract void setAttribute(Attribute attribute) throws Exception;
-
-        public abstract Object getAttribute(String attribute) throws Exception;
-
-        public abstract Object invoke(String operationName, Object params[], String signature[]) throws Exception;
-
-        public abstract MBeanInfo getMBeanInfo() throws Exception;
-
-        public abstract void clean();
-    }
-
-    private static class LocalConnectionInfo extends ConnectionInfo {
-
-        private MBeanServer server;
-
-        @Override
-        public void setAttribute(Attribute attribute) throws Exception {
-            server.setAttribute(objectName, attribute);
-        }
-
-        @Override
-        public Object getAttribute(String attribute) throws Exception {
-            return server.getAttribute(objectName, attribute);
-        }
-
-        @Override
-        public Object invoke(String operationName, Object[] params, String[] signature) throws Exception {
-            return server.invoke(objectName, operationName, params, signature);
-        }
-
-        @Override
-        public MBeanInfo getMBeanInfo() throws Exception {
-            return server.getMBeanInfo(objectName);
-        }
-
-        @Override
-        public void clean() {
-            // no-op
-        }
-    }
-
-    private static class RemoteConnectionInfo extends ConnectionInfo {
-
-        private JMXConnector connector;
-        private MBeanServerConnection connection;
-
-        private void before() throws IOException {
-            connection = connector.getMBeanServerConnection();
-        }
-
-        private void after() throws IOException {
-            // no-op
-        }
-
-        @Override
-        public void setAttribute(Attribute attribute) throws Exception {
-            before();
-            connection.setAttribute(objectName, attribute);
-            after();
-        }
-
-        @Override
-        public Object getAttribute(String attribute) throws Exception {
-            before();
-            try {
-                return connection.getAttribute(objectName, attribute);
-            } finally {
-                after();
-            }
-        }
-
-        @Override
-        public Object invoke(String operationName, Object[] params, String[] signature) throws Exception {
-            before();
-            try {
-                return connection.invoke(objectName, operationName, params, signature);
-            } finally {
-                after();
-            }
-        }
-
-        @Override
-        public MBeanInfo getMBeanInfo() throws Exception {
-            before();
-            try {
-                return connection.getMBeanInfo(objectName);
-            } finally {
-                after();
-            }
-        }
-
-        @Override
-        public void clean() {
-            try {
-                connector.close();
-            } catch (IOException e) {
-                // no-op
-            }
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean;
+
+import javax.annotation.PreDestroy;
+import javax.management.Attribute;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Need a @PreDestroy method to disconnect the remote host when used in remote mode.
+ */
+public class DynamicMBeanHandler implements InvocationHandler {
+
+    private final Map<Method, ConnectionInfo> infos = new ConcurrentHashMap<Method, ConnectionInfo>();
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        final String methodName = method.getName();
+        if (method.getDeclaringClass().equals(Object.class) && "toString".equals(methodName)) {
+            return getClass().getSimpleName() + " Proxy";
+        }
+        if (method.getAnnotation(PreDestroy.class) != null) {
+            return destroy();
+        }
+
+        final ConnectionInfo info = getConnectionInfo(method);
+        final MBeanInfo infos = info.getMBeanInfo();
+        if (methodName.startsWith("set") && methodName.length() > 3 && args != null && args.length == 1
+                && (Void.TYPE.equals(method.getReturnType()) || Void.class.equals(method.getReturnType()))) {
+            final String attributeName = attributeName(infos, methodName, method.getParameterTypes()[0]);
+            info.setAttribute(new Attribute(attributeName, args[0]));
+            return null;
+        } else if (methodName.startsWith("get") && (args == null || args.length == 0) && methodName.length() > 3) {
+            final String attributeName = attributeName(infos, methodName, method.getReturnType());
+            return info.getAttribute(attributeName);
+        }
+        // operation
+        return info.invoke(methodName, args, getSignature(method));
+    }
+
+    public Object destroy() {
+        for (ConnectionInfo info : infos.values()) {
+            info.clean();
+        }
+        infos.clear();
+        return null;
+    }
+
+    private String[] getSignature(Method method) {
+        String[] args = new String[method.getParameterTypes().length];
+        for (int i = 0; i < method.getParameterTypes().length; i++) {
+            args[i] = method.getParameterTypes()[i].getName();
+        }
+        return args; // note: null should often work...
+    }
+
+    private String attributeName(MBeanInfo infos, String methodName, Class<?> type) {
+        String found = null;
+        String foundBackUp = null; // without checking the type
+        final String attributeName = methodName.substring(3, methodName.length());
+        final String lowerName = Character.toLowerCase(methodName.charAt(3)) + methodName.substring(4, methodName.length());
+
+        for (MBeanAttributeInfo attribute : infos.getAttributes()) {
+            final String name = attribute.getName();
+            if (attributeName.equals(name)) {
+                foundBackUp = attributeName;
+                if (attribute.getType().equals(type.getName())) {
+                    found = name;
+                }
+            } else if (found == null && ((lowerName.equals(name) && !attributeName.equals(name))
+                    || lowerName.equalsIgnoreCase(name))) {
+                foundBackUp = name;
+                if (attribute.getType().equals(type.getName())) {
+                    found = name;
+                }
+            }
+        }
+
+        if (found == null && foundBackUp == null) {
+            throw new UnsupportedOperationException("cannot find attribute " + attributeName);
+        }
+
+        if (found != null) {
+            return found;
+        }
+        return foundBackUp;
+    }
+
+    private synchronized ConnectionInfo getConnectionInfo(Method method) throws Exception {
+        if (!infos.containsKey(method)) {
+            synchronized (infos) {
+                if (!infos.containsKey(method)) { // double check for synchro
+                    org.superbiz.dynamic.mbean.ObjectName on = method.getAnnotation(org.superbiz.dynamic.mbean.ObjectName.class);
+                    if (on == null) {
+                        Class<?> current = method.getDeclaringClass();
+                        do {
+                            on = method.getDeclaringClass().getAnnotation(org.superbiz.dynamic.mbean.ObjectName.class);
+                            current = current.getSuperclass();
+                        } while (on == null && current != null);
+                        if (on == null) {
+                            throw new UnsupportedOperationException("class or method should define the objectName to use for invocation: " + method.toGenericString());
+                        }
+                    }
+                    final ConnectionInfo info;
+                    if (on.url().isEmpty()) {
+                        info = new LocalConnectionInfo();
+                        ((LocalConnectionInfo) info).server = ManagementFactory.getPlatformMBeanServer(); // could use an id...
+                    } else {
+                        info = new RemoteConnectionInfo();
+                        final Map<String, String[]> environment = new HashMap<String, String[]>();
+                        if (!on.user().isEmpty()) {
+                            environment.put(JMXConnector.CREDENTIALS, new String[]{on.user(), on.password()});
+                        }
+                        // ((RemoteConnectionInfo) info).connector = JMXConnectorFactory.newJMXConnector(new JMXServiceURL(on.url()), environment);
+                        ((RemoteConnectionInfo) info).connector = JMXConnectorFactory.connect(new JMXServiceURL(on.url()), environment);
+
+                    }
+                    info.objectName = new ObjectName(on.value());
+
+                    infos.put(method, info);
+                }
+            }
+        }
+        return infos.get(method);
+    }
+
+    private abstract static class ConnectionInfo {
+
+        protected ObjectName objectName;
+
+        public abstract void setAttribute(Attribute attribute) throws Exception;
+
+        public abstract Object getAttribute(String attribute) throws Exception;
+
+        public abstract Object invoke(String operationName, Object params[], String signature[]) throws Exception;
+
+        public abstract MBeanInfo getMBeanInfo() throws Exception;
+
+        public abstract void clean();
+    }
+
+    private static class LocalConnectionInfo extends ConnectionInfo {
+
+        private MBeanServer server;
+
+        @Override
+        public void setAttribute(Attribute attribute) throws Exception {
+            server.setAttribute(objectName, attribute);
+        }
+
+        @Override
+        public Object getAttribute(String attribute) throws Exception {
+            return server.getAttribute(objectName, attribute);
+        }
+
+        @Override
+        public Object invoke(String operationName, Object[] params, String[] signature) throws Exception {
+            return server.invoke(objectName, operationName, params, signature);
+        }
+
+        @Override
+        public MBeanInfo getMBeanInfo() throws Exception {
+            return server.getMBeanInfo(objectName);
+        }
+
+        @Override
+        public void clean() {
+            // no-op
+        }
+    }
+
+    private static class RemoteConnectionInfo extends ConnectionInfo {
+
+        private JMXConnector connector;
+        private MBeanServerConnection connection;
+
+        private void before() throws IOException {
+            connection = connector.getMBeanServerConnection();
+        }
+
+        private void after() throws IOException {
+            // no-op
+        }
+
+        @Override
+        public void setAttribute(Attribute attribute) throws Exception {
+            before();
+            connection.setAttribute(objectName, attribute);
+            after();
+        }
+
+        @Override
+        public Object getAttribute(String attribute) throws Exception {
+            before();
+            try {
+                return connection.getAttribute(objectName, attribute);
+            } finally {
+                after();
+            }
+        }
+
+        @Override
+        public Object invoke(String operationName, Object[] params, String[] signature) throws Exception {
+            before();
+            try {
+                return connection.invoke(objectName, operationName, params, signature);
+            } finally {
+                after();
+            }
+        }
+
+        @Override
+        public MBeanInfo getMBeanInfo() throws Exception {
+            before();
+            try {
+                return connection.getMBeanInfo(objectName);
+            } finally {
+                after();
+            }
+        }
+
+        @Override
+        public void clean() {
+            try {
+                connector.close();
+            } catch (IOException e) {
+                // no-op
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/ObjectName.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/ObjectName.java b/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/ObjectName.java
index 21b9a77..69c4ab1 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/ObjectName.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/main/java/org/superbiz/dynamic/mbean/ObjectName.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-public @interface ObjectName {
-
-    String value();
-
-    // for remote usage only
-    String url() default "";
-
-    String user() default "";
-
-    String password() default "";
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface ObjectName {
+
+    String value();
+
+    // for remote usage only
+    String url() default "";
+
+    String user() default "";
+
+    String password() default "";
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClient.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClient.java b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClient.java
index 8ecee58..57a16cf 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClient.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClient.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean;
-
-import org.apache.openejb.api.Proxy;
-
-import javax.ejb.Singleton;
-
-@Singleton
-@Proxy(DynamicMBeanHandler.class)
-@ObjectName(DynamicMBeanClient.OBJECT_NAME)
-public interface DynamicMBeanClient {
-
-    static final String OBJECT_NAME = "test:group=DynamicMBeanClientTest";
-
-    int getCounter();
-
-    void setCounter(int i);
-
-    int length(String aString);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean;
+
+import org.apache.openejb.api.Proxy;
+
+import javax.ejb.Singleton;
+
+@Singleton
+@Proxy(DynamicMBeanHandler.class)
+@ObjectName(DynamicMBeanClient.OBJECT_NAME)
+public interface DynamicMBeanClient {
+
+    static final String OBJECT_NAME = "test:group=DynamicMBeanClientTest";
+
+    int getCounter();
+
+    void setCounter(int i);
+
+    int length(String aString);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClientTest.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClientTest.java b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClientTest.java
index dfd24f7..81da560 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClientTest.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicMBeanClientTest.java
@@ -1,108 +1,108 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.superbiz.dynamic.mbean.simple.Simple;
-
-import javax.ejb.EJB;
-import javax.ejb.embeddable.EJBContainer;
-import javax.management.Attribute;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-
-import static org.junit.Assert.assertEquals;
-
-public class DynamicMBeanClientTest {
-
-    private static ObjectName objectName;
-    private static EJBContainer container;
-
-    @EJB
-    private DynamicMBeanClient localClient;
-    @EJB
-    private DynamicRemoteMBeanClient remoteClient;
-
-    @BeforeClass
-    public static void start() {
-        container = EJBContainer.createEJBContainer();
-    }
-
-    @Before
-    public void injectAndRegisterMBean() throws Exception {
-        container.getContext().bind("inject", this);
-        objectName = new ObjectName(DynamicMBeanClient.OBJECT_NAME);
-        ManagementFactory.getPlatformMBeanServer().registerMBean(new Simple(), objectName);
-    }
-
-    @After
-    public void unregisterMBean() throws Exception {
-        if (objectName != null) {
-            ManagementFactory.getPlatformMBeanServer().unregisterMBean(objectName);
-        }
-    }
-
-    @Test
-    public void localGet() throws Exception {
-        assertEquals(0, localClient.getCounter());
-        ManagementFactory.getPlatformMBeanServer().setAttribute(objectName, new Attribute("Counter", 5));
-        assertEquals(5, localClient.getCounter());
-    }
-
-    @Test
-    public void localSet() throws Exception {
-        assertEquals(0, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
-        localClient.setCounter(8);
-        assertEquals(8, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
-    }
-
-    @Test
-    public void localOperation() {
-        assertEquals(7, localClient.length("openejb"));
-    }
-
-    @Test
-    public void remoteGet() throws Exception {
-        assertEquals(0, remoteClient.getCounter());
-        ManagementFactory.getPlatformMBeanServer().setAttribute(objectName, new Attribute("Counter", 5));
-        assertEquals(5, remoteClient.getCounter());
-    }
-
-    @Test
-    public void remoteSet() throws Exception {
-        assertEquals(0, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
-        remoteClient.setCounter(8);
-        assertEquals(8, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
-    }
-
-    @Test
-    public void remoteOperation() {
-        assertEquals(7, remoteClient.length("openejb"));
-    }
-
-    @AfterClass
-    public static void close() {
-        if (container != null) {
-            container.close();
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.superbiz.dynamic.mbean.simple.Simple;
+
+import javax.ejb.EJB;
+import javax.ejb.embeddable.EJBContainer;
+import javax.management.Attribute;
+import javax.management.ObjectName;
+import java.lang.management.ManagementFactory;
+
+import static org.junit.Assert.assertEquals;
+
+public class DynamicMBeanClientTest {
+
+    private static ObjectName objectName;
+    private static EJBContainer container;
+
+    @EJB
+    private DynamicMBeanClient localClient;
+    @EJB
+    private DynamicRemoteMBeanClient remoteClient;
+
+    @BeforeClass
+    public static void start() {
+        container = EJBContainer.createEJBContainer();
+    }
+
+    @Before
+    public void injectAndRegisterMBean() throws Exception {
+        container.getContext().bind("inject", this);
+        objectName = new ObjectName(DynamicMBeanClient.OBJECT_NAME);
+        ManagementFactory.getPlatformMBeanServer().registerMBean(new Simple(), objectName);
+    }
+
+    @After
+    public void unregisterMBean() throws Exception {
+        if (objectName != null) {
+            ManagementFactory.getPlatformMBeanServer().unregisterMBean(objectName);
+        }
+    }
+
+    @Test
+    public void localGet() throws Exception {
+        assertEquals(0, localClient.getCounter());
+        ManagementFactory.getPlatformMBeanServer().setAttribute(objectName, new Attribute("Counter", 5));
+        assertEquals(5, localClient.getCounter());
+    }
+
+    @Test
+    public void localSet() throws Exception {
+        assertEquals(0, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
+        localClient.setCounter(8);
+        assertEquals(8, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
+    }
+
+    @Test
+    public void localOperation() {
+        assertEquals(7, localClient.length("openejb"));
+    }
+
+    @Test
+    public void remoteGet() throws Exception {
+        assertEquals(0, remoteClient.getCounter());
+        ManagementFactory.getPlatformMBeanServer().setAttribute(objectName, new Attribute("Counter", 5));
+        assertEquals(5, remoteClient.getCounter());
+    }
+
+    @Test
+    public void remoteSet() throws Exception {
+        assertEquals(0, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
+        remoteClient.setCounter(8);
+        assertEquals(8, ((Integer) ManagementFactory.getPlatformMBeanServer().getAttribute(objectName, "Counter")).intValue());
+    }
+
+    @Test
+    public void remoteOperation() {
+        assertEquals(7, remoteClient.length("openejb"));
+    }
+
+    @AfterClass
+    public static void close() {
+        if (container != null) {
+            container.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicRemoteMBeanClient.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicRemoteMBeanClient.java b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicRemoteMBeanClient.java
index 2051c99..d626517 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicRemoteMBeanClient.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/DynamicRemoteMBeanClient.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean;
-
-import org.apache.openejb.api.Proxy;
-
-import javax.annotation.PreDestroy;
-import javax.ejb.Singleton;
-
-@Singleton
-@Proxy(DynamicMBeanHandler.class)
-@ObjectName(value = DynamicRemoteMBeanClient.OBJECT_NAME, url = "service:jmx:rmi:///jndi/rmi://localhost:8243/jmxrmi")
-public interface DynamicRemoteMBeanClient {
-
-    static final String OBJECT_NAME = "test:group=DynamicMBeanClientTest";
-
-    int getCounter();
-
-    void setCounter(int i);
-
-    int length(String aString);
-
-    @PreDestroy
-    void clean();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean;
+
+import org.apache.openejb.api.Proxy;
+
+import javax.annotation.PreDestroy;
+import javax.ejb.Singleton;
+
+@Singleton
+@Proxy(DynamicMBeanHandler.class)
+@ObjectName(value = DynamicRemoteMBeanClient.OBJECT_NAME, url = "service:jmx:rmi:///jndi/rmi://localhost:8243/jmxrmi")
+public interface DynamicRemoteMBeanClient {
+
+    static final String OBJECT_NAME = "test:group=DynamicMBeanClientTest";
+
+    int getCounter();
+
+    void setCounter(int i);
+
+    int length(String aString);
+
+    @PreDestroy
+    void clean();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/Simple.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/Simple.java b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/Simple.java
index de5fec6..aaceacf 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/Simple.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/Simple.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean.simple;
-
-public class Simple implements SimpleMBean {
-
-    private int counter = 0;
-
-    @Override
-    public int length(String s) {
-        if (s == null) {
-            return 0;
-        }
-        return s.length();
-    }
-
-    @Override
-    public int getCounter() {
-        return counter;
-    }
-
-    @Override
-    public void setCounter(int c) {
-        counter = c;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean.simple;
+
+public class Simple implements SimpleMBean {
+
+    private int counter = 0;
+
+    @Override
+    public int length(String s) {
+        if (s == null) {
+            return 0;
+        }
+        return s.length();
+    }
+
+    @Override
+    public int getCounter() {
+        return counter;
+    }
+
+    @Override
+    public void setCounter(int c) {
+        counter = c;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/SimpleMBean.java
----------------------------------------------------------------------
diff --git a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/SimpleMBean.java b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/SimpleMBean.java
index 1b176bd..0b4b8de 100644
--- a/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/SimpleMBean.java
+++ b/examples/dynamic-proxy-to-access-mbean/src/test/java/org/superbiz/dynamic/mbean/simple/SimpleMBean.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.dynamic.mbean.simple;
-
-public interface SimpleMBean {
-
-    int length(String s);
-
-    int getCounter();
-
-    void setCounter(int c);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.dynamic.mbean.simple;
+
+public interface SimpleMBean {
+
+    int length(String s);
+
+    int getCounter();
+
+    void setCounter(int c);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ear-testing/README.md
----------------------------------------------------------------------
diff --git a/examples/ear-testing/README.md b/examples/ear-testing/README.md
index 3d00e68..ab6c2ab 100644
--- a/examples/ear-testing/README.md
+++ b/examples/ear-testing/README.md
@@ -1,212 +1,212 @@
-Title: EAR Testing
-
-The goal of this example is to demonstrate how maven projects might be organized in a more real world style and how testing with OpenEJB can fit into that structure.
-
-This example takes the basic moviefun code we us in many of examples and splits it into two modules:
-
- - `business-logic`
- - `business-model`
-
-As the names imply, we keep our `@Entity` beans in the `business-model` module and our session beans in the `business-logic` model.  The tests located and run from the business logic module.
-
-    ear-testing
-    ear-testing/business-logic
-    ear-testing/business-logic/pom.xml
-    ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
-    ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
-    ear-testing/business-logic/src/main/resources
-    ear-testing/business-logic/src/main/resources/META-INF
-    ear-testing/business-logic/src/main/resources/META-INF/ejb-jar.xml
-    ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
-    ear-testing/business-model
-    ear-testing/business-model/pom.xml
-    ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
-    ear-testing/business-model/src/main/resources/META-INF/persistence.xml
-    ear-testing/pom.xml
-
-# Project configuration
-
-The parent pom, trimmed to the minimum, looks like so:
-
-    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-      <modelVersion>4.0.0</modelVersion>
-      <groupId>org.superbiz</groupId>
-      <artifactId>myear</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-
-      <packaging>pom</packaging>
-
-      <modules>
-        <module>business-model</module>
-        <module>business-logic</module>
-      </modules>
-
-      <dependencyManagement>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.openejb</groupId>
-            <artifactId>javaee-api</artifactId>
-            <version>6.0-2</version>
-          </dependency>
-          <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.8.1</version>
-          </dependency>
-        </dependencies>
-      </dependencyManagement>
-    </project>
-
-The `business-model/pom.xml` as follows:
-
-    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-      <parent>
-        <groupId>org.superbiz</groupId>
-        <artifactId>myear</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-      </parent>
-
-      <modelVersion>4.0.0</modelVersion>
-
-      <artifactId>business-model</artifactId>
-      <packaging>jar</packaging>
-
-      <dependencies>
-        <dependency>
-          <groupId>org.apache.openejb</groupId>
-          <artifactId>javaee-api</artifactId>
-          <scope>provided</scope>
-        </dependency>
-        <dependency>
-          <groupId>junit</groupId>
-          <artifactId>junit</artifactId>
-          <scope>test</scope>
-        </dependency>
-
-      </dependencies>
-
-    </project>
-
-And finally, the `business-logic/pom.xml` which is setup to support embedded testing with OpenEJB:
-
-    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-      <parent>
-        <groupId>org.superbiz</groupId>
-        <artifactId>myear</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-      </parent>
-
-      <modelVersion>4.0.0</modelVersion>
-
-      <artifactId>business-logic</artifactId>
-      <packaging>jar</packaging>
-
-      <dependencies>
-        <dependency>
-          <groupId>org.superbiz</groupId>
-          <artifactId>business-model</artifactId>
-          <version>${project.version}</version>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.openejb</groupId>
-          <artifactId>javaee-api</artifactId>
-          <scope>provided</scope>
-        </dependency>
-        <dependency>
-          <groupId>junit</groupId>
-          <artifactId>junit</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <!--
-        The <scope>test</scope> guarantees that non of your runtime
-        code is dependent on any OpenEJB classes.
-        -->
-        <dependency>
-          <groupId>org.apache.openejb</groupId>
-          <artifactId>openejb-core</artifactId>
-          <version>4.0.0-beta-1</version>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </project>
-
-# TestCode
-
-The test code is the same as always:
-
-    public class MoviesTest extends TestCase {
-
-        public void test() throws Exception {
-            Properties p = new Properties();
-            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-
-            p.put("openejb.deployments.classpath.ear", "true");
-
-            p.put("movieDatabase", "new://Resource?type=DataSource");
-            p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-            p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-            p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
-            p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
-            p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-            p.put("movieDatabaseUnmanaged.JtaManaged", "false");
-
-            Context context = new InitialContext(p);
-
-            Movies movies = (Movies) context.lookup("MoviesLocal");
-
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-        }
-    }
-
-
-# Running
-
-
-    -------------------------------------------------------
-     T E S T S
-    -------------------------------------------------------
-    Running org.superbiz.logic.MoviesTest
-    Apache OpenEJB 4.0.0-beta-1    build: 20111002-04:06
-    http://tomee.apache.org/
-    INFO - openejb.home = /Users/dblevins/examples/ear-testing/business-logic
-    INFO - openejb.base = /Users/dblevins/examples/ear-testing/business-logic
-    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Configuring Service(id=movieDatabaseUnmanaged, type=Resource, provider-id=Default JDBC Database)
-    INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
-    INFO - Found PersistenceModule in classpath: /Users/dblevins/examples/ear-testing/business-model/target/business-model-1.0.jar
-    INFO - Found EjbModule in classpath: /Users/dblevins/examples/ear-testing/business-logic/target/classes
-    INFO - Using 'openejb.deployments.classpath.ear=true'
-    INFO - Beginning load: /Users/dblevins/examples/ear-testing/business-model/target/business-model-1.0.jar
-    INFO - Beginning load: /Users/dblevins/examples/ear-testing/business-logic/target/classes
-    INFO - Configuring enterprise application: /Users/dblevins/examples/ear-testing/business-logic/classpath.ear
-    INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container)
-    INFO - Auto-creating a container for bean Movies: Container(type=STATEFUL, id=Default Stateful Container)
-    INFO - Configuring PersistenceUnit(name=movie-unit)
-    INFO - Enterprise application "/Users/dblevins/examples/ear-testing/business-logic/classpath.ear" loaded.
-    INFO - Assembling app: /Users/dblevins/examples/ear-testing/business-logic/classpath.ear
-    INFO - PersistenceUnit(name=movie-unit, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 415ms
-    INFO - Jndi(name=MoviesLocal) --> Ejb(deployment-id=Movies)
-    INFO - Jndi(name=global/classpath.ear/business-logic/Movies!org.superbiz.logic.Movies) --> Ejb(deployment-id=Movies)
-    INFO - Jndi(name=global/classpath.ear/business-logic/Movies) --> Ejb(deployment-id=Movies)
-    INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
-    INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
-    INFO - Deployed Application(path=/Users/dblevins/examples/ear-testing/business-logic/classpath.ear)
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.393 sec
-
-    Results :
-
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+Title: EAR Testing
+
+The goal of this example is to demonstrate how maven projects might be organized in a more real world style and how testing with OpenEJB can fit into that structure.
+
+This example takes the basic moviefun code we us in many of examples and splits it into two modules:
+
+ - `business-logic`
+ - `business-model`
+
+As the names imply, we keep our `@Entity` beans in the `business-model` module and our session beans in the `business-logic` model.  The tests located and run from the business logic module.
+
+    ear-testing
+    ear-testing/business-logic
+    ear-testing/business-logic/pom.xml
+    ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
+    ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
+    ear-testing/business-logic/src/main/resources
+    ear-testing/business-logic/src/main/resources/META-INF
+    ear-testing/business-logic/src/main/resources/META-INF/ejb-jar.xml
+    ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
+    ear-testing/business-model
+    ear-testing/business-model/pom.xml
+    ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
+    ear-testing/business-model/src/main/resources/META-INF/persistence.xml
+    ear-testing/pom.xml
+
+# Project configuration
+
+The parent pom, trimmed to the minimum, looks like so:
+
+    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+      <modelVersion>4.0.0</modelVersion>
+      <groupId>org.superbiz</groupId>
+      <artifactId>myear</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+
+      <packaging>pom</packaging>
+
+      <modules>
+        <module>business-model</module>
+        <module>business-logic</module>
+      </modules>
+
+      <dependencyManagement>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>javaee-api</artifactId>
+            <version>6.0-2</version>
+          </dependency>
+          <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.1</version>
+          </dependency>
+        </dependencies>
+      </dependencyManagement>
+    </project>
+
+The `business-model/pom.xml` as follows:
+
+    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+      <parent>
+        <groupId>org.superbiz</groupId>
+        <artifactId>myear</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+      </parent>
+
+      <modelVersion>4.0.0</modelVersion>
+
+      <artifactId>business-model</artifactId>
+      <packaging>jar</packaging>
+
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.openejb</groupId>
+          <artifactId>javaee-api</artifactId>
+          <scope>provided</scope>
+        </dependency>
+        <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+          <scope>test</scope>
+        </dependency>
+
+      </dependencies>
+
+    </project>
+
+And finally, the `business-logic/pom.xml` which is setup to support embedded testing with OpenEJB:
+
+    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+      <parent>
+        <groupId>org.superbiz</groupId>
+        <artifactId>myear</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+      </parent>
+
+      <modelVersion>4.0.0</modelVersion>
+
+      <artifactId>business-logic</artifactId>
+      <packaging>jar</packaging>
+
+      <dependencies>
+        <dependency>
+          <groupId>org.superbiz</groupId>
+          <artifactId>business-model</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.openejb</groupId>
+          <artifactId>javaee-api</artifactId>
+          <scope>provided</scope>
+        </dependency>
+        <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <!--
+        The <scope>test</scope> guarantees that non of your runtime
+        code is dependent on any OpenEJB classes.
+        -->
+        <dependency>
+          <groupId>org.apache.openejb</groupId>
+          <artifactId>openejb-core</artifactId>
+          <version>7.0.0-SNAPSHOT</version>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+    </project>
+
+# TestCode
+
+The test code is the same as always:
+
+    public class MoviesTest extends TestCase {
+
+        public void test() throws Exception {
+            Properties p = new Properties();
+            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+            p.put("openejb.deployments.classpath.ear", "true");
+
+            p.put("movieDatabase", "new://Resource?type=DataSource");
+            p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+            p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+            p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
+            p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
+            p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+            p.put("movieDatabaseUnmanaged.JtaManaged", "false");
+
+            Context context = new InitialContext(p);
+
+            Movies movies = (Movies) context.lookup("MoviesLocal");
+
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+        }
+    }
+
+
+# Running
+
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.logic.MoviesTest
+    Apache OpenEJB 7.0.0-SNAPSHOT    build: 20111002-04:06
+    http://tomee.apache.org/
+    INFO - openejb.home = /Users/dblevins/examples/ear-testing/business-logic
+    INFO - openejb.base = /Users/dblevins/examples/ear-testing/business-logic
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Configuring Service(id=movieDatabaseUnmanaged, type=Resource, provider-id=Default JDBC Database)
+    INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
+    INFO - Found PersistenceModule in classpath: /Users/dblevins/examples/ear-testing/business-model/target/business-model-1.0.jar
+    INFO - Found EjbModule in classpath: /Users/dblevins/examples/ear-testing/business-logic/target/classes
+    INFO - Using 'openejb.deployments.classpath.ear=true'
+    INFO - Beginning load: /Users/dblevins/examples/ear-testing/business-model/target/business-model-1.0.jar
+    INFO - Beginning load: /Users/dblevins/examples/ear-testing/business-logic/target/classes
+    INFO - Configuring enterprise application: /Users/dblevins/examples/ear-testing/business-logic/classpath.ear
+    INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container)
+    INFO - Auto-creating a container for bean Movies: Container(type=STATEFUL, id=Default Stateful Container)
+    INFO - Configuring PersistenceUnit(name=movie-unit)
+    INFO - Enterprise application "/Users/dblevins/examples/ear-testing/business-logic/classpath.ear" loaded.
+    INFO - Assembling app: /Users/dblevins/examples/ear-testing/business-logic/classpath.ear
+    INFO - PersistenceUnit(name=movie-unit, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 415ms
+    INFO - Jndi(name=MoviesLocal) --> Ejb(deployment-id=Movies)
+    INFO - Jndi(name=global/classpath.ear/business-logic/Movies!org.superbiz.logic.Movies) --> Ejb(deployment-id=Movies)
+    INFO - Jndi(name=global/classpath.ear/business-logic/Movies) --> Ejb(deployment-id=Movies)
+    INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
+    INFO - Started Ejb(deployment-id=Movies, ejb-name=Movies, container=Default Stateful Container)
+    INFO - Deployed Application(path=/Users/dblevins/examples/ear-testing/business-logic/classpath.ear)
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.393 sec
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
----------------------------------------------------------------------
diff --git a/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java b/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
index 02e09e2..b5401a0 100644
--- a/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
+++ b/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/Movies.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.logic;
-
-import org.superbiz.model.Movie;
-
-import java.util.List;
-
-/**
- * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
- */
-public interface Movies {
-
-    void addMovie(Movie movie) throws Exception;
-
-    void deleteMovie(Movie movie) throws Exception;
-
-    List<Movie> getMovies() throws Exception;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.logic;
+
+import org.superbiz.model.Movie;
+
+import java.util.List;
+
+/**
+ * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
+ */
+public interface Movies {
+
+    void addMovie(Movie movie) throws Exception;
+
+    void deleteMovie(Movie movie) throws Exception;
+
+    List<Movie> getMovies() throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
----------------------------------------------------------------------
diff --git a/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java b/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
index a78c761..d13f845 100644
--- a/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
+++ b/examples/ear-testing/business-logic/src/main/java/org/superbiz/logic/MoviesImpl.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.logic;
-
-//START SNIPPET: code
-
-import org.superbiz.model.Movie;
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful(name = "Movies")
-public class MoviesImpl implements Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.logic;
+
+//START SNIPPET: code
+
+import org.superbiz.model.Movie;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful(name = "Movies")
+public class MoviesImpl implements Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java b/examples/ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
index b589ff4..db6d1b5 100644
--- a/examples/ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
+++ b/examples/ear-testing/business-logic/src/test/java/org/superbiz/logic/MoviesTest.java
@@ -1,64 +1,64 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.logic;
-
-import junit.framework.TestCase;
-import org.superbiz.model.Movie;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-
-        p.put("openejb.deployments.classpath.ear", "true");
-
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
-        p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
-
-        Context context = new InitialContext(p);
-
-        Movies movies = (Movies) context.lookup("MoviesLocal");
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.logic;
+
+import junit.framework.TestCase;
+import org.superbiz.model.Movie;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+        p.put("openejb.deployments.classpath.ear", "true");
+
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
+        p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
+
+        Context context = new InitialContext(p);
+
+        Movies movies = (Movies) context.lookup("MoviesLocal");
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
----------------------------------------------------------------------
diff --git a/examples/ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java b/examples/ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
index f348166..99f397f 100644
--- a/examples/ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
+++ b/examples/ear-testing/business-model/src/main/java/org/superbiz/model/Movie.java
@@ -1,62 +1,62 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.model;
-//START SNIPPET: code
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.model;
+//START SNIPPET: code
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJB.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJB.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJB.java
index fc7015b..811808a 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJB.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJB.java
@@ -1,53 +1,52 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.annotation.Resource;
-import javax.ejb.LocalBean;
-import javax.ejb.Stateless;
-import javax.sql.DataSource;
-
-@Stateless
-@LocalBean
-public class AnnotatedEJB implements AnnotatedEJBLocal, AnnotatedEJBRemote {
-
-    @Resource
-    private DataSource ds;
-
-    private String name = "foo";
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public DataSource getDs() {
-        return ds;
-    }
-
-    public void setDs(DataSource ds) {
-        this.ds = ds;
-    }
-
-    public String toString() {
-        return "AnnotatedEJB[name=" + name + "]";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.annotation.Resource;
+import javax.ejb.LocalBean;
+import javax.ejb.Stateless;
+import javax.sql.DataSource;
+
+@Stateless
+@LocalBean
+public class AnnotatedEJB implements AnnotatedEJBLocal, AnnotatedEJBRemote {
+
+    @Resource
+    private DataSource ds;
+
+    private String name = "foo";
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public DataSource getDs() {
+        return ds;
+    }
+
+    public void setDs(DataSource ds) {
+        this.ds = ds;
+    }
+
+    public String toString() {
+        return "AnnotatedEJB[name=" + name + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBLocal.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBLocal.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBLocal.java
index 5027461..0bf9326 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBLocal.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBLocal.java
@@ -1,33 +1,32 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.Local;
-import javax.sql.DataSource;
-
-@Local
-public interface AnnotatedEJBLocal {
-
-    String getName();
-
-    void setName(String name);
-
-    DataSource getDs();
-
-    void setDs(DataSource ds);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.Local;
+import javax.sql.DataSource;
+
+@Local
+public interface AnnotatedEJBLocal {
+
+    String getName();
+
+    void setName(String name);
+
+    DataSource getDs();
+
+    void setDs(DataSource ds);
+}


[18/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/test/java/org/superbiz/interceptors/ThirdSLSBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/test/java/org/superbiz/interceptors/ThirdSLSBeanTest.java b/examples/interceptors/src/test/java/org/superbiz/interceptors/ThirdSLSBeanTest.java
index df3b9e7..e775612 100755
--- a/examples/interceptors/src/test/java/org/superbiz/interceptors/ThirdSLSBeanTest.java
+++ b/examples/interceptors/src/test/java/org/superbiz/interceptors/ThirdSLSBeanTest.java
@@ -1,78 +1,78 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ThirdSLSBeanTest extends TestCase {
-
-    private InitialContext initCtx;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
-
-        initCtx = new InitialContext(properties);
-    }
-
-    @Test
-    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
-        ThirdSLSBeanLocal bean = (ThirdSLSBeanLocal) initCtx.lookup("ThirdSLSBeanLocal");
-
-        assert bean != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("ClassLevelInterceptorOne");
-        expected.add("ClassLevelInterceptorTwo");
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("MethodLevelInterceptorTwo");
-        expected.add("ThirdSLSBean");
-        expected.add("businessMethod");
-
-        List<String> actual = bean.businessMethod();
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
-
-    @Test
-    public void testMethodWithDefaultAndClassInterceptorsExcluded() throws Exception {
-        ThirdSLSBeanLocal bean = (ThirdSLSBeanLocal) initCtx.lookup("ThirdSLSBeanLocal");
-
-        assert bean != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("MethodLevelInterceptorTwo");
-        expected.add("ThirdSLSBean");
-        expected.add("anotherBusinessMethod");
-
-        List<String> actual = bean.anotherBusinessMethod();
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ThirdSLSBeanTest extends TestCase {
+
+    private InitialContext initCtx;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
+
+        initCtx = new InitialContext(properties);
+    }
+
+    @Test
+    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
+        ThirdSLSBeanLocal bean = (ThirdSLSBeanLocal) initCtx.lookup("ThirdSLSBeanLocal");
+
+        assert bean != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("ClassLevelInterceptorOne");
+        expected.add("ClassLevelInterceptorTwo");
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("MethodLevelInterceptorTwo");
+        expected.add("ThirdSLSBean");
+        expected.add("businessMethod");
+
+        List<String> actual = bean.businessMethod();
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
+
+    @Test
+    public void testMethodWithDefaultAndClassInterceptorsExcluded() throws Exception {
+        ThirdSLSBeanLocal bean = (ThirdSLSBeanLocal) initCtx.lookup("ThirdSLSBeanLocal");
+
+        assert bean != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("MethodLevelInterceptorTwo");
+        expected.add("ThirdSLSBean");
+        expected.add("anotherBusinessMethod");
+
+        List<String> actual = bean.anotherBusinessMethod();
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/javamail/src/main/java/org/superbiz/rest/EmailService.java
----------------------------------------------------------------------
diff --git a/examples/javamail/src/main/java/org/superbiz/rest/EmailService.java b/examples/javamail/src/main/java/org/superbiz/rest/EmailService.java
index 504ea16..5d037a9 100644
--- a/examples/javamail/src/main/java/org/superbiz/rest/EmailService.java
+++ b/examples/javamail/src/main/java/org/superbiz/rest/EmailService.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.rest;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/javamail/src/test/java/org/superbiz/rest/EmailServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/javamail/src/test/java/org/superbiz/rest/EmailServiceTest.java b/examples/javamail/src/test/java/org/superbiz/rest/EmailServiceTest.java
index 856cce5..53798f8 100644
--- a/examples/javamail/src/test/java/org/superbiz/rest/EmailServiceTest.java
+++ b/examples/javamail/src/test/java/org/superbiz/rest/EmailServiceTest.java
@@ -5,14 +5,14 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.superbiz.rest;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movie.java
----------------------------------------------------------------------
diff --git a/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movie.java b/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movie.java
index 5811bf2..f2b119c 100644
--- a/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movie.java
+++ b/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movie.java
@@ -1,68 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.eclipselink;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.eclipselink;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movies.java
----------------------------------------------------------------------
diff --git a/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movies.java b/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movies.java
index 2b0cad2..af0e412 100644
--- a/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movies.java
+++ b/examples/jpa-eclipselink/src/main/java/org/superbiz/eclipselink/Movies.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.eclipselink;
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.eclipselink;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-eclipselink/src/test/java/org/superbiz/eclipselink/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/jpa-eclipselink/src/test/java/org/superbiz/eclipselink/MoviesTest.java b/examples/jpa-eclipselink/src/test/java/org/superbiz/eclipselink/MoviesTest.java
index ad3701d..c6584148 100644
--- a/examples/jpa-eclipselink/src/test/java/org/superbiz/eclipselink/MoviesTest.java
+++ b/examples/jpa-eclipselink/src/test/java/org/superbiz/eclipselink/MoviesTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.eclipselink;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
- */
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        final Context context = EJBContainer.createEJBContainer(p).getContext();
-
-        Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.eclipselink;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
+ */
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        final Context context = EJBContainer.createEJBContainer(p).getContext();
+
+        Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies");
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movie.java
----------------------------------------------------------------------
diff --git a/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movie.java b/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movie.java
index 90ed7bc..1e1c21f 100644
--- a/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movie.java
+++ b/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movie.java
@@ -1,79 +1,79 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jpa.enums;
-
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue
-    private int id;
-    private String director;
-    private String title;
-    private int year;
-
-    @Enumerated(EnumType.STRING)
-    private Rating rating;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year, Rating rating) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-        this.rating = rating;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-    public Rating getRating() {
-        return rating;
-    }
-
-    public void setRating(Rating rating) {
-        this.rating = rating;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jpa.enums;
+
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue
+    private int id;
+    private String director;
+    private String title;
+    private int year;
+
+    @Enumerated(EnumType.STRING)
+    private Rating rating;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year, Rating rating) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+        this.rating = rating;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+    public Rating getRating() {
+        return rating;
+    }
+
+    public void setRating(Rating rating) {
+        this.rating = rating;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movies.java
----------------------------------------------------------------------
diff --git a/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movies.java b/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movies.java
index 5ea03d4..46fc1c0 100644
--- a/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movies.java
+++ b/examples/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Movies.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jpa.enums;
-
-//START SNIPPET: code
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> findByRating(Rating rating) {
-        final Query query = entityManager.createQuery("SELECT m FROM Movie as m WHERE m.rating = :rating");
-        query.setParameter("rating", rating);
-        return query.getResultList();
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jpa.enums;
+
+//START SNIPPET: code
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> findByRating(Rating rating) {
+        final Query query = entityManager.createQuery("SELECT m FROM Movie as m WHERE m.rating = :rating");
+        query.setParameter("rating", rating);
+        return query.getResultList();
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-enumerated/src/test/java/org/superbiz/jpa/enums/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/jpa-enumerated/src/test/java/org/superbiz/jpa/enums/MoviesTest.java b/examples/jpa-enumerated/src/test/java/org/superbiz/jpa/enums/MoviesTest.java
index 82eaebd..dd90258 100644
--- a/examples/jpa-enumerated/src/test/java/org/superbiz/jpa/enums/MoviesTest.java
+++ b/examples/jpa-enumerated/src/test/java/org/superbiz/jpa/enums/MoviesTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jpa.enums;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.Properties;
-
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer container = EJBContainer.createEJBContainer(p);
-        final Context context = container.getContext();
-
-        final Movies movies = (Movies) context.lookup("java:global/jpa-enumerated/Movies");
-
-        movies.addMovie(new Movie("James Frawley", "The Muppet Movie", 1979, Rating.G));
-        movies.addMovie(new Movie("Jim Henson", "The Great Muppet Caper", 1981, Rating.G));
-        movies.addMovie(new Movie("Frank Oz", "The Muppets Take Manhattan", 1984, Rating.G));
-        movies.addMovie(new Movie("James Bobin", "The Muppets", 2011, Rating.PG));
-
-        assertEquals("List.size()", 4, movies.getMovies().size());
-
-        assertEquals("List.size()", 3, movies.findByRating(Rating.G).size());
-
-        assertEquals("List.size()", 1, movies.findByRating(Rating.PG).size());
-
-        assertEquals("List.size()", 0, movies.findByRating(Rating.R).size());
-
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jpa.enums;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.Properties;
+
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer container = EJBContainer.createEJBContainer(p);
+        final Context context = container.getContext();
+
+        final Movies movies = (Movies) context.lookup("java:global/jpa-enumerated/Movies");
+
+        movies.addMovie(new Movie("James Frawley", "The Muppet Movie", 1979, Rating.G));
+        movies.addMovie(new Movie("Jim Henson", "The Great Muppet Caper", 1981, Rating.G));
+        movies.addMovie(new Movie("Frank Oz", "The Muppets Take Manhattan", 1984, Rating.G));
+        movies.addMovie(new Movie("James Bobin", "The Muppets", 2011, Rating.PG));
+
+        assertEquals("List.size()", 4, movies.getMovies().size());
+
+        assertEquals("List.size()", 3, movies.findByRating(Rating.G).size());
+
+        assertEquals("List.size()", 1, movies.findByRating(Rating.PG).size());
+
+        assertEquals("List.size()", 0, movies.findByRating(Rating.R).size());
+
+        container.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movie.java
----------------------------------------------------------------------
diff --git a/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movie.java b/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movie.java
index 6135344..8d6eed4 100644
--- a/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movie.java
+++ b/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movie.java
@@ -1,68 +1,68 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.h3jpa;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.h3jpa;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movies.java
----------------------------------------------------------------------
diff --git a/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movies.java b/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movies.java
index 62624f5..af15cff 100644
--- a/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movies.java
+++ b/examples/jpa-hibernate/src/main/java/org/superbiz/injection/h3jpa/Movies.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.h3jpa;
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.h3jpa;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jpa-hibernate/src/test/java/org/superbiz/injection/h3jpa/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/jpa-hibernate/src/test/java/org/superbiz/injection/h3jpa/MoviesTest.java b/examples/jpa-hibernate/src/test/java/org/superbiz/injection/h3jpa/MoviesTest.java
index 556840b..4f73ead 100644
--- a/examples/jpa-hibernate/src/test/java/org/superbiz/injection/h3jpa/MoviesTest.java
+++ b/examples/jpa-hibernate/src/test/java/org/superbiz/injection/h3jpa/MoviesTest.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.h3jpa;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
- */
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        final Context context = EJBContainer.createEJBContainer(p).getContext();
-        Movies movies = (Movies) context.lookup("java:global/jpa-hibernate/Movies");
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.h3jpa;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
+ */
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        final Context context = EJBContainer.createEJBContainer(p).getContext();
+        Movies movies = (Movies) context.lookup("java:global/jpa-hibernate/Movies");
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jsf-cdi-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/jsf-cdi-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java b/examples/jsf-cdi-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
index 109b6e6..817be8a 100644
--- a/examples/jsf-cdi-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
+++ b/examples/jsf-cdi-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
@@ -1,29 +1,28 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jsf;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class Calculator {
-
-    public double add(double x, double y) {
-        return x + y;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jsf;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class Calculator {
+
+    public double add(double x, double y) {
+        return x + y;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java b/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
index 4acd132..4dc2a16 100644
--- a/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
+++ b/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/Calculator.java
@@ -1,26 +1,25 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jsf;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface Calculator {
-
-    public double add(double x, double y);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jsf;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface Calculator {
+
+    public double add(double x, double y);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/CalculatorImpl.java
----------------------------------------------------------------------
diff --git a/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/CalculatorImpl.java b/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/CalculatorImpl.java
index 59ce782..43bedd0 100644
--- a/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/CalculatorImpl.java
+++ b/examples/jsf-managedBean-and-ejb/src/main/java/org/superbiz/jsf/CalculatorImpl.java
@@ -1,29 +1,28 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.jsf;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class CalculatorImpl implements Calculator {
-
-    public double add(double x, double y) {
-        return x + y;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.jsf;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class CalculatorImpl implements Calculator {
+
+    public double add(double x, double y) {
+        return x + y;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
index 1006dd6..468cba0 100644
--- a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
+++ b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import javax.ejb.EJBException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-//START SNIPPET: code
-public class BlueBean implements Friend {
-
-    public String sayHello() {
-        return "Blue says, Hello!";
-    }
-
-    public String helloFromFriend() {
-        try {
-            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
-            return "My friend " + friend.sayHello();
-        } catch (NamingException e) {
-            throw new EJBException(e);
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+//START SNIPPET: code
+public class BlueBean implements Friend {
+
+    public String sayHello() {
+        return "Blue says, Hello!";
+    }
+
+    public String helloFromFriend() {
+        try {
+            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
+            return "My friend " + friend.sayHello();
+        } catch (NamingException e) {
+            throw new EJBException(e);
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
index 33a88a4..7778acc 100644
--- a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
+++ b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
@@ -1,34 +1,34 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-/**
- * This is an EJB 3 local business interface
- * A local business interface may be annotated with the @Local
- * annotation, but it's optional. A business interface which is
- * not annotated with @Local or @Remote is assumed to be Local
- * if the bean does not implement any other interfaces
- */
-//START SNIPPET: code
-public interface Friend {
-
-    public String sayHello();
-
-    public String helloFromFriend();
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+/**
+ * This is an EJB 3 local business interface
+ * A local business interface may be annotated with the @Local
+ * annotation, but it's optional. A business interface which is
+ * not annotated with @Local or @Remote is assumed to be Local
+ * if the bean does not implement any other interfaces
+ */
+//START SNIPPET: code
+public interface Friend {
+
+    public String sayHello();
+
+    public String helloFromFriend();
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
index 6f27003..4c95b70 100644
--- a/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
+++ b/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import javax.ejb.EJBException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-//START SNIPPET: code
-public class RedBean implements Friend {
-
-    public String sayHello() {
-        return "Red says, Hello!";
-    }
-
-    public String helloFromFriend() {
-        try {
-            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
-            return "My friend " + friend.sayHello();
-        } catch (NamingException e) {
-            throw new EJBException(e);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+//START SNIPPET: code
+public class RedBean implements Friend {
+
+    public String sayHello() {
+        return "Red says, Hello!";
+    }
+
+    public String helloFromFriend() {
+        try {
+            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
+            return "My friend " + friend.sayHello();
+        } catch (NamingException e) {
+            throw new EJBException(e);
+        }
+    }
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java b/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
index 7f119a9..78f5686 100644
--- a/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
+++ b/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-//START SNIPPET: code
-public class EjbDependencyTest extends TestCase {
-
-    private Context context;
-
-    protected void setUp() throws Exception {
-        context = EJBContainer.createEJBContainer().getContext();
-    }
-
-    public void testRed() throws Exception {
-
-        Friend red = (Friend) context.lookup("java:global/wombat/RedBean");
-
-        assertNotNull(red);
-        assertEquals("Red says, Hello!", red.sayHello());
-        assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
-
-    }
-
-    public void testBlue() throws Exception {
-
-        Friend blue = (Friend) context.lookup("java:global/wombat/BlueBean");
-
-        assertNotNull(blue);
-        assertEquals("Blue says, Hello!", blue.sayHello());
-        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+//START SNIPPET: code
+public class EjbDependencyTest extends TestCase {
+
+    private Context context;
+
+    protected void setUp() throws Exception {
+        context = EJBContainer.createEJBContainer().getContext();
+    }
+
+    public void testRed() throws Exception {
+
+        Friend red = (Friend) context.lookup("java:global/wombat/RedBean");
+
+        assertNotNull(red);
+        assertEquals("Red says, Hello!", red.sayHello());
+        assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
+
+    }
+
+    public void testBlue() throws Exception {
+
+        Friend blue = (Friend) context.lookup("java:global/wombat/BlueBean");
+
+        assertNotNull(blue);
+        assertEquals("Blue says, Hello!", blue.sayHello());
+        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
+
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
index f5dfa1a..e84823c 100644
--- a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
+++ b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBException;
-import javax.ejb.Stateless;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-//START SNIPPET: code
-@Stateless
-@EJB(beanInterface = Friend.class, beanName = "RedBean", name = "myFriend")
-public class BlueBean implements Friend {
-
-    public String sayHello() {
-        return "Blue says, Hello!";
-    }
-
-    public String helloFromFriend() {
-        try {
-            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
-            return "My friend " + friend.sayHello();
-        } catch (NamingException e) {
-            throw new EJBException(e);
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBException;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+//START SNIPPET: code
+@Stateless
+@EJB(beanInterface = Friend.class, beanName = "RedBean", name = "myFriend")
+public class BlueBean implements Friend {
+
+    public String sayHello() {
+        return "Blue says, Hello!";
+    }
+
+    public String helloFromFriend() {
+        try {
+            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
+            return "My friend " + friend.sayHello();
+        } catch (NamingException e) {
+            throw new EJBException(e);
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
index c0601b6..8a3c836 100644
--- a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
+++ b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import javax.ejb.Local;
-
-/**
- * This is an EJB 3 local business interface
- * A local business interface may be annotated with the @Local
- * annotation, but it's optional. A business interface which is
- * not annotated with @Local or @Remote is assumed to be Local
- * if the bean does not implement any other interfaces
- */
-//START SNIPPET: code
-@Local
-public interface Friend {
-
-    public String sayHello();
-
-    public String helloFromFriend();
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import javax.ejb.Local;
+
+/**
+ * This is an EJB 3 local business interface
+ * A local business interface may be annotated with the @Local
+ * annotation, but it's optional. A business interface which is
+ * not annotated with @Local or @Remote is assumed to be Local
+ * if the bean does not implement any other interfaces
+ */
+//START SNIPPET: code
+@Local
+public interface Friend {
+
+    public String sayHello();
+
+    public String helloFromFriend();
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
index b75bd6c..6e76c893 100644
--- a/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
+++ b/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
@@ -1,43 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBException;
-import javax.ejb.Stateless;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-//START SNIPPET: code
-@Stateless
-@EJB(beanInterface = Friend.class, beanName = "BlueBean", name = "myFriend")
-public class RedBean implements Friend {
-
-    public String sayHello() {
-        return "Red says, Hello!";
-    }
-
-    public String helloFromFriend() {
-        try {
-            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
-            return "My friend " + friend.sayHello();
-        } catch (NamingException e) {
-            throw new EJBException(e);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBException;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+//START SNIPPET: code
+@Stateless
+@EJB(beanInterface = Friend.class, beanName = "BlueBean", name = "myFriend")
+public class RedBean implements Friend {
+
+    public String sayHello() {
+        return "Red says, Hello!";
+    }
+
+    public String helloFromFriend() {
+        try {
+            Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
+            return "My friend " + friend.sayHello();
+        } catch (NamingException e) {
+            throw new EJBException(e);
+        }
+    }
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
----------------------------------------------------------------------
diff --git a/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java b/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
index c70564c..b3b6504 100644
--- a/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
+++ b/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ejblookup;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-//START SNIPPET: code
-public class EjbDependencyTest extends TestCase {
-
-    private Context context;
-
-    protected void setUp() throws Exception {
-        context = EJBContainer.createEJBContainer().getContext();
-    }
-
-    public void testRed() throws Exception {
-
-        final Friend red = (Friend) context.lookup("java:global/lookup-of-ejbs/RedBean");
-
-        assertNotNull(red);
-        assertEquals("Red says, Hello!", red.sayHello());
-        assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
-
-    }
-
-    public void testBlue() throws Exception {
-
-        final Friend blue = (Friend) context.lookup("java:global/lookup-of-ejbs/BlueBean");
-
-        assertNotNull(blue);
-        assertEquals("Blue says, Hello!", blue.sayHello());
-        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
-
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ejblookup;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+//START SNIPPET: code
+public class EjbDependencyTest extends TestCase {
+
+    private Context context;
+
+    protected void setUp() throws Exception {
+        context = EJBContainer.createEJBContainer().getContext();
+    }
+
+    public void testRed() throws Exception {
+
+        final Friend red = (Friend) context.lookup("java:global/lookup-of-ejbs/RedBean");
+
+        assertNotNull(red);
+        assertEquals("Red says, Hello!", red.sayHello());
+        assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
+
+    }
+
+    public void testBlue() throws Exception {
+
+        final Friend blue = (Friend) context.lookup("java:global/lookup-of-ejbs/BlueBean");
+
+        assertNotNull(blue);
+        assertEquals("Blue says, Hello!", blue.sayHello());
+        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
+
+    }
+
+}
+//END SNIPPET: code


[14/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/repository/jpa/AbstractGenericJpaRepository.java
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/repository/jpa/AbstractGenericJpaRepository.java b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/repository/jpa/AbstractGenericJpaRepository.java
index 7f570c4..e660084 100644
--- a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/repository/jpa/AbstractGenericJpaRepository.java
+++ b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/repository/jpa/AbstractGenericJpaRepository.java
@@ -1,97 +1,97 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.myfaces.repository.jpa;
-
-import org.superbiz.myfaces.domain.AbstractDomainObject;
-import org.superbiz.myfaces.repository.GenericRepository;
-
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.List;
-
-/**
- * Abstract repository class which provides default implementations for common repository methods.
- */
-public abstract class AbstractGenericJpaRepository<T extends AbstractDomainObject> implements GenericRepository<T> {
-
-    protected final Class<? extends AbstractDomainObject> entityClass;
-
-    @Inject
-    protected EntityManager entityManager;
-
-    public AbstractGenericJpaRepository() {
-        Class currentClass = getClass();
-
-        if (currentClass.getName().contains("$$")) { //we are in a proxy
-            currentClass = currentClass.getSuperclass();
-        }
-
-        for (Type interfaceClass : currentClass.getGenericInterfaces()) {
-            for (Type genericInterfaceClass : ((Class) interfaceClass).getGenericInterfaces()) {
-                if (genericInterfaceClass instanceof ParameterizedType &&
-                    GenericRepository.class.isAssignableFrom((Class) ((ParameterizedType) genericInterfaceClass).getRawType())) {
-                    for (Type parameterizedType : ((ParameterizedType) genericInterfaceClass).getActualTypeArguments()) {
-                        if (AbstractDomainObject.class.isAssignableFrom((Class) parameterizedType)) {
-                            this.entityClass = (Class<? extends AbstractDomainObject>) parameterizedType;
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-
-        throw new IllegalStateException("Entity type of " + currentClass.getName() + " not detected!");
-    }
-
-    @Override
-    public T createNewEntity() {
-        try {
-            return (T) this.entityClass.newInstance();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void save(T entity) {
-        if (entity.isTransient()) {
-            this.entityManager.persist(entity);
-        } else {
-            this.entityManager.merge(entity);
-        }
-    }
-
-    public void remove(T entity) {
-        if (entity.isTransient()) {
-            throw new IllegalStateException("entity is not persistent");
-        }
-
-        this.entityManager.remove(loadById(entity.getId()));
-    }
-
-    public List<T> loadAll() {
-        return (List<T>) this.entityManager.createQuery("select entity from " + this.entityClass.getSimpleName() + " entity")
-                                           .getResultList();
-    }
-
-    public T loadById(Long id) {
-        return (T) this.entityManager.find(this.entityClass, id);
-    }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.myfaces.repository.jpa;
+
+import org.superbiz.myfaces.domain.AbstractDomainObject;
+import org.superbiz.myfaces.repository.GenericRepository;
+
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * Abstract repository class which provides default implementations for common repository methods.
+ */
+public abstract class AbstractGenericJpaRepository<T extends AbstractDomainObject> implements GenericRepository<T> {
+
+    protected final Class<? extends AbstractDomainObject> entityClass;
+
+    @Inject
+    protected EntityManager entityManager;
+
+    public AbstractGenericJpaRepository() {
+        Class currentClass = getClass();
+
+        if (currentClass.getName().contains("$$")) { //we are in a proxy
+            currentClass = currentClass.getSuperclass();
+        }
+
+        for (Type interfaceClass : currentClass.getGenericInterfaces()) {
+            for (Type genericInterfaceClass : ((Class) interfaceClass).getGenericInterfaces()) {
+                if (genericInterfaceClass instanceof ParameterizedType &&
+                        GenericRepository.class.isAssignableFrom((Class) ((ParameterizedType) genericInterfaceClass).getRawType())) {
+                    for (Type parameterizedType : ((ParameterizedType) genericInterfaceClass).getActualTypeArguments()) {
+                        if (AbstractDomainObject.class.isAssignableFrom((Class) parameterizedType)) {
+                            this.entityClass = (Class<? extends AbstractDomainObject>) parameterizedType;
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+
+        throw new IllegalStateException("Entity type of " + currentClass.getName() + " not detected!");
+    }
+
+    @Override
+    public T createNewEntity() {
+        try {
+            return (T) this.entityClass.newInstance();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void save(T entity) {
+        if (entity.isTransient()) {
+            this.entityManager.persist(entity);
+        } else {
+            this.entityManager.merge(entity);
+        }
+    }
+
+    public void remove(T entity) {
+        if (entity.isTransient()) {
+            throw new IllegalStateException("entity is not persistent");
+        }
+
+        this.entityManager.remove(loadById(entity.getId()));
+    }
+
+    public List<T> loadAll() {
+        return (List<T>) this.entityManager.createQuery("select entity from " + this.entityClass.getSimpleName() + " entity")
+                .getResultList();
+    }
+
+    public T loadById(Long id) {
+        return (T) this.entityManager.find(this.entityClass, id);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/startup/ExtValLifecycleFactory.java
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/startup/ExtValLifecycleFactory.java b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/startup/ExtValLifecycleFactory.java
index 37c1131..857cd19 100644
--- a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/startup/ExtValLifecycleFactory.java
+++ b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/startup/ExtValLifecycleFactory.java
@@ -32,54 +32,44 @@ import javax.faces.lifecycle.LifecycleFactory;
 import java.util.Iterator;
 
 //TODO remove it after upgrading to ExtVal r8+
-public class ExtValLifecycleFactory extends LifecycleFactory
-{
+public class ExtValLifecycleFactory extends LifecycleFactory {
     private final LifecycleFactory wrapped;
 
-    public ExtValLifecycleFactory(LifecycleFactory wrapped)
-    {
+    public ExtValLifecycleFactory(LifecycleFactory wrapped) {
         this.wrapped = wrapped;
     }
 
     @Override
-    public void addLifecycle(String lifecycleId, Lifecycle lifecycle)
-    {
+    public void addLifecycle(String lifecycleId, Lifecycle lifecycle) {
         wrapped.addLifecycle(lifecycleId, lifecycle);
     }
 
     @Override
-    public Lifecycle getLifecycle(String lifecycleId)
-    {
+    public Lifecycle getLifecycle(String lifecycleId) {
         return new LifecycleWrapper(wrapped.getLifecycle(lifecycleId));
     }
 
     @Override
-    public Iterator<String> getLifecycleIds()
-    {
+    public Iterator<String> getLifecycleIds() {
         return wrapped.getLifecycleIds();
     }
 
     @Override
-    public LifecycleFactory getWrapped()
-    {
+    public LifecycleFactory getWrapped() {
         return wrapped;
     }
 
-    private static class LifecycleWrapper extends Lifecycle
-    {
+    private static class LifecycleWrapper extends Lifecycle {
         private final Lifecycle wrapped;
         private static boolean firstPhaseListener = true;
 
-        private LifecycleWrapper(Lifecycle wrapped)
-        {
+        private LifecycleWrapper(Lifecycle wrapped) {
             this.wrapped = wrapped;
         }
 
         @Override
-        public void addPhaseListener(PhaseListener listener)
-        {
-            if (firstPhaseListener)
-            {
+        public void addPhaseListener(PhaseListener listener) {
+            if (firstPhaseListener) {
                 //forced order independent of any other config
                 firstPhaseListener = false;
                 wrapped.addPhaseListener(new ExtValStartupListener());
@@ -88,35 +78,29 @@ public class ExtValLifecycleFactory extends LifecycleFactory
         }
 
         @Override
-        public void execute(FacesContext context) throws FacesException
-        {
+        public void execute(FacesContext context) throws FacesException {
             wrapped.execute(context);
         }
 
         @Override
-        public PhaseListener[] getPhaseListeners()
-        {
+        public PhaseListener[] getPhaseListeners() {
             return wrapped.getPhaseListeners();
         }
 
         @Override
-        public void removePhaseListener(PhaseListener listener)
-        {
+        public void removePhaseListener(PhaseListener listener) {
             wrapped.removePhaseListener(listener);
         }
 
         @Override
-        public void render(FacesContext context) throws FacesException
-        {
+        public void render(FacesContext context) throws FacesException {
             wrapped.render(context);
         }
     }
 
-    public static class ExtValStartupListener extends AbstractStartupListener
-    {
+    public static class ExtValStartupListener extends AbstractStartupListener {
         @Override
-        protected void init()
-        {
+        protected void init() {
             ExtValCoreConfiguration.use(new DefaultExtValCoreConfiguration() {
                 @Override
                 public ProxyHelper proxyHelper() {

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/RegistrationPage.java
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/RegistrationPage.java b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/RegistrationPage.java
index b664f80..e2dc312 100644
--- a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/RegistrationPage.java
+++ b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/RegistrationPage.java
@@ -1,101 +1,101 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.myfaces.view;
-
-import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.Conversation;
-import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
-import org.apache.myfaces.extensions.cdi.jsf.api.Jsf;
-import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
-import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
-import org.apache.myfaces.extensions.validator.crossval.annotation.Equals;
-import org.superbiz.myfaces.domain.User;
-import org.superbiz.myfaces.domain.validation.Full;
-import org.superbiz.myfaces.repository.UserRepository;
-import org.superbiz.myfaces.view.config.Pages;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.Serializable;
-
-import static org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity.ERROR;
-
-@Named
-@ViewAccessScoped
-public class RegistrationPage implements Serializable {
-
-    private static final long serialVersionUID = 3844502441069448490L;
-
-    @Inject
-    private UserRepository userRepository;
-
-    @Inject
-    private Conversation conversation;
-
-    @Inject
-    private
-    @Jsf
-    MessageContext messageContext;
-
-    private User user = new User();
-
-    @Inject
-    private UserHolder userHolder;
-
-    @Equals("user.password")
-    private String repeatedPassword;
-
-    @BeanValidation(useGroups = Full.class) //triggers UniqueUserNameValidator
-    public Class<? extends Pages> register() {
-        this.userRepository.save(this.user);
-        this.messageContext.message()
-                           .text("{msgUserRegistered}")
-                           .namedArgument("userName", this.user.getUserName())
-                           .add();
-
-        //in order to re-use the page-bean for the login-page
-        this.conversation.close();
-
-        return Pages.Login.class;
-    }
-
-    public Class<? extends Pages> login() {
-        User user = this.userRepository.loadUser(this.user.getUserName());
-        if (user != null && user.getPassword().equals(this.user.getPassword())) {
-            this.messageContext.message().text("{msgLoginSuccessful}").add();
-            this.userHolder.setCurrentUser(user);
-            return Pages.About.class;
-        }
-
-        this.messageContext.message().text("{msgLoginFailed}").payload(ERROR).add();
-
-        return null;
-    }
-
-    public User getUser() {
-        return user;
-    }
-
-    public String getRepeatedPassword() {
-        return repeatedPassword;
-    }
-
-    public void setRepeatedPassword(String repeatedPassword) {
-        this.repeatedPassword = repeatedPassword;
-    }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.myfaces.view;
+
+import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.Conversation;
+import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
+import org.apache.myfaces.extensions.cdi.jsf.api.Jsf;
+import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
+import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
+import org.apache.myfaces.extensions.validator.crossval.annotation.Equals;
+import org.superbiz.myfaces.domain.User;
+import org.superbiz.myfaces.domain.validation.Full;
+import org.superbiz.myfaces.repository.UserRepository;
+import org.superbiz.myfaces.view.config.Pages;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+
+import static org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity.ERROR;
+
+@Named
+@ViewAccessScoped
+public class RegistrationPage implements Serializable {
+
+    private static final long serialVersionUID = 3844502441069448490L;
+
+    @Inject
+    private UserRepository userRepository;
+
+    @Inject
+    private Conversation conversation;
+
+    @Inject
+    private
+    @Jsf
+    MessageContext messageContext;
+
+    private User user = new User();
+
+    @Inject
+    private UserHolder userHolder;
+
+    @Equals("user.password")
+    private String repeatedPassword;
+
+    @BeanValidation(useGroups = Full.class) //triggers UniqueUserNameValidator
+    public Class<? extends Pages> register() {
+        this.userRepository.save(this.user);
+        this.messageContext.message()
+                .text("{msgUserRegistered}")
+                .namedArgument("userName", this.user.getUserName())
+                .add();
+
+        //in order to re-use the page-bean for the login-page
+        this.conversation.close();
+
+        return Pages.Login.class;
+    }
+
+    public Class<? extends Pages> login() {
+        User user = this.userRepository.loadUser(this.user.getUserName());
+        if (user != null && user.getPassword().equals(this.user.getPassword())) {
+            this.messageContext.message().text("{msgLoginSuccessful}").add();
+            this.userHolder.setCurrentUser(user);
+            return Pages.About.class;
+        }
+
+        this.messageContext.message().text("{msgLoginFailed}").payload(ERROR).add();
+
+        return null;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public String getRepeatedPassword() {
+        return repeatedPassword;
+    }
+
+    public void setRepeatedPassword(String repeatedPassword) {
+        this.repeatedPassword = repeatedPassword;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/config/Pages.java
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/config/Pages.java b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/config/Pages.java
index 2589dcc..424ef06 100644
--- a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/config/Pages.java
+++ b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/config/Pages.java
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.myfaces.view.config;
-
-import org.apache.myfaces.extensions.cdi.core.api.config.view.DefaultErrorView;
-import org.apache.myfaces.extensions.cdi.core.api.config.view.ViewConfig;
-import org.apache.myfaces.extensions.cdi.core.api.security.Secured;
-import org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page;
-import org.apache.myfaces.extensions.cdi.jsf.api.config.view.PageBean;
-import org.superbiz.myfaces.view.FeedbackPage;
-import org.superbiz.myfaces.view.InfoPage;
-import org.superbiz.myfaces.view.security.LoginAccessDecisionVoter;
-
-import static org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page.NavigationMode.REDIRECT;
-
-@Page(navigation = REDIRECT)
-public interface Pages extends ViewConfig {
-
-    @Page
-    class Index implements Pages {
-
-    }
-
-    @InfoPage
-    @Page
-    class About implements Pages {
-
-    }
-
-    @Page
-    class Registration implements Pages {
-
-    }
-
-    @Page
-    class Login extends DefaultErrorView implements Pages /*just to benefit from the config*/ {
-
-    }
-
-    @Secured(LoginAccessDecisionVoter.class)
-        //@Secured(value = LoginAccessDecisionVoter.class, errorView = Login.class)
-    interface Secure extends Pages {
-
-        @PageBean(FeedbackPage.class)
-        @Page
-        class FeedbackList implements Secure {
-
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.myfaces.view.config;
+
+import org.apache.myfaces.extensions.cdi.core.api.config.view.DefaultErrorView;
+import org.apache.myfaces.extensions.cdi.core.api.config.view.ViewConfig;
+import org.apache.myfaces.extensions.cdi.core.api.security.Secured;
+import org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page;
+import org.apache.myfaces.extensions.cdi.jsf.api.config.view.PageBean;
+import org.superbiz.myfaces.view.FeedbackPage;
+import org.superbiz.myfaces.view.InfoPage;
+import org.superbiz.myfaces.view.security.LoginAccessDecisionVoter;
+
+import static org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page.NavigationMode.REDIRECT;
+
+@Page(navigation = REDIRECT)
+public interface Pages extends ViewConfig {
+
+    @Page
+    class Index implements Pages {
+
+    }
+
+    @InfoPage
+    @Page
+    class About implements Pages {
+
+    }
+
+    @Page
+    class Registration implements Pages {
+
+    }
+
+    @Page
+    class Login extends DefaultErrorView implements Pages /*just to benefit from the config*/ {
+
+    }
+
+    @Secured(LoginAccessDecisionVoter.class)
+            //@Secured(value = LoginAccessDecisionVoter.class, errorView = Login.class)
+    interface Secure extends Pages {
+
+        @PageBean(FeedbackPage.class)
+        @Page
+        class FeedbackList implements Secure {
+
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/util/InfoBean.java
----------------------------------------------------------------------
diff --git a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/util/InfoBean.java b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/util/InfoBean.java
index e75b494..02a0416 100644
--- a/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/util/InfoBean.java
+++ b/examples/myfaces-codi-demo/src/main/java/org/superbiz/myfaces/view/util/InfoBean.java
@@ -1,128 +1,128 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.myfaces.view.util;
-
-import org.apache.myfaces.extensions.cdi.core.api.CodiInformation;
-import org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage;
-import org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider;
-import org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils;
-import org.apache.myfaces.extensions.cdi.jsf.api.Jsf;
-import org.apache.myfaces.extensions.cdi.jsf.api.config.view.ViewConfigDescriptor;
-import org.apache.myfaces.extensions.cdi.jsf.api.config.view.ViewConfigResolver;
-import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
-import org.apache.myfaces.extensions.validator.ExtValInformation;
-import org.superbiz.myfaces.view.InfoPage;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
-import javax.faces.context.FacesContext;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.persistence.Persistence;
-import javax.validation.Validation;
-import java.io.Serializable;
-
-@Named
-@SessionScoped
-public class InfoBean implements Serializable {
-
-    private static final long serialVersionUID = -1748909261695527800L;
-
-    @Inject
-    private
-    @Jsf
-    MessageContext messageContext;
-
-    @Inject
-    private ProjectStage projectStage;
-
-    @Inject
-    private ViewConfigResolver viewConfigResolver;
-
-    @Inject
-    private FacesContext facesContext;
-
-    private String applicationMessageVersionInfo;
-
-    private String beanValidationVersion;
-
-    private String jpaVersion;
-
-    @PostConstruct
-    protected void showWelcomeMessage() {
-        String versionString = ClassUtils.getJarVersion(InfoBean.class);
-
-        if (versionString != null) {
-            this.applicationMessageVersionInfo = " (v" + versionString + ")";
-        }
-
-        this.beanValidationVersion =
-            ClassUtils.getJarVersion(Validation.buildDefaultValidatorFactory().getValidator().getClass());
-
-        this.jpaVersion =
-            ClassUtils.getJarVersion(Persistence.createEntityManagerFactory("demoApplicationPU").getClass());
-
-        if (!ProjectStage.IntegrationTest.equals(this.projectStage)) {
-            this.messageContext.message().text("{msgWelcome}").add();
-        }
-    }
-
-    public boolean isInfoPage() {
-        ViewConfigDescriptor viewConfigDescriptor =
-            this.viewConfigResolver.getViewConfigDescriptor(this.facesContext.getViewRoot().getViewId());
-
-        if (viewConfigDescriptor == null) {
-            return false;
-        }
-
-        return !viewConfigDescriptor.getMetaData(InfoPage.class).isEmpty();
-    }
-
-    public String getProjectStage() {
-        return this.projectStage.toString();
-    }
-
-    public String getApplicationVersion() {
-        return this.applicationMessageVersionInfo;
-    }
-
-    public String getCodiVersion() {
-        return CodiInformation.VERSION;
-    }
-
-    public String getCdiVersion() {
-        return ClassUtils.getJarVersion(BeanManagerProvider.getInstance().getBeanManager().getClass());
-    }
-
-    public String getExtValVersion() {
-        return ExtValInformation.VERSION;
-    }
-
-    public String getJsfVersion() {
-        return ClassUtils.getJarVersion(FacesContext.class);
-    }
-
-    public String getBeanValidationVersion() {
-        return this.beanValidationVersion;
-    }
-
-    public String getJpaVersion() {
-        return this.jpaVersion;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.myfaces.view.util;
+
+import org.apache.myfaces.extensions.cdi.core.api.CodiInformation;
+import org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage;
+import org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider;
+import org.apache.myfaces.extensions.cdi.core.api.util.ClassUtils;
+import org.apache.myfaces.extensions.cdi.jsf.api.Jsf;
+import org.apache.myfaces.extensions.cdi.jsf.api.config.view.ViewConfigDescriptor;
+import org.apache.myfaces.extensions.cdi.jsf.api.config.view.ViewConfigResolver;
+import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.superbiz.myfaces.view.InfoPage;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.persistence.Persistence;
+import javax.validation.Validation;
+import java.io.Serializable;
+
+@Named
+@SessionScoped
+public class InfoBean implements Serializable {
+
+    private static final long serialVersionUID = -1748909261695527800L;
+
+    @Inject
+    private
+    @Jsf
+    MessageContext messageContext;
+
+    @Inject
+    private ProjectStage projectStage;
+
+    @Inject
+    private ViewConfigResolver viewConfigResolver;
+
+    @Inject
+    private FacesContext facesContext;
+
+    private String applicationMessageVersionInfo;
+
+    private String beanValidationVersion;
+
+    private String jpaVersion;
+
+    @PostConstruct
+    protected void showWelcomeMessage() {
+        String versionString = ClassUtils.getJarVersion(InfoBean.class);
+
+        if (versionString != null) {
+            this.applicationMessageVersionInfo = " (v" + versionString + ")";
+        }
+
+        this.beanValidationVersion =
+                ClassUtils.getJarVersion(Validation.buildDefaultValidatorFactory().getValidator().getClass());
+
+        this.jpaVersion =
+                ClassUtils.getJarVersion(Persistence.createEntityManagerFactory("demoApplicationPU").getClass());
+
+        if (!ProjectStage.IntegrationTest.equals(this.projectStage)) {
+            this.messageContext.message().text("{msgWelcome}").add();
+        }
+    }
+
+    public boolean isInfoPage() {
+        ViewConfigDescriptor viewConfigDescriptor =
+                this.viewConfigResolver.getViewConfigDescriptor(this.facesContext.getViewRoot().getViewId());
+
+        if (viewConfigDescriptor == null) {
+            return false;
+        }
+
+        return !viewConfigDescriptor.getMetaData(InfoPage.class).isEmpty();
+    }
+
+    public String getProjectStage() {
+        return this.projectStage.toString();
+    }
+
+    public String getApplicationVersion() {
+        return this.applicationMessageVersionInfo;
+    }
+
+    public String getCodiVersion() {
+        return CodiInformation.VERSION;
+    }
+
+    public String getCdiVersion() {
+        return ClassUtils.getJarVersion(BeanManagerProvider.getInstance().getBeanManager().getClass());
+    }
+
+    public String getExtValVersion() {
+        return ExtValInformation.VERSION;
+    }
+
+    public String getJsfVersion() {
+        return ClassUtils.getJarVersion(FacesContext.class);
+    }
+
+    public String getBeanValidationVersion() {
+        return this.beanValidationVersion;
+    }
+
+    public String getJpaVersion() {
+        return this.jpaVersion;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/persistence-fragment/src/main/java/org/superbiz/injection/jpa/Movie.java
----------------------------------------------------------------------
diff --git a/examples/persistence-fragment/src/main/java/org/superbiz/injection/jpa/Movie.java b/examples/persistence-fragment/src/main/java/org/superbiz/injection/jpa/Movie.java
index 9eb94fc..6157287 100644
--- a/examples/persistence-fragment/src/main/java/org/superbiz/injection/jpa/Movie.java
+++ b/examples/persistence-fragment/src/main/java/org/superbiz/injection/jpa/Movie.java
@@ -1,70 +1,70 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.jpa;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue
-    private long id;
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-        // no-op
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.jpa;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue
+    private long id;
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+        // no-op
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/persistence-fragment/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/persistence-fragment/src/test/java/org/superbiz/injection/jpa/MoviesTest.java b/examples/persistence-fragment/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
index aedbe0e..63e6b04 100644
--- a/examples/persistence-fragment/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
+++ b/examples/persistence-fragment/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
@@ -1,50 +1,50 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.jpa;
-
-import org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnit;
-import java.util.Properties;
-
-import static org.junit.Assert.assertTrue;
-
-public class MoviesTest {
-
-    @PersistenceUnit
-    private EntityManagerFactory emf;
-
-    @Test
-    public void test() throws Exception {
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        final EJBContainer container = EJBContainer.createEJBContainer(p);
-        final Context context = container.getContext();
-        context.bind("inject", this);
-
-        assertTrue(((ReloadableEntityManagerFactory) emf).getManagedClasses().contains(Movie.class.getName()));
-
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.jpa;
+
+import org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+public class MoviesTest {
+
+    @PersistenceUnit
+    private EntityManagerFactory emf;
+
+    @Test
+    public void test() throws Exception {
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        final EJBContainer container = EJBContainer.createEJBContainer(p);
+        final Context context = container.getContext();
+        context.bind("inject", this);
+
+        assertTrue(((ReloadableEntityManagerFactory) emf).getManagedClasses().contains(Movie.class.getName()));
+
+        container.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/PojoWS.java
----------------------------------------------------------------------
diff --git a/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/PojoWS.java b/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/PojoWS.java
index 15fb025..ca093da 100644
--- a/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/PojoWS.java
+++ b/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/PojoWS.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.pojo;
-
-import javax.annotation.Resource;
-import javax.jws.WebService;
-import javax.transaction.UserTransaction;
-import javax.xml.ws.WebServiceContext;
-
-@WebService
-public class PojoWS implements WS {
-
-    @Resource
-    private WebServiceContext webServiceContext;
-
-    @Resource
-    private UserTransaction userTransaction;
-
-    @Override
-    public String ws() {
-        return webServiceContext + " & " + userTransaction;
-    }
-
-    public void setWebServiceContext(WebServiceContext webServiceContext) {
-        this.webServiceContext = webServiceContext;
-    }
-
-    public void setUserTransaction(UserTransaction userTransaction) {
-        this.userTransaction = userTransaction;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.pojo;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.transaction.UserTransaction;
+import javax.xml.ws.WebServiceContext;
+
+@WebService
+public class PojoWS implements WS {
+
+    @Resource
+    private WebServiceContext webServiceContext;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @Override
+    public String ws() {
+        return webServiceContext + " & " + userTransaction;
+    }
+
+    public void setWebServiceContext(WebServiceContext webServiceContext) {
+        this.webServiceContext = webServiceContext;
+    }
+
+    public void setUserTransaction(UserTransaction userTransaction) {
+        this.userTransaction = userTransaction;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/WS.java
----------------------------------------------------------------------
diff --git a/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/WS.java b/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/WS.java
index 75b4a9f..4773495 100644
--- a/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/WS.java
+++ b/examples/pojo-webservice/src/main/java/org/superbiz/ws/pojo/WS.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.ws.pojo;
-
-import javax.jws.WebService;
-
-@WebService
-public interface WS {
-
-    String ws();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws.pojo;
+
+import javax.jws.WebService;
+
+@WebService
+public interface WS {
+
+    String ws();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/Client.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/Client.java b/examples/polling-parent/polling-client/src/main/java/jug/client/Client.java
index 419b9eb..65f4c2f 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/Client.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/Client.java
@@ -1,84 +1,84 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client;
-
-import jline.ConsoleReader;
-import jline.FileNameCompletor;
-import jline.SimpleCompletor;
-import jug.client.command.api.AbstractCommand;
-import jug.client.util.CommandManager;
-import org.apache.xbean.recipe.ObjectRecipe;
-import org.apache.xbean.recipe.Option;
-
-import java.io.OutputStreamWriter;
-import java.util.Map;
-
-public class Client {
-
-    private static final String PROMPT = System.getProperty("user.name") + " @ jug > ";
-    private static final String EXIT_CMD = "exit";
-
-    private Client() {
-        // no-op
-    }
-
-    public static void main(final String[] args) throws Exception {
-        if (args.length != 1) {
-            System.err.println("Pass the base url as parameter");
-            return;
-        }
-
-        final ConsoleReader reader = new ConsoleReader(System.in, new OutputStreamWriter(System.out));
-        reader.addCompletor(new FileNameCompletor());
-        reader.addCompletor(new SimpleCompletor(CommandManager.keys().toArray(new String[CommandManager.size()])));
-
-        String line;
-        while ((line = reader.readLine(PROMPT)) != null) {
-            if (EXIT_CMD.equals(line)) {
-                break;
-            }
-
-            Class<?> cmdClass = null;
-            for (Map.Entry<String, Class<?>> cmd : CommandManager.getCommands().entrySet()) {
-                if (line.startsWith(cmd.getKey())) {
-                    cmdClass = cmd.getValue();
-                    break;
-                }
-            }
-
-            if (cmdClass != null) {
-                final ObjectRecipe recipe = new ObjectRecipe(cmdClass);
-                recipe.setProperty("url", args[0]);
-                recipe.setProperty("command", line);
-                recipe.setProperty("commands", CommandManager.getCommands());
-
-                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
-                recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
-                recipe.allow(Option.NAMED_PARAMETERS);
-
-                try {
-                    final AbstractCommand cmdInstance = (AbstractCommand) recipe.create();
-                    cmdInstance.execute(line);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            } else {
-                System.err.println("sorry i don't understand '" + line + "'");
-            }
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client;
+
+import jline.ConsoleReader;
+import jline.FileNameCompletor;
+import jline.SimpleCompletor;
+import jug.client.command.api.AbstractCommand;
+import jug.client.util.CommandManager;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+
+import java.io.OutputStreamWriter;
+import java.util.Map;
+
+public class Client {
+
+    private static final String PROMPT = System.getProperty("user.name") + " @ jug > ";
+    private static final String EXIT_CMD = "exit";
+
+    private Client() {
+        // no-op
+    }
+
+    public static void main(final String[] args) throws Exception {
+        if (args.length != 1) {
+            System.err.println("Pass the base url as parameter");
+            return;
+        }
+
+        final ConsoleReader reader = new ConsoleReader(System.in, new OutputStreamWriter(System.out));
+        reader.addCompletor(new FileNameCompletor());
+        reader.addCompletor(new SimpleCompletor(CommandManager.keys().toArray(new String[CommandManager.size()])));
+
+        String line;
+        while ((line = reader.readLine(PROMPT)) != null) {
+            if (EXIT_CMD.equals(line)) {
+                break;
+            }
+
+            Class<?> cmdClass = null;
+            for (Map.Entry<String, Class<?>> cmd : CommandManager.getCommands().entrySet()) {
+                if (line.startsWith(cmd.getKey())) {
+                    cmdClass = cmd.getValue();
+                    break;
+                }
+            }
+
+            if (cmdClass != null) {
+                final ObjectRecipe recipe = new ObjectRecipe(cmdClass);
+                recipe.setProperty("url", args[0]);
+                recipe.setProperty("command", line);
+                recipe.setProperty("commands", CommandManager.getCommands());
+
+                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
+                recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+                recipe.allow(Option.NAMED_PARAMETERS);
+
+                try {
+                    final AbstractCommand cmdInstance = (AbstractCommand) recipe.create();
+                    cmdInstance.execute(line);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } else {
+                System.err.println("sorry i don't understand '" + line + "'");
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/AbstractCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/AbstractCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/AbstractCommand.java
index b4fc913..0078349 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/AbstractCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/AbstractCommand.java
@@ -1,88 +1,88 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.api;
-
-import jug.client.util.ClientNameHolder;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.codehaus.jettison.util.StringIndenter;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-
-public abstract class AbstractCommand {
-
-    protected String command;
-    protected String url;
-
-    protected WebClient client;
-
-    public void execute(final String cmd) {
-        final Response response = invoke(cmd);
-        if (response == null) {
-            return;
-        }
-
-        System.out.println("Status: " + response.getStatus());
-        try {
-            String json = slurp((InputStream) response.getEntity());
-            System.out.println(format(json));
-        } catch (IOException e) {
-            System.err.println("can't get output: " + e.getMessage());
-        }
-    }
-
-    protected String format(final String json) throws IOException {
-        final StringIndenter formatter = new StringIndenter(json);
-        final Writer outWriter = new StringWriter();
-        IOUtils.copy(new StringReader(formatter.result()), outWriter, 2048);
-        outWriter.close();
-        return outWriter.toString();
-    }
-
-    protected abstract Response invoke(final String cmd);
-
-    public void setCommand(String command) {
-        this.command = command;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-        client = WebClient.create(url).accept(MediaType.APPLICATION_JSON);
-        if (ClientNameHolder.getCurrent() != null) {
-            client.query("client", ClientNameHolder.getCurrent());
-        }
-    }
-
-    public static String slurp(final InputStream from) throws IOException {
-        ByteArrayOutputStream to = new ByteArrayOutputStream();
-        byte[] buffer = new byte[1024];
-        int length;
-        while ((length = from.read(buffer)) != -1) {
-            to.write(buffer, 0, length);
-        }
-        to.flush();
-        return new String(to.toByteArray());
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.api;
+
+import jug.client.util.ClientNameHolder;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.codehaus.jettison.util.StringIndenter;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+public abstract class AbstractCommand {
+
+    protected String command;
+    protected String url;
+
+    protected WebClient client;
+
+    public void execute(final String cmd) {
+        final Response response = invoke(cmd);
+        if (response == null) {
+            return;
+        }
+
+        System.out.println("Status: " + response.getStatus());
+        try {
+            String json = slurp((InputStream) response.getEntity());
+            System.out.println(format(json));
+        } catch (IOException e) {
+            System.err.println("can't get output: " + e.getMessage());
+        }
+    }
+
+    protected String format(final String json) throws IOException {
+        final StringIndenter formatter = new StringIndenter(json);
+        final Writer outWriter = new StringWriter();
+        IOUtils.copy(new StringReader(formatter.result()), outWriter, 2048);
+        outWriter.close();
+        return outWriter.toString();
+    }
+
+    protected abstract Response invoke(final String cmd);
+
+    public void setCommand(String command) {
+        this.command = command;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+        client = WebClient.create(url).accept(MediaType.APPLICATION_JSON);
+        if (ClientNameHolder.getCurrent() != null) {
+            client.query("client", ClientNameHolder.getCurrent());
+        }
+    }
+
+    public static String slurp(final InputStream from) throws IOException {
+        ByteArrayOutputStream to = new ByteArrayOutputStream();
+        byte[] buffer = new byte[1024];
+        int length;
+        while ((length = from.read(buffer)) != -1) {
+            to.write(buffer, 0, length);
+        }
+        to.flush();
+        return new String(to.toByteArray());
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/Command.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/Command.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/Command.java
index dde75a0..52e5e8a 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/Command.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/api/Command.java
@@ -1,34 +1,34 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE})
-public @interface Command {
-
-    String usage() default "";
-
-    String name() default "";
-
-    String description() default "";
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface Command {
+
+    String usage() default "";
+
+    String name() default "";
+
+    String description() default "";
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/BestPollCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/BestPollCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/BestPollCommand.java
index 7222976..4393c89 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/BestPollCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/BestPollCommand.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-
-@Command(name = "best", usage = "best", description = "find best poll")
-public class BestPollCommand extends AbstractCommand {
-
-    @Override
-    protected Response invoke(String cmd) {
-        return client.path("api/subject/best").get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+
+@Command(name = "best", usage = "best", description = "find best poll")
+public class BestPollCommand extends AbstractCommand {
+
+    @Override
+    protected Response invoke(String cmd) {
+        return client.path("api/subject/best").get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ExitCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ExitCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ExitCommand.java
index d1ed1f0..dc9a42a 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ExitCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/ExitCommand.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-
-// just to get it in the help
-@Command(name = "exit", usage = "exit", description = "exit from the cli")
-public class ExitCommand extends AbstractCommand {
-
-    @Override
-    public void execute(String cmd) {
-        throw new UnsupportedOperationException("shouldn't be called directly");
-    }
-
-    @Override
-    protected Response invoke(String cmd) {
-        return null;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+
+// just to get it in the help
+@Command(name = "exit", usage = "exit", description = "exit from the cli")
+public class ExitCommand extends AbstractCommand {
+
+    @Override
+    public void execute(String cmd) {
+        throw new UnsupportedOperationException("shouldn't be called directly");
+    }
+
+    @Override
+    protected Response invoke(String cmd) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/HelpCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/HelpCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/HelpCommand.java
index 9c45efc..453ac63 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/HelpCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/HelpCommand.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-import java.util.Map;
-
-@Command(name = "help", usage = "help", description = "print this help")
-public class HelpCommand extends AbstractCommand {
-
-    private Map<String, Class<?>> commands;
-
-    @Override
-    public void execute(final String cmd) {
-        for (Map.Entry<String, Class<?>> command : commands.entrySet()) {
-            try {
-                final Class<?> clazz = command.getValue();
-                final Command annotation = clazz.getAnnotation(Command.class);
-                System.out.println(annotation.name() + ": " + annotation.description());
-                System.out.println("\tUsage: " + annotation.usage());
-            } catch (Exception e) {
-                // ignored = command not available
-            }
-        }
-    }
-
-    @Override
-    protected Response invoke(String cmd) {
-        return null;
-    }
-
-    public void setCommands(Map<String, Class<?>> commands) {
-        this.commands = commands;
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+import java.util.Map;
+
+@Command(name = "help", usage = "help", description = "print this help")
+public class HelpCommand extends AbstractCommand {
+
+    private Map<String, Class<?>> commands;
+
+    @Override
+    public void execute(final String cmd) {
+        for (Map.Entry<String, Class<?>> command : commands.entrySet()) {
+            try {
+                final Class<?> clazz = command.getValue();
+                final Command annotation = clazz.getAnnotation(Command.class);
+                System.out.println(annotation.name() + ": " + annotation.description());
+                System.out.println("\tUsage: " + annotation.usage());
+            } catch (Exception e) {
+                // ignored = command not available
+            }
+        }
+    }
+
+    @Override
+    protected Response invoke(String cmd) {
+        return null;
+    }
+
+    public void setCommands(Map<String, Class<?>> commands) {
+        this.commands = commands;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/NewPollCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/NewPollCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/NewPollCommand.java
index a65bc6a..77c9017 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/NewPollCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/NewPollCommand.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.Command;
-
-@Command(name = "new-poll", usage = "new-poll [<name>, <question>]", description = "create a new poll")
-public class NewPollCommand extends QueryAndPostCommand {
-
-    @Override
-    protected String getName() {
-        return "name";
-    }
-
-    @Override
-    protected String getPath() {
-        return "api/subject/create";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.Command;
+
+@Command(name = "new-poll", usage = "new-poll [<name>, <question>]", description = "create a new poll")
+public class NewPollCommand extends QueryAndPostCommand {
+
+    @Override
+    protected String getName() {
+        return "name";
+    }
+
+    @Override
+    protected String getPath() {
+        return "api/subject/create";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollResultCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollResultCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollResultCommand.java
index ad05774..8f06a7a 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollResultCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollResultCommand.java
@@ -1,40 +1,40 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-
-import static jug.client.command.impl.PollResultCommand.RESULT_CMD;
-
-@Command(name = RESULT_CMD, usage = RESULT_CMD + " <name>", description = "result of a poll")
-public class PollResultCommand extends AbstractCommand {
-
-    public static final String RESULT_CMD = "result";
-
-    @Override
-    protected Response invoke(String cmd) {
-        if (RESULT_CMD.length() + 1 >= cmd.length()) {
-            System.err.println("please specify a poll name");
-            return null;
-        }
-
-        return client.path("api/subject/result/".concat(cmd.substring(RESULT_CMD.length() + 1))).get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+
+import static jug.client.command.impl.PollResultCommand.RESULT_CMD;
+
+@Command(name = RESULT_CMD, usage = RESULT_CMD + " <name>", description = "result of a poll")
+public class PollResultCommand extends AbstractCommand {
+
+    public static final String RESULT_CMD = "result";
+
+    @Override
+    protected Response invoke(String cmd) {
+        if (RESULT_CMD.length() + 1 >= cmd.length()) {
+            System.err.println("please specify a poll name");
+            return null;
+        }
+
+        return client.path("api/subject/result/".concat(cmd.substring(RESULT_CMD.length() + 1))).get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollsCommand.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollsCommand.java b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollsCommand.java
index 8d78e6a..8d968d7 100644
--- a/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollsCommand.java
+++ b/examples/polling-parent/polling-client/src/main/java/jug/client/command/impl/PollsCommand.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.client.command.impl;
-
-import jug.client.command.api.AbstractCommand;
-import jug.client.command.api.Command;
-
-import javax.ws.rs.core.Response;
-
-@Command(name = "polls", usage = "polls", description = "list polls")
-public class PollsCommand extends AbstractCommand {
-
-    @Override
-    public Response invoke(final String cmd) {
-        return client.path("api/subject/list").get();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.client.command.impl;
+
+import jug.client.command.api.AbstractCommand;
+import jug.client.command.api.Command;
+
+import javax.ws.rs.core.Response;
+
+@Command(name = "polls", usage = "polls", description = "list polls")
+public class PollsCommand extends AbstractCommand {
+
+    @Override
+    public Response invoke(final String cmd) {
+        return client.path("api/subject/list").get();
+    }
+}


[19/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorOne.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorOne.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorOne.java
index 0bf59bf..324f2d8 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorOne.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorOne.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ClassLevelInterceptorOne {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassLevelInterceptorOne {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassOne.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassOne.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassOne.java
index 0fe5a11..e09fb34 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassOne.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassOne.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ClassLevelInterceptorSuperClassOne {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassLevelInterceptorSuperClassOne {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassTwo.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassTwo.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassTwo.java
index e769d5c..35f0d4e 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassTwo.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorSuperClassTwo.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ClassLevelInterceptorSuperClassTwo extends SuperClassOfClassLevelInterceptor {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassLevelInterceptorSuperClassTwo extends SuperClassOfClassLevelInterceptor {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorTwo.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorTwo.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorTwo.java
index 64bdad3..f8c7bf9 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorTwo.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ClassLevelInterceptorTwo.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ClassLevelInterceptorTwo {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassLevelInterceptorTwo {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorOne.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorOne.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorOne.java
index 441084f..adfc493 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorOne.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorOne.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.annotation.PostConstruct;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultInterceptorOne {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-    @PostConstruct
-    protected void postConstructInterceptor(InvocationContext ic) throws Exception {
-        Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DefaultInterceptorOne {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+    @PostConstruct
+    protected void postConstructInterceptor(InvocationContext ic) throws Exception {
+        Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorTwo.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorTwo.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorTwo.java
index 04059d3..6390771 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorTwo.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/DefaultInterceptorTwo.java
@@ -1,32 +1,32 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultInterceptorTwo {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DefaultInterceptorTwo {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyIntercepted.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyIntercepted.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyIntercepted.java
index 4dd81fa..14b34bc 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyIntercepted.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyIntercepted.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface FullyIntercepted {
-
-    List<String> businessMethod();
-
-    List<String> methodWithDefaultInterceptorsExcluded();
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface FullyIntercepted {
+
+    List<String> businessMethod();
+
+    List<String> methodWithDefaultInterceptorsExcluded();
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedBean.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedBean.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedBean.java
index df8c617..2dca44c 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedBean.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedBean.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptors;
-import javax.interceptor.InvocationContext;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-@Stateless
-@Local
-@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
-public class FullyInterceptedBean extends FullyInterceptedSuperClass implements FullyIntercepted {
-
-    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
-    public List<String> businessMethod() {
-        List<String> list = new ArrayList<String>();
-        list.add("businessMethod");
-        return list;
-    }
-
-    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
-    public List<String> methodWithDefaultInterceptorsExcluded() {
-        List<String> list = new ArrayList<String>();
-        list.add("methodWithDefaultInterceptorsExcluded");
-        return list;
-    }
-
-    @AroundInvoke
-    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, "beanClassBusinessMethodInterceptor");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptors;
+import javax.interceptor.InvocationContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Stateless
+@Local
+@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
+public class FullyInterceptedBean extends FullyInterceptedSuperClass implements FullyIntercepted {
+
+    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
+    public List<String> businessMethod() {
+        List<String> list = new ArrayList<String>();
+        list.add("businessMethod");
+        return list;
+    }
+
+    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
+    public List<String> methodWithDefaultInterceptorsExcluded() {
+        List<String> list = new ArrayList<String>();
+        list.add("methodWithDefaultInterceptorsExcluded");
+        return list;
+    }
+
+    @AroundInvoke
+    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, "beanClassBusinessMethodInterceptor");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedSuperClass.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedSuperClass.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedSuperClass.java
index efaddce..c4a4bd6 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedSuperClass.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/FullyInterceptedSuperClass.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.Interceptors;
-
-/**
- * @version $Rev$ $Date$
- */
-@Interceptors({ClassLevelInterceptorSuperClassOne.class, ClassLevelInterceptorSuperClassTwo.class})
-public class FullyInterceptedSuperClass {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.Interceptors;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Interceptors({ClassLevelInterceptorSuperClassOne.class, ClassLevelInterceptorSuperClassTwo.class})
+public class FullyInterceptedSuperClass {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOne.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOne.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOne.java
index 68ff9ae..fdd2059 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOne.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOne.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MethodLevelInterceptorOne {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MethodLevelInterceptorOne {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyIntf.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyIntf.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyIntf.java
index 6f5de3f..f0e595e 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyIntf.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyIntf.java
@@ -1,25 +1,25 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import java.io.Serializable;
-import java.util.List;
-
-public interface MethodLevelInterceptorOnlyIntf<T extends Serializable> {
-
-    public List<T> makePersistent(T entity);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface MethodLevelInterceptorOnlyIntf<T extends Serializable> {
+
+    public List<T> makePersistent(T entity);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyParent.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyParent.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyParent.java
index 60632a0..bde8c10 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyParent.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyParent.java
@@ -1,24 +1,24 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import java.util.List;
-
-public interface MethodLevelInterceptorOnlyParent extends MethodLevelInterceptorOnlyIntf<String> {
-
-    public List<String> makePersistent(String entity);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import java.util.List;
+
+public interface MethodLevelInterceptorOnlyParent extends MethodLevelInterceptorOnlyIntf<String> {
+
+    public List<String> makePersistent(String entity);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlySLSBean.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlySLSBean.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlySLSBean.java
index 865a6c9..c5a2086 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlySLSBean.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorOnlySLSBean.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-import javax.interceptor.Interceptors;
-import java.util.ArrayList;
-import java.util.List;
-
-@Local(MethodLevelInterceptorOnlyParent.class)
-@Stateless
-public class MethodLevelInterceptorOnlySLSBean implements MethodLevelInterceptorOnlyParent {
-
-    @Interceptors(MethodLevelInterceptorOne.class)
-    public List<String> makePersistent(String entity) {
-        List<String> list = new ArrayList<String>();
-        list.add("makePersistent");
-        return list;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.interceptor.Interceptors;
+import java.util.ArrayList;
+import java.util.List;
+
+@Local(MethodLevelInterceptorOnlyParent.class)
+@Stateless
+public class MethodLevelInterceptorOnlySLSBean implements MethodLevelInterceptorOnlyParent {
+
+    @Interceptors(MethodLevelInterceptorOne.class)
+    public List<String> makePersistent(String entity) {
+        List<String> list = new ArrayList<String>();
+        list.add("makePersistent");
+        return list;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorTwo.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorTwo.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorTwo.java
index 7a4d8b6..1569f58 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorTwo.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/MethodLevelInterceptorTwo.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MethodLevelInterceptorTwo {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MethodLevelInterceptorTwo {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedBean.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedBean.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedBean.java
index 9c4b794..2a028dd 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedBean.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedBean.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.ejb.Stateless;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptors;
-import javax.interceptor.InvocationContext;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-@Stateless
-@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
-public class SecondStatelessInterceptedBean implements SecondStatelessInterceptedLocal {
-
-    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
-    public List<String> methodWithDefaultInterceptorsExcluded() {
-        List<String> list = new ArrayList<String>();
-        list.add("methodWithDefaultInterceptorsExcluded");
-        return list;
-
-    }
-
-    @AroundInvoke
-    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.ejb.Stateless;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptors;
+import javax.interceptor.InvocationContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Stateless
+@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
+public class SecondStatelessInterceptedBean implements SecondStatelessInterceptedLocal {
+
+    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
+    public List<String> methodWithDefaultInterceptorsExcluded() {
+        List<String> list = new ArrayList<String>();
+        list.add("methodWithDefaultInterceptorsExcluded");
+        return list;
+
+    }
+
+    @AroundInvoke
+    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedLocal.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedLocal.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedLocal.java
index b75760e..b85aaa5 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedLocal.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/SecondStatelessInterceptedLocal.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface SecondStatelessInterceptedLocal {
-
-    List<String> methodWithDefaultInterceptorsExcluded();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface SecondStatelessInterceptedLocal {
+
+    List<String> methodWithDefaultInterceptorsExcluded();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/SuperClassOfClassLevelInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/SuperClassOfClassLevelInterceptor.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/SuperClassOfClassLevelInterceptor.java
index d97aafa..f80daa6 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/SuperClassOfClassLevelInterceptor.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/SuperClassOfClassLevelInterceptor.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.annotation.PostConstruct;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SuperClassOfClassLevelInterceptor {
-
-    @AroundInvoke
-    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-
-    @PostConstruct
-    protected void postConstructInterceptor(InvocationContext ic) throws Exception {
-        Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SuperClassOfClassLevelInterceptor {
+
+    @AroundInvoke
+    protected Object businessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+
+    @PostConstruct
+    protected void postConstructInterceptor(InvocationContext ic) throws Exception {
+        Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBean.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBean.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBean.java
index f2fa5ea..84ed7e1 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBean.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBean.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.ejb.Stateless;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.ExcludeClassInterceptors;
-import javax.interceptor.ExcludeDefaultInterceptors;
-import javax.interceptor.Interceptors;
-import javax.interceptor.InvocationContext;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-@Stateless
-@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
-@ExcludeDefaultInterceptors
-public class ThirdSLSBean implements ThirdSLSBeanLocal {
-
-    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
-    public List<String> businessMethod() {
-        List<String> list = new ArrayList<String>();
-        list.add("businessMethod");
-        return list;
-    }
-
-    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
-    @ExcludeClassInterceptors
-    public List<String> anotherBusinessMethod() {
-        List<String> list = new ArrayList<String>();
-        list.add("anotherBusinessMethod");
-        return list;
-    }
-
-    @AroundInvoke
-    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
-        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.ejb.Stateless;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.ExcludeClassInterceptors;
+import javax.interceptor.ExcludeDefaultInterceptors;
+import javax.interceptor.Interceptors;
+import javax.interceptor.InvocationContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Stateless
+@Interceptors({ClassLevelInterceptorOne.class, ClassLevelInterceptorTwo.class})
+@ExcludeDefaultInterceptors
+public class ThirdSLSBean implements ThirdSLSBeanLocal {
+
+    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
+    public List<String> businessMethod() {
+        List<String> list = new ArrayList<String>();
+        list.add("businessMethod");
+        return list;
+    }
+
+    @Interceptors({MethodLevelInterceptorOne.class, MethodLevelInterceptorTwo.class})
+    @ExcludeClassInterceptors
+    public List<String> anotherBusinessMethod() {
+        List<String> list = new ArrayList<String>();
+        list.add("anotherBusinessMethod");
+        return list;
+    }
+
+    @AroundInvoke
+    protected Object beanClassBusinessMethodInterceptor(InvocationContext ic) throws Exception {
+        return Utils.addClassSimpleName(ic, this.getClass().getSimpleName());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBeanLocal.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBeanLocal.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBeanLocal.java
index 7c08ee1..f903f41 100755
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBeanLocal.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/ThirdSLSBeanLocal.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface ThirdSLSBeanLocal {
-
-    List<String> businessMethod();
-
-    List<String> anotherBusinessMethod();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ThirdSLSBeanLocal {
+
+    List<String> businessMethod();
+
+    List<String> anotherBusinessMethod();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/main/java/org/superbiz/interceptors/Utils.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/main/java/org/superbiz/interceptors/Utils.java b/examples/interceptors/src/main/java/org/superbiz/interceptors/Utils.java
index 6d7c926..29b9030 100644
--- a/examples/interceptors/src/main/java/org/superbiz/interceptors/Utils.java
+++ b/examples/interceptors/src/main/java/org/superbiz/interceptors/Utils.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import javax.interceptor.InvocationContext;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $Rev$ $Date$
- */
-public class Utils {
-
-    public static List<String> addClassSimpleName(InvocationContext ic, String classSimpleName) throws Exception {
-        List<String> list = new ArrayList<String>();
-        list.add(classSimpleName);
-        List<String> listOfStrings = (List<String>) ic.proceed();
-        if (listOfStrings != null) {
-            list.addAll(listOfStrings);
-        }
-        return list;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import javax.interceptor.InvocationContext;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Utils {
+
+    public static List<String> addClassSimpleName(InvocationContext ic, String classSimpleName) throws Exception {
+        List<String> list = new ArrayList<String>();
+        list.add(classSimpleName);
+        List<String> listOfStrings = (List<String>) ic.proceed();
+        if (listOfStrings != null) {
+            list.addAll(listOfStrings);
+        }
+        return list;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/test/java/org/superbiz/interceptors/FullyInterceptedTest.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/test/java/org/superbiz/interceptors/FullyInterceptedTest.java b/examples/interceptors/src/test/java/org/superbiz/interceptors/FullyInterceptedTest.java
index 88eb53e..9c9cf1c 100755
--- a/examples/interceptors/src/test/java/org/superbiz/interceptors/FullyInterceptedTest.java
+++ b/examples/interceptors/src/test/java/org/superbiz/interceptors/FullyInterceptedTest.java
@@ -1,94 +1,94 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import junit.framework.TestCase;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class FullyInterceptedTest extends TestCase {
-
-    private InitialContext initCtx;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
-
-        initCtx = new InitialContext(properties);
-    }
-
-    @Test
-    public void testBusinessMethod() throws Exception {
-
-        FullyIntercepted fullyIntercepted = (FullyIntercepted) initCtx.lookup("FullyInterceptedBeanLocal");
-
-        assert fullyIntercepted != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("DefaultInterceptorOne");
-        expected.add("DefaultInterceptorTwo");
-        expected.add("ClassLevelInterceptorSuperClassOne");
-        expected.add("ClassLevelInterceptorSuperClassTwo");
-        expected.add("ClassLevelInterceptorOne");
-        expected.add("ClassLevelInterceptorTwo");
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("MethodLevelInterceptorTwo");
-        expected.add("beanClassBusinessMethodInterceptor");
-        expected.add("businessMethod");
-
-        List<String> actual = fullyIntercepted.businessMethod();
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
-
-    @Test
-    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
-
-        FullyIntercepted fullyIntercepted = (FullyIntercepted) initCtx.lookup("FullyInterceptedBeanLocal");
-
-        assert fullyIntercepted != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("ClassLevelInterceptorSuperClassOne");
-        expected.add("ClassLevelInterceptorSuperClassTwo");
-        expected.add("ClassLevelInterceptorOne");
-        expected.add("ClassLevelInterceptorTwo");
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("MethodLevelInterceptorTwo");
-        expected.add("beanClassBusinessMethodInterceptor");
-        expected.add("methodWithDefaultInterceptorsExcluded");
-
-        List<String> actual = fullyIntercepted.methodWithDefaultInterceptorsExcluded();
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        initCtx.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class FullyInterceptedTest extends TestCase {
+
+    private InitialContext initCtx;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
+
+        initCtx = new InitialContext(properties);
+    }
+
+    @Test
+    public void testBusinessMethod() throws Exception {
+
+        FullyIntercepted fullyIntercepted = (FullyIntercepted) initCtx.lookup("FullyInterceptedBeanLocal");
+
+        assert fullyIntercepted != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("DefaultInterceptorOne");
+        expected.add("DefaultInterceptorTwo");
+        expected.add("ClassLevelInterceptorSuperClassOne");
+        expected.add("ClassLevelInterceptorSuperClassTwo");
+        expected.add("ClassLevelInterceptorOne");
+        expected.add("ClassLevelInterceptorTwo");
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("MethodLevelInterceptorTwo");
+        expected.add("beanClassBusinessMethodInterceptor");
+        expected.add("businessMethod");
+
+        List<String> actual = fullyIntercepted.businessMethod();
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
+
+    @Test
+    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
+
+        FullyIntercepted fullyIntercepted = (FullyIntercepted) initCtx.lookup("FullyInterceptedBeanLocal");
+
+        assert fullyIntercepted != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("ClassLevelInterceptorSuperClassOne");
+        expected.add("ClassLevelInterceptorSuperClassTwo");
+        expected.add("ClassLevelInterceptorOne");
+        expected.add("ClassLevelInterceptorTwo");
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("MethodLevelInterceptorTwo");
+        expected.add("beanClassBusinessMethodInterceptor");
+        expected.add("methodWithDefaultInterceptorsExcluded");
+
+        List<String> actual = fullyIntercepted.methodWithDefaultInterceptorsExcluded();
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        initCtx.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/test/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyTest.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/test/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyTest.java b/examples/interceptors/src/test/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyTest.java
index eb07b46..937e0e0 100755
--- a/examples/interceptors/src/test/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyTest.java
+++ b/examples/interceptors/src/test/java/org/superbiz/interceptors/MethodLevelInterceptorOnlyTest.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MethodLevelInterceptorOnlyTest extends TestCase {
-
-    private InitialContext initCtx;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
-
-        initCtx = new InitialContext(properties);
-    }
-
-    @Test
-    public void testInterceptedGenerifiedBusinessIntfMethod() throws Exception {
-        MethodLevelInterceptorOnlyParent bean = (MethodLevelInterceptorOnlyParent) initCtx.lookup("MethodLevelInterceptorOnlySLSBeanLocal");
-
-        assert bean != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("makePersistent");
-
-        List<String> actual = bean.makePersistent(null);
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MethodLevelInterceptorOnlyTest extends TestCase {
+
+    private InitialContext initCtx;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
+
+        initCtx = new InitialContext(properties);
+    }
+
+    @Test
+    public void testInterceptedGenerifiedBusinessIntfMethod() throws Exception {
+        MethodLevelInterceptorOnlyParent bean = (MethodLevelInterceptorOnlyParent) initCtx.lookup("MethodLevelInterceptorOnlySLSBeanLocal");
+
+        assert bean != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("makePersistent");
+
+        List<String> actual = bean.makePersistent(null);
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/interceptors/src/test/java/org/superbiz/interceptors/SecondStatelessInterceptedTest.java
----------------------------------------------------------------------
diff --git a/examples/interceptors/src/test/java/org/superbiz/interceptors/SecondStatelessInterceptedTest.java b/examples/interceptors/src/test/java/org/superbiz/interceptors/SecondStatelessInterceptedTest.java
index 03f5388..ad6b363 100644
--- a/examples/interceptors/src/test/java/org/superbiz/interceptors/SecondStatelessInterceptedTest.java
+++ b/examples/interceptors/src/test/java/org/superbiz/interceptors/SecondStatelessInterceptedTest.java
@@ -1,63 +1,63 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.interceptors;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SecondStatelessInterceptedTest extends TestCase {
-
-    private InitialContext initCtx;
-
-    @Before
-    public void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
-
-        initCtx = new InitialContext(properties);
-    }
-
-    @Test
-    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
-        SecondStatelessInterceptedLocal bean =
-            (SecondStatelessInterceptedLocal) initCtx.lookup("SecondStatelessInterceptedBeanLocal");
-
-        assert bean != null;
-
-        List<String> expected = new ArrayList<String>();
-        expected.add("ClassLevelInterceptorOne");
-        expected.add("ClassLevelInterceptorTwo");
-        expected.add("MethodLevelInterceptorOne");
-        expected.add("MethodLevelInterceptorTwo");
-        expected.add("SecondStatelessInterceptedBean");
-        expected.add("methodWithDefaultInterceptorsExcluded");
-
-        List<String> actual = bean.methodWithDefaultInterceptorsExcluded();
-        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.interceptors;
+
+import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SecondStatelessInterceptedTest extends TestCase {
+
+    private InitialContext initCtx;
+
+    @Before
+    public void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include", ".*interceptors/target/classes.*");
+
+        initCtx = new InitialContext(properties);
+    }
+
+    @Test
+    public void testMethodWithDefaultInterceptorsExcluded() throws Exception {
+        SecondStatelessInterceptedLocal bean =
+                (SecondStatelessInterceptedLocal) initCtx.lookup("SecondStatelessInterceptedBeanLocal");
+
+        assert bean != null;
+
+        List<String> expected = new ArrayList<String>();
+        expected.add("ClassLevelInterceptorOne");
+        expected.add("ClassLevelInterceptorTwo");
+        expected.add("MethodLevelInterceptorOne");
+        expected.add("MethodLevelInterceptorTwo");
+        expected.add("SecondStatelessInterceptedBean");
+        expected.add("methodWithDefaultInterceptorsExcluded");
+
+        List<String> actual = bean.methodWithDefaultInterceptorsExcluded();
+        assert expected.equals(actual) : "Expected " + expected + ", but got " + actual;
+    }
+}


[21/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBRemote.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBRemote.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBRemote.java
index 9ad7ae4..3b58d9f 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBRemote.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedEJBRemote.java
@@ -1,28 +1,27 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface AnnotatedEJBRemote {
-
-    String getName();
-
-    void setName(String name);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface AnnotatedEJBRemote {
+
+    String getName();
+
+    void setName(String name);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedServlet.java
index e26ff11..ca8facf 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/AnnotatedServlet.java
@@ -1,88 +1,87 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.sql.DataSource;
-import java.io.IOException;
-
-public class AnnotatedServlet extends HttpServlet {
-
-    @EJB
-    private AnnotatedEJBLocal localEJB;
-
-    @EJB
-    private AnnotatedEJBRemote remoteEJB;
-
-    @EJB
-    private AnnotatedEJB localbeanEJB;
-
-    @Resource
-    private DataSource ds;
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        ServletOutputStream out = response.getOutputStream();
-
-        out.println("LocalBean EJB");
-        out.println("@EJB=" + localbeanEJB);
-        if (localbeanEJB != null) {
-            out.println("@EJB.getName()=" + localbeanEJB.getName());
-            out.println("@EJB.getDs()=" + localbeanEJB.getDs());
-        }
-        out.println("JNDI=" + lookupField("localbeanEJB"));
-        out.println();
-
-        out.println("Local EJB");
-        out.println("@EJB=" + localEJB);
-        if (localEJB != null) {
-            out.println("@EJB.getName()=" + localEJB.getName());
-            out.println("@EJB.getDs()=" + localEJB.getDs());
-        }
-        out.println("JNDI=" + lookupField("localEJB"));
-        out.println();
-
-        out.println("Remote EJB");
-        out.println("@EJB=" + remoteEJB);
-        if (localEJB != null) {
-            out.println("@EJB.getName()=" + remoteEJB.getName());
-        }
-        out.println("JNDI=" + lookupField("remoteEJB"));
-        out.println();
-
-        out.println("DataSource");
-        out.println("@Resource=" + ds);
-        out.println("JNDI=" + lookupField("ds"));
-    }
-
-    private Object lookupField(String name) {
-        try {
-            return new InitialContext().lookup("java:comp/env/" + getClass().getName() + "/" + name);
-        } catch (NamingException e) {
-            return null;
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.sql.DataSource;
+import java.io.IOException;
+
+public class AnnotatedServlet extends HttpServlet {
+
+    @EJB
+    private AnnotatedEJBLocal localEJB;
+
+    @EJB
+    private AnnotatedEJBRemote remoteEJB;
+
+    @EJB
+    private AnnotatedEJB localbeanEJB;
+
+    @Resource
+    private DataSource ds;
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        out.println("LocalBean EJB");
+        out.println("@EJB=" + localbeanEJB);
+        if (localbeanEJB != null) {
+            out.println("@EJB.getName()=" + localbeanEJB.getName());
+            out.println("@EJB.getDs()=" + localbeanEJB.getDs());
+        }
+        out.println("JNDI=" + lookupField("localbeanEJB"));
+        out.println();
+
+        out.println("Local EJB");
+        out.println("@EJB=" + localEJB);
+        if (localEJB != null) {
+            out.println("@EJB.getName()=" + localEJB.getName());
+            out.println("@EJB.getDs()=" + localEJB.getDs());
+        }
+        out.println("JNDI=" + lookupField("localEJB"));
+        out.println();
+
+        out.println("Remote EJB");
+        out.println("@EJB=" + remoteEJB);
+        if (localEJB != null) {
+            out.println("@EJB.getName()=" + remoteEJB.getName());
+        }
+        out.println("JNDI=" + lookupField("remoteEJB"));
+        out.println();
+
+        out.println("DataSource");
+        out.println("@Resource=" + ds);
+        out.println("JNDI=" + lookupField("ds"));
+    }
+
+    private Object lookupField(String name) {
+        try {
+            return new InitialContext().lookup("java:comp/env/" + getClass().getName() + "/" + name);
+        } catch (NamingException e) {
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/ClientHandler.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ClientHandler.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ClientHandler.java
index 16cacc3..040353a 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ClientHandler.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ClientHandler.java
@@ -1,38 +1,37 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-public class ClientHandler implements Handler {
-
-    public boolean handleMessage(MessageContext messageContext) {
-        WebserviceServlet.write("    ClientHandler handleMessage");
-        return true;
-    }
-
-    public void close(MessageContext messageContext) {
-        WebserviceServlet.write("    ClientHandler close");
-    }
-
-    public boolean handleFault(MessageContext messageContext) {
-        WebserviceServlet.write("    ClientHandler handleFault");
-        return true;
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+
+public class ClientHandler implements Handler {
+
+    public boolean handleMessage(MessageContext messageContext) {
+        WebserviceServlet.write("    ClientHandler handleMessage");
+        return true;
+    }
+
+    public void close(MessageContext messageContext) {
+        WebserviceServlet.write("    ClientHandler close");
+    }
+
+    public boolean handleFault(MessageContext messageContext) {
+        WebserviceServlet.write("    ClientHandler handleFault");
+        return true;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjb.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjb.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjb.java
index 27598d9..6d9545c 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjb.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjb.java
@@ -1,26 +1,25 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.jws.WebService;
-
-@WebService(targetNamespace = "http://examples.org/wsdl")
-public interface HelloEjb {
-
-    String hello(String name);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://examples.org/wsdl")
+public interface HelloEjb {
+
+    String hello(String name);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjbService.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjbService.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjbService.java
index d616ae8..759d210 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjbService.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloEjbService.java
@@ -1,41 +1,40 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.Stateless;
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-@WebService(
-               portName = "HelloEjbPort",
-               serviceName = "HelloEjbService",
-               targetNamespace = "http://examples.org/wsdl",
-               endpointInterface = "org.superbiz.servlet.HelloEjb"
-)
-@HandlerChain(file = "server-handlers.xml")
-@Stateless
-public class HelloEjbService implements HelloEjb {
-
-    public String hello(String name) {
-        WebserviceServlet.write("                HelloEjbService hello(" + name + ")");
-        if (name == null) {
-            name = "World";
-        }
-        return "Hello " + name + " from EJB Webservice!";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+@WebService(
+        portName = "HelloEjbPort",
+        serviceName = "HelloEjbService",
+        targetNamespace = "http://examples.org/wsdl",
+        endpointInterface = "org.superbiz.servlet.HelloEjb"
+)
+@HandlerChain(file = "server-handlers.xml")
+@Stateless
+public class HelloEjbService implements HelloEjb {
+
+    public String hello(String name) {
+        WebserviceServlet.write("                HelloEjbService hello(" + name + ")");
+        if (name == null) {
+            name = "World";
+        }
+        return "Hello " + name + " from EJB Webservice!";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojo.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojo.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojo.java
index 574c280..23b48af 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojo.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojo.java
@@ -1,26 +1,25 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.jws.WebService;
-
-@WebService(targetNamespace = "http://examples.org/wsdl")
-public interface HelloPojo {
-
-    String hello(String name);
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://examples.org/wsdl")
+public interface HelloPojo {
+
+    String hello(String name);
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojoService.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojoService.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojoService.java
index 10d891f..622f315 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojoService.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/HelloPojoService.java
@@ -1,39 +1,38 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-@WebService(
-               portName = "HelloPojoPort",
-               serviceName = "HelloPojoService",
-               targetNamespace = "http://examples.org/wsdl",
-               endpointInterface = "org.superbiz.servlet.HelloPojo"
-)
-@HandlerChain(file = "server-handlers.xml")
-public class HelloPojoService implements HelloPojo {
-
-    public String hello(String name) {
-        WebserviceServlet.write("                HelloPojoService hello(" + name + ")");
-        if (name == null) {
-            name = "World";
-        }
-        return "Hello " + name + " from Pojo Webservice!";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+@WebService(
+        portName = "HelloPojoPort",
+        serviceName = "HelloPojoService",
+        targetNamespace = "http://examples.org/wsdl",
+        endpointInterface = "org.superbiz.servlet.HelloPojo"
+)
+@HandlerChain(file = "server-handlers.xml")
+public class HelloPojoService implements HelloPojo {
+
+    public String hello(String name) {
+        WebserviceServlet.write("                HelloPojoService hello(" + name + ")");
+        if (name == null) {
+            name = "World";
+        }
+        return "Hello " + name + " from Pojo Webservice!";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/JndiServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JndiServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JndiServlet.java
index 1e9cbba..7482814 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JndiServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JndiServlet.java
@@ -1,85 +1,84 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NameClassPair;
-import javax.naming.NamingException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class JndiServlet extends HttpServlet {
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        ServletOutputStream out = response.getOutputStream();
-
-        Map<String, Object> bindings = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
-        try {
-            Context context = (Context) new InitialContext().lookup("java:comp/");
-            addBindings("", bindings, context);
-        } catch (NamingException e) {
-            throw new ServletException(e);
-        }
-
-        out.println("JNDI Context:");
-        for (Map.Entry<String, Object> entry : bindings.entrySet()) {
-            if (entry.getValue() != null) {
-                out.println("  " + entry.getKey() + "=" + entry.getValue());
-            } else {
-                out.println("  " + entry.getKey());
-            }
-        }
-    }
-
-    private void addBindings(String path, Map<String, Object> bindings, Context context) {
-        try {
-            for (NameClassPair pair : Collections.list(context.list(""))) {
-                String name = pair.getName();
-                String className = pair.getClassName();
-                if ("org.apache.naming.resources.FileDirContext$FileResource".equals(className)) {
-                    bindings.put(path + name, "<file>");
-                } else {
-                    try {
-                        Object value = context.lookup(name);
-                        if (value instanceof Context) {
-                            Context nextedContext = (Context) value;
-                            bindings.put(path + name, "");
-                            addBindings(path + name + "/", bindings, nextedContext);
-                        } else {
-                            bindings.put(path + name, value);
-                        }
-                    } catch (NamingException e) {
-                        // lookup failed
-                        bindings.put(path + name, "ERROR: " + e.getMessage());
-                    }
-                }
-            }
-        } catch (NamingException e) {
-            bindings.put(path, "ERROR: list bindings threw an exception: " + e.getMessage());
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameClassPair;
+import javax.naming.NamingException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class JndiServlet extends HttpServlet {
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        Map<String, Object> bindings = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
+        try {
+            Context context = (Context) new InitialContext().lookup("java:comp/");
+            addBindings("", bindings, context);
+        } catch (NamingException e) {
+            throw new ServletException(e);
+        }
+
+        out.println("JNDI Context:");
+        for (Map.Entry<String, Object> entry : bindings.entrySet()) {
+            if (entry.getValue() != null) {
+                out.println("  " + entry.getKey() + "=" + entry.getValue());
+            } else {
+                out.println("  " + entry.getKey());
+            }
+        }
+    }
+
+    private void addBindings(String path, Map<String, Object> bindings, Context context) {
+        try {
+            for (NameClassPair pair : Collections.list(context.list(""))) {
+                String name = pair.getName();
+                String className = pair.getClassName();
+                if ("org.apache.naming.resources.FileDirContext$FileResource".equals(className)) {
+                    bindings.put(path + name, "<file>");
+                } else {
+                    try {
+                        Object value = context.lookup(name);
+                        if (value instanceof Context) {
+                            Context nextedContext = (Context) value;
+                            bindings.put(path + name, "");
+                            addBindings(path + name + "/", bindings, nextedContext);
+                        } else {
+                            bindings.put(path + name, value);
+                        }
+                    } catch (NamingException e) {
+                        // lookup failed
+                        bindings.put(path + name, "ERROR: " + e.getMessage());
+                    }
+                }
+            }
+        } catch (NamingException e) {
+            bindings.put(path, "ERROR: list bindings threw an exception: " + e.getMessage());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaBean.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaBean.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaBean.java
index 7ba61a9..284efbb 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaBean.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaBean.java
@@ -1,52 +1,51 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Entity
-public class JpaBean {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private int id;
-
-    @Column(name = "name")
-    private String name;
-
-    public int getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String toString() {
-        return "[JpaBean id=" + id + ", name=" + name + "]";
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Entity
+public class JpaBean {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private int id;
+
+    @Column(name = "name")
+    private String name;
+
+    public int getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String toString() {
+        return "[JpaBean id=" + id + ", name=" + name + "]";
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaServlet.java
index d2d7525..92419ac 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/JpaServlet.java
@@ -1,73 +1,72 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.PersistenceUnit;
-import javax.persistence.Query;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-public class JpaServlet extends HttpServlet {
-
-    @PersistenceUnit(name = "jpa-example")
-    private EntityManagerFactory emf;
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        ServletOutputStream out = response.getOutputStream();
-
-        out.println("@PersistenceUnit=" + emf);
-
-        EntityManager em = emf.createEntityManager();
-        EntityTransaction transaction = em.getTransaction();
-        transaction.begin();
-
-        JpaBean jpaBean = new JpaBean();
-        jpaBean.setName("JpaBean");
-        em.persist(jpaBean);
-
-        transaction.commit();
-        transaction.begin();
-
-        Query query = em.createQuery("SELECT j FROM JpaBean j WHERE j.name='JpaBean'");
-        jpaBean = (JpaBean) query.getSingleResult();
-        out.println("Loaded " + jpaBean);
-
-        em.remove(jpaBean);
-
-        transaction.commit();
-        transaction.begin();
-
-        query = em.createQuery("SELECT count(j) FROM JpaBean j WHERE j.name='JpaBean'");
-        int count = ((Number) query.getSingleResult()).intValue();
-        if (count == 0) {
-            out.println("Removed " + jpaBean);
-        } else {
-            out.println("ERROR: unable to remove" + jpaBean);
-        }
-
-        transaction.commit();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
+import javax.persistence.PersistenceUnit;
+import javax.persistence.Query;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class JpaServlet extends HttpServlet {
+
+    @PersistenceUnit(name = "jpa-example")
+    private EntityManagerFactory emf;
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        out.println("@PersistenceUnit=" + emf);
+
+        EntityManager em = emf.createEntityManager();
+        EntityTransaction transaction = em.getTransaction();
+        transaction.begin();
+
+        JpaBean jpaBean = new JpaBean();
+        jpaBean.setName("JpaBean");
+        em.persist(jpaBean);
+
+        transaction.commit();
+        transaction.begin();
+
+        Query query = em.createQuery("SELECT j FROM JpaBean j WHERE j.name='JpaBean'");
+        jpaBean = (JpaBean) query.getSingleResult();
+        out.println("Loaded " + jpaBean);
+
+        em.remove(jpaBean);
+
+        transaction.commit();
+        transaction.begin();
+
+        query = em.createQuery("SELECT count(j) FROM JpaBean j WHERE j.name='JpaBean'");
+        int count = ((Number) query.getSingleResult()).intValue();
+        if (count == 0) {
+            out.println("Removed " + jpaBean);
+        } else {
+            out.println("ERROR: unable to remove" + jpaBean);
+        }
+
+        transaction.commit();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/ResourceBean.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ResourceBean.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ResourceBean.java
index 81b2d7d..8a57be2 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ResourceBean.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ResourceBean.java
@@ -1,35 +1,34 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-public class ResourceBean {
-
-    private String value;
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String toString() {
-        return "[ResourceBean " + value + "]";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+public class ResourceBean {
+
+    private String value;
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String toString() {
+        return "[ResourceBean " + value + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/RunAsServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/RunAsServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/RunAsServlet.java
index 64e6e21..6fd3f46 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/RunAsServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/RunAsServlet.java
@@ -1,93 +1,92 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-public class RunAsServlet extends HttpServlet {
-
-    @EJB
-    private SecureEJBLocal secureEJBLocal;
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        ServletOutputStream out = response.getOutputStream();
-
-        out.println("Servlet");
-        Principal principal = request.getUserPrincipal();
-        if (principal != null) {
-            out.println("Servlet.getUserPrincipal()=" + principal + " [" + principal.getName() + "]");
-        } else {
-            out.println("Servlet.getUserPrincipal()=<null>");
-        }
-        out.println("Servlet.isCallerInRole(\"user\")=" + request.isUserInRole("user"));
-        out.println("Servlet.isCallerInRole(\"manager\")=" + request.isUserInRole("manager"));
-        out.println("Servlet.isCallerInRole(\"fake\")=" + request.isUserInRole("fake"));
-        out.println();
-
-        out.println("@EJB=" + secureEJBLocal);
-        if (secureEJBLocal != null) {
-            principal = secureEJBLocal.getCallerPrincipal();
-            if (principal != null) {
-                out.println("@EJB.getCallerPrincipal()=" + principal + " [" + principal.getName() + "]");
-            } else {
-                out.println("@EJB.getCallerPrincipal()=<null>");
-            }
-            out.println("@EJB.isCallerInRole(\"user\")=" + secureEJBLocal.isCallerInRole("user"));
-            out.println("@EJB.isCallerInRole(\"manager\")=" + secureEJBLocal.isCallerInRole("manager"));
-            out.println("@EJB.isCallerInRole(\"fake\")=" + secureEJBLocal.isCallerInRole("fake"));
-
-            try {
-                secureEJBLocal.allowUserMethod();
-                out.println("@EJB.allowUserMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.allowUserMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.allowManagerMethod();
-                out.println("@EJB.allowManagerMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.allowManagerMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.allowFakeMethod();
-                out.println("@EJB.allowFakeMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.allowFakeMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.denyAllMethod();
-                out.println("@EJB.denyAllMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.denyAllMethod() DENIED");
-            }
-        }
-        out.println();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.Principal;
+
+public class RunAsServlet extends HttpServlet {
+
+    @EJB
+    private SecureEJBLocal secureEJBLocal;
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        out.println("Servlet");
+        Principal principal = request.getUserPrincipal();
+        if (principal != null) {
+            out.println("Servlet.getUserPrincipal()=" + principal + " [" + principal.getName() + "]");
+        } else {
+            out.println("Servlet.getUserPrincipal()=<null>");
+        }
+        out.println("Servlet.isCallerInRole(\"user\")=" + request.isUserInRole("user"));
+        out.println("Servlet.isCallerInRole(\"manager\")=" + request.isUserInRole("manager"));
+        out.println("Servlet.isCallerInRole(\"fake\")=" + request.isUserInRole("fake"));
+        out.println();
+
+        out.println("@EJB=" + secureEJBLocal);
+        if (secureEJBLocal != null) {
+            principal = secureEJBLocal.getCallerPrincipal();
+            if (principal != null) {
+                out.println("@EJB.getCallerPrincipal()=" + principal + " [" + principal.getName() + "]");
+            } else {
+                out.println("@EJB.getCallerPrincipal()=<null>");
+            }
+            out.println("@EJB.isCallerInRole(\"user\")=" + secureEJBLocal.isCallerInRole("user"));
+            out.println("@EJB.isCallerInRole(\"manager\")=" + secureEJBLocal.isCallerInRole("manager"));
+            out.println("@EJB.isCallerInRole(\"fake\")=" + secureEJBLocal.isCallerInRole("fake"));
+
+            try {
+                secureEJBLocal.allowUserMethod();
+                out.println("@EJB.allowUserMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.allowUserMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.allowManagerMethod();
+                out.println("@EJB.allowManagerMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.allowManagerMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.allowFakeMethod();
+                out.println("@EJB.allowFakeMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.allowFakeMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.denyAllMethod();
+                out.println("@EJB.denyAllMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.denyAllMethod() DENIED");
+            }
+        }
+        out.println();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJB.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJB.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJB.java
index d4d6b7d..3684dab 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJB.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJB.java
@@ -1,62 +1,61 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.annotation.Resource;
-import javax.annotation.security.DeclareRoles;
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
-import java.security.Principal;
-
-@Stateless
-@DeclareRoles({"user", "manager", "fake"})
-public class SecureEJB implements SecureEJBLocal {
-
-    @Resource
-    private SessionContext context;
-
-    public Principal getCallerPrincipal() {
-        return context.getCallerPrincipal();
-    }
-
-    public boolean isCallerInRole(String role) {
-        return context.isCallerInRole(role);
-    }
-
-    @RolesAllowed("user")
-    public void allowUserMethod() {
-    }
-
-    @RolesAllowed("manager")
-    public void allowManagerMethod() {
-    }
-
-    @RolesAllowed("fake")
-    public void allowFakeMethod() {
-    }
-
-    @DenyAll
-    public void denyAllMethod() {
-    }
-
-    public String toString() {
-        return "SecureEJB[userName=" + getCallerPrincipal() + "]";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.annotation.Resource;
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.DenyAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import java.security.Principal;
+
+@Stateless
+@DeclareRoles({"user", "manager", "fake"})
+public class SecureEJB implements SecureEJBLocal {
+
+    @Resource
+    private SessionContext context;
+
+    public Principal getCallerPrincipal() {
+        return context.getCallerPrincipal();
+    }
+
+    public boolean isCallerInRole(String role) {
+        return context.isCallerInRole(role);
+    }
+
+    @RolesAllowed("user")
+    public void allowUserMethod() {
+    }
+
+    @RolesAllowed("manager")
+    public void allowManagerMethod() {
+    }
+
+    @RolesAllowed("fake")
+    public void allowFakeMethod() {
+    }
+
+    @DenyAll
+    public void denyAllMethod() {
+    }
+
+    public String toString() {
+        return "SecureEJB[userName=" + getCallerPrincipal() + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJBLocal.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJBLocal.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJBLocal.java
index 41c968d..d253617 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJBLocal.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureEJBLocal.java
@@ -1,37 +1,36 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.Local;
-import java.security.Principal;
-
-@Local
-public interface SecureEJBLocal {
-
-    Principal getCallerPrincipal();
-
-    boolean isCallerInRole(String role);
-
-    void allowUserMethod();
-
-    void allowManagerMethod();
-
-    void allowFakeMethod();
-
-    void denyAllMethod();
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.Local;
+import java.security.Principal;
+
+@Local
+public interface SecureEJBLocal {
+
+    Principal getCallerPrincipal();
+
+    boolean isCallerInRole(String role);
+
+    void allowUserMethod();
+
+    void allowManagerMethod();
+
+    void allowFakeMethod();
+
+    void denyAllMethod();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureServlet.java
index 4ba141c..f3ab625 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/SecureServlet.java
@@ -1,93 +1,92 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-public class SecureServlet extends HttpServlet {
-
-    @EJB
-    private SecureEJBLocal secureEJBLocal;
-
-    protected void doGet(final HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        final ServletOutputStream out = response.getOutputStream();
-
-        out.println("Servlet");
-        Principal principal = request.getUserPrincipal();
-        if (principal != null) {
-            out.println("Servlet.getUserPrincipal()=" + principal + " [" + principal.getName() + "]");
-        } else {
-            out.println("Servlet.getUserPrincipal()=<null>");
-        }
-        out.println("Servlet.isCallerInRole(\"user\")=" + request.isUserInRole("user"));
-        out.println("Servlet.isCallerInRole(\"manager\")=" + request.isUserInRole("manager"));
-        out.println("Servlet.isCallerInRole(\"fake\")=" + request.isUserInRole("fake"));
-        out.println();
-
-        out.println("@EJB=" + secureEJBLocal);
-        if (secureEJBLocal != null) {
-            principal = secureEJBLocal.getCallerPrincipal();
-            if (principal != null) {
-                out.println("@EJB.getCallerPrincipal()=" + principal + " [" + principal.getName() + "]");
-            } else {
-                out.println("@EJB.getCallerPrincipal()=<null>");
-            }
-            out.println("@EJB.isCallerInRole(\"user\")=" + secureEJBLocal.isCallerInRole("user"));
-            out.println("@EJB.isCallerInRole(\"manager\")=" + secureEJBLocal.isCallerInRole("manager"));
-            out.println("@EJB.isCallerInRole(\"fake\")=" + secureEJBLocal.isCallerInRole("fake"));
-
-            try {
-                secureEJBLocal.allowUserMethod();
-                out.println("@EJB.allowUserMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.allowUserMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.allowManagerMethod();
-                out.println("@EJB.allowManagerMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.allowManagerMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.allowFakeMethod();
-                out.println("@EJB.allowFakeMethod() ALLOWED");
-            } catch (final EJBAccessException e) {
-                out.println("@EJB.allowFakeMethod() DENIED");
-            }
-
-            try {
-                secureEJBLocal.denyAllMethod();
-                out.println("@EJB.denyAllMethod() ALLOWED");
-            } catch (EJBAccessException e) {
-                out.println("@EJB.denyAllMethod() DENIED");
-            }
-        }
-        out.println();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.Principal;
+
+public class SecureServlet extends HttpServlet {
+
+    @EJB
+    private SecureEJBLocal secureEJBLocal;
+
+    protected void doGet(final HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        final ServletOutputStream out = response.getOutputStream();
+
+        out.println("Servlet");
+        Principal principal = request.getUserPrincipal();
+        if (principal != null) {
+            out.println("Servlet.getUserPrincipal()=" + principal + " [" + principal.getName() + "]");
+        } else {
+            out.println("Servlet.getUserPrincipal()=<null>");
+        }
+        out.println("Servlet.isCallerInRole(\"user\")=" + request.isUserInRole("user"));
+        out.println("Servlet.isCallerInRole(\"manager\")=" + request.isUserInRole("manager"));
+        out.println("Servlet.isCallerInRole(\"fake\")=" + request.isUserInRole("fake"));
+        out.println();
+
+        out.println("@EJB=" + secureEJBLocal);
+        if (secureEJBLocal != null) {
+            principal = secureEJBLocal.getCallerPrincipal();
+            if (principal != null) {
+                out.println("@EJB.getCallerPrincipal()=" + principal + " [" + principal.getName() + "]");
+            } else {
+                out.println("@EJB.getCallerPrincipal()=<null>");
+            }
+            out.println("@EJB.isCallerInRole(\"user\")=" + secureEJBLocal.isCallerInRole("user"));
+            out.println("@EJB.isCallerInRole(\"manager\")=" + secureEJBLocal.isCallerInRole("manager"));
+            out.println("@EJB.isCallerInRole(\"fake\")=" + secureEJBLocal.isCallerInRole("fake"));
+
+            try {
+                secureEJBLocal.allowUserMethod();
+                out.println("@EJB.allowUserMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.allowUserMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.allowManagerMethod();
+                out.println("@EJB.allowManagerMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.allowManagerMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.allowFakeMethod();
+                out.println("@EJB.allowFakeMethod() ALLOWED");
+            } catch (final EJBAccessException e) {
+                out.println("@EJB.allowFakeMethod() DENIED");
+            }
+
+            try {
+                secureEJBLocal.denyAllMethod();
+                out.println("@EJB.denyAllMethod() ALLOWED");
+            } catch (EJBAccessException e) {
+                out.println("@EJB.denyAllMethod() DENIED");
+            }
+        }
+        out.println();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/ServerHandler.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ServerHandler.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ServerHandler.java
index 55ce0b7..c098ca8 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/ServerHandler.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/ServerHandler.java
@@ -1,38 +1,37 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-public class ServerHandler implements Handler {
-
-    public boolean handleMessage(MessageContext messageContext) {
-        WebserviceServlet.write("        ServerHandler handleMessage");
-        return true;
-    }
-
-    public void close(MessageContext messageContext) {
-        WebserviceServlet.write("        ServerHandler close");
-    }
-
-    public boolean handleFault(MessageContext messageContext) {
-        WebserviceServlet.write("        ServerHandler handleFault");
-        return true;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+
+public class ServerHandler implements Handler {
+
+    public boolean handleMessage(MessageContext messageContext) {
+        WebserviceServlet.write("        ServerHandler handleMessage");
+        return true;
+    }
+
+    public void close(MessageContext messageContext) {
+        WebserviceServlet.write("        ServerHandler close");
+    }
+
+    public boolean handleFault(MessageContext messageContext) {
+        WebserviceServlet.write("        ServerHandler handleFault");
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceClient.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceClient.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceClient.java
index 1c49f79..ea31abb 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceClient.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceClient.java
@@ -1,80 +1,79 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.xml.ws.Service;
-import java.io.PrintStream;
-import java.net.URL;
-
-public class WebserviceClient {
-
-    /**
-     * Unfortunately, to run this example with CXF you need to have a HUGE class path.  This
-     * is just what is required to run CXF:
-     * <p/>
-     * jaxb-api-2.0.jar
-     * jaxb-impl-2.0.3.jar
-     * <p/>
-     * saaj-api-1.3.jar
-     * saaj-impl-1.3.jar
-     * <p/>
-     * <p/>
-     * cxf-api-2.0.2-incubator.jar
-     * cxf-common-utilities-2.0.2-incubator.jar
-     * cxf-rt-bindings-soap-2.0.2-incubator.jar
-     * cxf-rt-core-2.0.2-incubator.jar
-     * cxf-rt-databinding-jaxb-2.0.2-incubator.jar
-     * cxf-rt-frontend-jaxws-2.0.2-incubator.jar
-     * cxf-rt-frontend-simple-2.0.2-incubator.jar
-     * cxf-rt-transports-http-jetty-2.0.2-incubator.jar
-     * cxf-rt-transports-http-2.0.2-incubator.jar
-     * cxf-tools-common-2.0.2-incubator.jar
-     * <p/>
-     * geronimo-activation_1.1_spec-1.0.jar
-     * geronimo-annotation_1.0_spec-1.1.jar
-     * geronimo-ejb_3.0_spec-1.0.jar
-     * geronimo-jpa_3.0_spec-1.1.jar
-     * geronimo-servlet_2.5_spec-1.1.jar
-     * geronimo-stax-api_1.0_spec-1.0.jar
-     * jaxws-api-2.0.jar
-     * axis2-jws-api-1.3.jar
-     * <p/>
-     * wsdl4j-1.6.1.jar
-     * xml-resolver-1.2.jar
-     * XmlSchema-1.3.1.jar
-     */
-    public static void main(String[] args) throws Exception {
-        PrintStream out = System.out;
-
-        Service helloPojoService = Service.create(new URL("http://localhost:8080/ejb-examples/hello?wsdl"), null);
-        HelloPojo helloPojo = helloPojoService.getPort(HelloPojo.class);
-        out.println();
-        out.println("Pojo Webservice");
-        out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
-        out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
-        out.println();
-
-        Service helloEjbService = Service.create(new URL("http://localhost:8080/HelloEjbService?wsdl"), null);
-        HelloEjb helloEjb = helloEjbService.getPort(HelloEjb.class);
-        out.println();
-        out.println("EJB Webservice");
-        out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
-        out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
-        out.println();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.xml.ws.Service;
+import java.io.PrintStream;
+import java.net.URL;
+
+public class WebserviceClient {
+
+    /**
+     * Unfortunately, to run this example with CXF you need to have a HUGE class path.  This
+     * is just what is required to run CXF:
+     * <p/>
+     * jaxb-api-2.0.jar
+     * jaxb-impl-2.0.3.jar
+     * <p/>
+     * saaj-api-1.3.jar
+     * saaj-impl-1.3.jar
+     * <p/>
+     * <p/>
+     * cxf-api-2.0.2-incubator.jar
+     * cxf-common-utilities-2.0.2-incubator.jar
+     * cxf-rt-bindings-soap-2.0.2-incubator.jar
+     * cxf-rt-core-2.0.2-incubator.jar
+     * cxf-rt-databinding-jaxb-2.0.2-incubator.jar
+     * cxf-rt-frontend-jaxws-2.0.2-incubator.jar
+     * cxf-rt-frontend-simple-2.0.2-incubator.jar
+     * cxf-rt-transports-http-jetty-2.0.2-incubator.jar
+     * cxf-rt-transports-http-2.0.2-incubator.jar
+     * cxf-tools-common-2.0.2-incubator.jar
+     * <p/>
+     * geronimo-activation_1.1_spec-1.0.jar
+     * geronimo-annotation_1.0_spec-1.1.jar
+     * geronimo-ejb_3.0_spec-1.0.jar
+     * geronimo-jpa_3.0_spec-1.1.jar
+     * geronimo-servlet_2.5_spec-1.1.jar
+     * geronimo-stax-api_1.0_spec-1.0.jar
+     * jaxws-api-2.0.jar
+     * axis2-jws-api-1.3.jar
+     * <p/>
+     * wsdl4j-1.6.1.jar
+     * xml-resolver-1.2.jar
+     * XmlSchema-1.3.1.jar
+     */
+    public static void main(String[] args) throws Exception {
+        PrintStream out = System.out;
+
+        Service helloPojoService = Service.create(new URL("http://localhost:8080/ejb-examples/hello?wsdl"), null);
+        HelloPojo helloPojo = helloPojoService.getPort(HelloPojo.class);
+        out.println();
+        out.println("Pojo Webservice");
+        out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
+        out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
+        out.println();
+
+        Service helloEjbService = Service.create(new URL("http://localhost:8080/HelloEjbService?wsdl"), null);
+        HelloEjb helloEjb = helloEjbService.getPort(HelloEjb.class);
+        out.println();
+        out.println("EJB Webservice");
+        out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
+        out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
+        out.println();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceServlet.java
----------------------------------------------------------------------
diff --git a/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceServlet.java b/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceServlet.java
index 256ef90..9eaeeab 100644
--- a/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceServlet.java
+++ b/examples/ejb-examples/src/main/java/org/superbiz/servlet/WebserviceServlet.java
@@ -1,70 +1,69 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.servlet;
-
-import javax.jws.HandlerChain;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.WebServiceRef;
-import java.io.IOException;
-
-public class WebserviceServlet extends HttpServlet {
-
-    @WebServiceRef
-    @HandlerChain(file = "client-handlers.xml")
-    private HelloPojo helloPojo;
-
-    @WebServiceRef
-    @HandlerChain(file = "client-handlers.xml")
-    private HelloEjb helloEjb;
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        response.setContentType("text/plain");
-        ServletOutputStream out = response.getOutputStream();
-
-        OUT = out;
-        try {
-            out.println("Pojo Webservice");
-            out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
-            out.println();
-            out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
-            out.println();
-            out.println("EJB Webservice");
-            out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
-            out.println();
-            out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
-            out.println();
-        } finally {
-            OUT = out;
-        }
-    }
-
-    private static ServletOutputStream OUT;
-
-    public static void write(String message) {
-        try {
-            ServletOutputStream out = OUT;
-            out.println(message);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.servlet;
+
+import javax.jws.HandlerChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import java.io.IOException;
+
+public class WebserviceServlet extends HttpServlet {
+
+    @WebServiceRef
+    @HandlerChain(file = "client-handlers.xml")
+    private HelloPojo helloPojo;
+
+    @WebServiceRef
+    @HandlerChain(file = "client-handlers.xml")
+    private HelloEjb helloEjb;
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        OUT = out;
+        try {
+            out.println("Pojo Webservice");
+            out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
+            out.println();
+            out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
+            out.println();
+            out.println("EJB Webservice");
+            out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
+            out.println();
+            out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
+            out.println();
+        } finally {
+            OUT = out;
+        }
+    }
+
+    private static ServletOutputStream OUT;
+
+    public static void write(String message) {
+        try {
+            ServletOutputStream out = OUT;
+            out.println(message);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}


[20/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/ejb-webservice/src/main/java/org/superbiz/ws/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/ejb-webservice/src/main/java/org/superbiz/ws/Calculator.java b/examples/ejb-webservice/src/main/java/org/superbiz/ws/Calculator.java
index cba1a79..ac1e584 100644
--- a/examples/ejb-webservice/src/main/java/org/superbiz/ws/Calculator.java
+++ b/examples/ejb-webservice/src/main/java/org/superbiz/ws/Calculator.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.ws;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-@Stateless
-@WebService(portName = "CalculatorPort",
-            serviceName = "CalculatorWebService",
-            targetNamespace = "http://superbiz.org/wsdl")
-public class Calculator {
-
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.ws;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(portName = "CalculatorPort",
+        serviceName = "CalculatorWebService",
+        targetNamespace = "http://superbiz.org/wsdl")
+public class Calculator {
+
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloBean.java
----------------------------------------------------------------------
diff --git a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloBean.java b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloBean.java
index 446d742..1688f2a 100644
--- a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloBean.java
+++ b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloBean.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.hello;
-
-import javax.ejb.LocalHome;
-import javax.ejb.Stateless;
-
-/**
- * @version $Revision$ $Date$
- */
-@Stateless
-@LocalHome(HelloEjbLocalHome.class)
-public class HelloBean {
-
-    public String sayHello() {
-        return "Hello, World!";
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.hello;
+
+import javax.ejb.LocalHome;
+import javax.ejb.Stateless;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Stateless
+@LocalHome(HelloEjbLocalHome.class)
+public class HelloBean {
+
+    public String sayHello() {
+        return "Hello, World!";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocal.java
----------------------------------------------------------------------
diff --git a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocal.java b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocal.java
index a544c54..c8d3443 100644
--- a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocal.java
+++ b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocal.java
@@ -1,28 +1,28 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.hello;
-
-import javax.ejb.EJBLocalObject;
-
-/**
- * @version $Revision$ $Date$
- */
-public interface HelloEjbLocal extends EJBLocalObject {
-
-    String sayHello();
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.hello;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HelloEjbLocal extends EJBLocalObject {
+
+    String sayHello();
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocalHome.java
----------------------------------------------------------------------
diff --git a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocalHome.java b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocalHome.java
index e04f836..a9b6db1 100644
--- a/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocalHome.java
+++ b/examples/helloworld-weblogic/src/main/java/org/superbiz/hello/HelloEjbLocalHome.java
@@ -1,28 +1,28 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.hello;
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBLocalHome;
-
-/**
- * @version $Revision$ $Date$
- */
-public interface HelloEjbLocalHome extends EJBLocalHome {
-
-    HelloEjbLocal create() throws CreateException;
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.hello;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HelloEjbLocalHome extends EJBLocalHome {
+
+    HelloEjbLocal create() throws CreateException;
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/helloworld-weblogic/src/test/java/org/superbiz/hello/HelloTest.java
----------------------------------------------------------------------
diff --git a/examples/helloworld-weblogic/src/test/java/org/superbiz/hello/HelloTest.java b/examples/helloworld-weblogic/src/test/java/org/superbiz/hello/HelloTest.java
index b540c38..7be57dc 100644
--- a/examples/helloworld-weblogic/src/test/java/org/superbiz/hello/HelloTest.java
+++ b/examples/helloworld-weblogic/src/test/java/org/superbiz/hello/HelloTest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.hello;
-
-import junit.framework.TestCase;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * @version $Revision$ $Date$
- */
-public class HelloTest extends TestCase {
-
-    public void test() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        InitialContext initialContext = new InitialContext(properties);
-
-        HelloEjbLocalHome localHome = (HelloEjbLocalHome) initialContext.lookup("MyHello");
-        HelloEjbLocal helloEjb = localHome.create();
-
-        String message = helloEjb.sayHello();
-
-        assertEquals(message, "Hello, World!");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.hello;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HelloTest extends TestCase {
+
+    public void test() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        InitialContext initialContext = new InitialContext(properties);
+
+        HelloEjbLocalHome localHome = (HelloEjbLocalHome) initialContext.lookup("MyHello");
+        HelloEjbLocal helloEjb = localHome.create();
+
+        String message = helloEjb.sayHello();
+
+        assertEquals(message, "Hello, World!");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-connectionfactory/src/main/java/org/superbiz/injection/jms/Messages.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-connectionfactory/src/main/java/org/superbiz/injection/jms/Messages.java b/examples/injection-of-connectionfactory/src/main/java/org/superbiz/injection/jms/Messages.java
index f126c1a..148f449 100644
--- a/examples/injection-of-connectionfactory/src/main/java/org/superbiz/injection/jms/Messages.java
+++ b/examples/injection-of-connectionfactory/src/main/java/org/superbiz/injection/jms/Messages.java
@@ -1,106 +1,106 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.injection.jms;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-@Stateless
-public class Messages {
-
-    @Resource
-    private ConnectionFactory connectionFactory;
-
-    @Resource
-    private Queue chatQueue;
-
-    public void sendMessage(String text) throws JMSException {
-
-        Connection connection = null;
-        Session session = null;
-
-        try {
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create a Session
-            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-            // Create a MessageProducer from the Session to the Topic or Queue
-            MessageProducer producer = session.createProducer(chatQueue);
-            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-            // Create a message
-            TextMessage message = session.createTextMessage(text);
-
-            // Tell the producer to send the message
-            producer.send(message);
-        } finally {
-            // Clean up
-            if (session != null) {
-                session.close();
-            }
-            if (connection != null) {
-                connection.close();
-            }
-        }
-    }
-
-    public String receiveMessage() throws JMSException {
-
-        Connection connection = null;
-        Session session = null;
-        MessageConsumer consumer = null;
-        try {
-            connection = connectionFactory.createConnection();
-            connection.start();
-
-            // Create a Session
-            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-            // Create a MessageConsumer from the Session to the Topic or Queue
-            consumer = session.createConsumer(chatQueue);
-
-            // Wait for a message
-            TextMessage message = (TextMessage) consumer.receive(1000);
-
-            return message.getText();
-        } finally {
-            if (consumer != null) {
-                consumer.close();
-            }
-            if (session != null) {
-                session.close();
-            }
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.injection.jms;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+@Stateless
+public class Messages {
+
+    @Resource
+    private ConnectionFactory connectionFactory;
+
+    @Resource
+    private Queue chatQueue;
+
+    public void sendMessage(String text) throws JMSException {
+
+        Connection connection = null;
+        Session session = null;
+
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            // Create a Session
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Create a MessageProducer from the Session to the Topic or Queue
+            MessageProducer producer = session.createProducer(chatQueue);
+            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+            // Create a message
+            TextMessage message = session.createTextMessage(text);
+
+            // Tell the producer to send the message
+            producer.send(message);
+        } finally {
+            // Clean up
+            if (session != null) {
+                session.close();
+            }
+            if (connection != null) {
+                connection.close();
+            }
+        }
+    }
+
+    public String receiveMessage() throws JMSException {
+
+        Connection connection = null;
+        Session session = null;
+        MessageConsumer consumer = null;
+        try {
+            connection = connectionFactory.createConnection();
+            connection.start();
+
+            // Create a Session
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            // Create a MessageConsumer from the Session to the Topic or Queue
+            consumer = session.createConsumer(chatQueue);
+
+            // Wait for a message
+            TextMessage message = (TextMessage) consumer.receive(1000);
+
+            return message.getText();
+        } finally {
+            if (consumer != null) {
+                consumer.close();
+            }
+            if (session != null) {
+                session.close();
+            }
+            if (connection != null) {
+                connection.close();
+            }
+        }
+
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-connectionfactory/src/test/java/org/superbiz/injection/jms/MessagingBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-connectionfactory/src/test/java/org/superbiz/injection/jms/MessagingBeanTest.java b/examples/injection-of-connectionfactory/src/test/java/org/superbiz/injection/jms/MessagingBeanTest.java
index 2726530..9767b4d 100644
--- a/examples/injection-of-connectionfactory/src/test/java/org/superbiz/injection/jms/MessagingBeanTest.java
+++ b/examples/injection-of-connectionfactory/src/test/java/org/superbiz/injection/jms/MessagingBeanTest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.injection.jms;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-public class MessagingBeanTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        Messages messages = (Messages) context.lookup("java:global/injection-of-connectionfactory/Messages");
-
-        messages.sendMessage("Hello World!");
-        messages.sendMessage("How are you?");
-        messages.sendMessage("Still spinning?");
-
-        assertEquals(messages.receiveMessage(), "Hello World!");
-        assertEquals(messages.receiveMessage(), "How are you?");
-        assertEquals(messages.receiveMessage(), "Still spinning?");
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.injection.jms;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+public class MessagingBeanTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        Messages messages = (Messages) context.lookup("java:global/injection-of-connectionfactory/Messages");
+
+        messages.sendMessage("Hello World!");
+        messages.sendMessage("How are you?");
+        messages.sendMessage("Still spinning?");
+
+        assertEquals(messages.receiveMessage(), "Hello World!");
+        assertEquals(messages.receiveMessage(), "How are you?");
+        assertEquals(messages.receiveMessage(), "Still spinning?");
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movie.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movie.java b/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movie.java
index eb377c5..b9961ef 100644
--- a/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movie.java
+++ b/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection;
-
-/**
- * @version $Revision$ $Date$
- */
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movies.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movies.java b/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movies.java
index d77fbdf..7a9136b 100644
--- a/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movies.java
+++ b/examples/injection-of-datasource/src/main/java/org/superbiz/injection/Movies.java
@@ -1,106 +1,106 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-//START SNIPPET: code
-package org.superbiz.injection;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-import javax.ejb.Stateful;
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    /**
-     * The field name "movieDatabase" matches the DataSource we
-     * configure in the TestCase via :
-     * p.put("movieDatabase", "new://Resource?type=DataSource");
-     * <p/>
-     * This would also match an equivalent delcaration in an openejb.xml:
-     * <Resource id="movieDatabase" type="DataSource"/>
-     * <p/>
-     * If you'd like the freedom to change the field name without
-     * impact on your configuration you can set the "name" attribute
-     * of the @Resource annotation to "movieDatabase" instead.
-     */
-    @Resource
-    private DataSource movieDatabase;
-
-    @PostConstruct
-    private void construct() throws Exception {
-        Connection connection = movieDatabase.getConnection();
-        try {
-            PreparedStatement stmt = connection.prepareStatement("CREATE TABLE movie ( director VARCHAR(255), title VARCHAR(255), year integer)");
-            stmt.execute();
-        } finally {
-            connection.close();
-        }
-    }
-
-    public void addMovie(Movie movie) throws Exception {
-        Connection conn = movieDatabase.getConnection();
-        try {
-            PreparedStatement sql = conn.prepareStatement("INSERT into movie (director, title, year) values (?, ?, ?)");
-            sql.setString(1, movie.getDirector());
-            sql.setString(2, movie.getTitle());
-            sql.setInt(3, movie.getYear());
-            sql.execute();
-        } finally {
-            conn.close();
-        }
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        Connection conn = movieDatabase.getConnection();
-        try {
-            PreparedStatement sql = conn.prepareStatement("DELETE from movie where director = ? AND title = ? AND year = ?");
-            sql.setString(1, movie.getDirector());
-            sql.setString(2, movie.getTitle());
-            sql.setInt(3, movie.getYear());
-            sql.execute();
-        } finally {
-            conn.close();
-        }
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        ArrayList<Movie> movies = new ArrayList<Movie>();
-        Connection conn = movieDatabase.getConnection();
-        try {
-            PreparedStatement sql = conn.prepareStatement("SELECT director, title, year from movie");
-            ResultSet set = sql.executeQuery();
-            while (set.next()) {
-                Movie movie = new Movie();
-                movie.setDirector(set.getString("director"));
-                movie.setTitle(set.getString("title"));
-                movie.setYear(set.getInt("year"));
-                movies.add(movie);
-            }
-
-        } finally {
-            conn.close();
-        }
-        return movies;
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//START SNIPPET: code
+package org.superbiz.injection;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.Stateful;
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    /**
+     * The field name "movieDatabase" matches the DataSource we
+     * configure in the TestCase via :
+     * p.put("movieDatabase", "new://Resource?type=DataSource");
+     * <p/>
+     * This would also match an equivalent delcaration in an openejb.xml:
+     * <Resource id="movieDatabase" type="DataSource"/>
+     * <p/>
+     * If you'd like the freedom to change the field name without
+     * impact on your configuration you can set the "name" attribute
+     * of the @Resource annotation to "movieDatabase" instead.
+     */
+    @Resource
+    private DataSource movieDatabase;
+
+    @PostConstruct
+    private void construct() throws Exception {
+        Connection connection = movieDatabase.getConnection();
+        try {
+            PreparedStatement stmt = connection.prepareStatement("CREATE TABLE movie ( director VARCHAR(255), title VARCHAR(255), year integer)");
+            stmt.execute();
+        } finally {
+            connection.close();
+        }
+    }
+
+    public void addMovie(Movie movie) throws Exception {
+        Connection conn = movieDatabase.getConnection();
+        try {
+            PreparedStatement sql = conn.prepareStatement("INSERT into movie (director, title, year) values (?, ?, ?)");
+            sql.setString(1, movie.getDirector());
+            sql.setString(2, movie.getTitle());
+            sql.setInt(3, movie.getYear());
+            sql.execute();
+        } finally {
+            conn.close();
+        }
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        Connection conn = movieDatabase.getConnection();
+        try {
+            PreparedStatement sql = conn.prepareStatement("DELETE from movie where director = ? AND title = ? AND year = ?");
+            sql.setString(1, movie.getDirector());
+            sql.setString(2, movie.getTitle());
+            sql.setInt(3, movie.getYear());
+            sql.execute();
+        } finally {
+            conn.close();
+        }
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        ArrayList<Movie> movies = new ArrayList<Movie>();
+        Connection conn = movieDatabase.getConnection();
+        try {
+            PreparedStatement sql = conn.prepareStatement("SELECT director, title, year from movie");
+            ResultSet set = sql.executeQuery();
+            while (set.next()) {
+                Movie movie = new Movie();
+                movie.setDirector(set.getString("director"));
+                movie.setTitle(set.getString("title"));
+                movie.setYear(set.getInt("year"));
+                movies.add(movie);
+            }
+
+        } finally {
+            conn.close();
+        }
+        return movies;
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-datasource/src/test/java/org/superbiz/injection/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-datasource/src/test/java/org/superbiz/injection/MoviesTest.java b/examples/injection-of-datasource/src/test/java/org/superbiz/injection/MoviesTest.java
index 628575b..6c41f19 100644
--- a/examples/injection-of-datasource/src/test/java/org/superbiz/injection/MoviesTest.java
+++ b/examples/injection-of-datasource/src/test/java/org/superbiz/injection/MoviesTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        Context context = EJBContainer.createEJBContainer(p).getContext();
-
-        Movies movies = (Movies) context.lookup("java:global/injection-of-datasource/Movies");
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        Context context = EJBContainer.createEJBContainer(p).getContext();
+
+        Movies movies = (Movies) context.lookup("java:global/injection-of-datasource/Movies");
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReader.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReader.java b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReader.java
index d6c566c..9b98efc 100644
--- a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReader.java
+++ b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReader.java
@@ -1,60 +1,60 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-
-/**
- * This is an EJB 3.1 style pojo stateless session bean
- * Every stateless session bean implementation must be annotated
- * using the annotation @Stateless
- * This EJB has 2 business interfaces: DataReaderRemote, a remote business
- * interface, and DataReaderLocal, a local business interface
- * <p/>
- * The instance variables 'dataStoreRemote' is annotated with the @EJB annotation:
- * this means that the application server, at runtime, will inject in this instance
- * variable a reference to the EJB DataStoreRemote
- * <p/>
- * The instance variables 'dataStoreLocal' is annotated with the @EJB annotation:
- * this means that the application server, at runtime, will inject in this instance
- * variable a reference to the EJB DataStoreLocal
- */
-//START SNIPPET: code
-@Stateless
-public class DataReader {
-
-    @EJB
-    private DataStoreRemote dataStoreRemote;
-    @EJB
-    private DataStoreLocal dataStoreLocal;
-    @EJB
-    private DataStore dataStore;
-
-    public String readDataFromLocalStore() {
-        return "LOCAL:" + dataStoreLocal.getData();
-    }
-
-    public String readDataFromLocalBeanStore() {
-        return "LOCALBEAN:" + dataStore.getData();
-    }
-
-    public String readDataFromRemoteStore() {
-        return "REMOTE:" + dataStoreRemote.getData();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+
+/**
+ * This is an EJB 3.1 style pojo stateless session bean
+ * Every stateless session bean implementation must be annotated
+ * using the annotation @Stateless
+ * This EJB has 2 business interfaces: DataReaderRemote, a remote business
+ * interface, and DataReaderLocal, a local business interface
+ * <p/>
+ * The instance variables 'dataStoreRemote' is annotated with the @EJB annotation:
+ * this means that the application server, at runtime, will inject in this instance
+ * variable a reference to the EJB DataStoreRemote
+ * <p/>
+ * The instance variables 'dataStoreLocal' is annotated with the @EJB annotation:
+ * this means that the application server, at runtime, will inject in this instance
+ * variable a reference to the EJB DataStoreLocal
+ */
+//START SNIPPET: code
+@Stateless
+public class DataReader {
+
+    @EJB
+    private DataStoreRemote dataStoreRemote;
+    @EJB
+    private DataStoreLocal dataStoreLocal;
+    @EJB
+    private DataStore dataStore;
+
+    public String readDataFromLocalStore() {
+        return "LOCAL:" + dataStoreLocal.getData();
+    }
+
+    public String readDataFromLocalBeanStore() {
+        return "LOCALBEAN:" + dataStore.getData();
+    }
+
+    public String readDataFromRemoteStore() {
+        return "REMOTE:" + dataStoreRemote.getData();
+    }
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStore.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStore.java b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStore.java
index fcf9eb7..0bd8b07 100644
--- a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStore.java
+++ b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStore.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection;
-
-import javax.ejb.LocalBean;
-import javax.ejb.Stateless;
-
-/**
- * This is an EJB 3 style pojo stateless session bean
- * Every stateless session bean implementation must be annotated
- * using the annotation @Stateless
- * This EJB has 2 business interfaces: DataStoreRemote, a remote business
- * interface, and DataStoreLocal, a local business interface
- */
-//START SNIPPET: code
-@Stateless
-@LocalBean
-public class DataStore implements DataStoreLocal, DataStoreRemote {
-
-    public String getData() {
-        return "42";
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import javax.ejb.LocalBean;
+import javax.ejb.Stateless;
+
+/**
+ * This is an EJB 3 style pojo stateless session bean
+ * Every stateless session bean implementation must be annotated
+ * using the annotation @Stateless
+ * This EJB has 2 business interfaces: DataStoreRemote, a remote business
+ * interface, and DataStoreLocal, a local business interface
+ */
+//START SNIPPET: code
+@Stateless
+@LocalBean
+public class DataStore implements DataStoreLocal, DataStoreRemote {
+
+    public String getData() {
+        return "42";
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreLocal.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreLocal.java b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreLocal.java
index 1046480..477ee6e 100644
--- a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreLocal.java
+++ b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreLocal.java
@@ -1,34 +1,34 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection;
-
-import javax.ejb.Local;
-
-/**
- * This is an EJB 3 local business interface
- * A local business interface may be annotated with the @Local
- * annotation, but it's optional. A business interface which is
- * not annotated with @Local or @Remote is assumed to be Local
- */
-//START SNIPPET: code
-@Local
-public interface DataStoreLocal {
-
-    public String getData();
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import javax.ejb.Local;
+
+/**
+ * This is an EJB 3 local business interface
+ * A local business interface may be annotated with the @Local
+ * annotation, but it's optional. A business interface which is
+ * not annotated with @Local or @Remote is assumed to be Local
+ */
+//START SNIPPET: code
+@Local
+public interface DataStoreLocal {
+
+    public String getData();
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java
index 3421448..7d30a2d 100644
--- a/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java
+++ b/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection;
-
-import javax.ejb.Remote;
-
-/**
- * This is an EJB 3 remote business interface
- * A remote business interface must be annotated with the @Remote
- * annotation
- */
-//START SNIPPET: code
-@Remote
-public interface DataStoreRemote {
-
-    public String getData();
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import javax.ejb.Remote;
+
+/**
+ * This is an EJB 3 remote business interface
+ * A remote business interface must be annotated with the @Remote
+ * annotation
+ */
+//START SNIPPET: code
+@Remote
+public interface DataStoreRemote {
+
+    public String getData();
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-ejbs/src/test/java/org/superbiz/injection/EjbDependencyTest.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-ejbs/src/test/java/org/superbiz/injection/EjbDependencyTest.java b/examples/injection-of-ejbs/src/test/java/org/superbiz/injection/EjbDependencyTest.java
index 95bee23..7c199f2 100644
--- a/examples/injection-of-ejbs/src/test/java/org/superbiz/injection/EjbDependencyTest.java
+++ b/examples/injection-of-ejbs/src/test/java/org/superbiz/injection/EjbDependencyTest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-/**
- * A test case for DataReaderImpl ejb, testing both the remote and local interface
- */
-//START SNIPPET: code
-public class EjbDependencyTest extends TestCase {
-
-    public void test() throws Exception {
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        DataReader dataReader = (DataReader) context.lookup("java:global/injection-of-ejbs/DataReader");
-
-        assertNotNull(dataReader);
-
-        assertEquals("LOCAL:42", dataReader.readDataFromLocalStore());
-        assertEquals("REMOTE:42", dataReader.readDataFromRemoteStore());
-        assertEquals("LOCALBEAN:42", dataReader.readDataFromLocalBeanStore());
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+/**
+ * A test case for DataReaderImpl ejb, testing both the remote and local interface
+ */
+//START SNIPPET: code
+public class EjbDependencyTest extends TestCase {
+
+    public void test() throws Exception {
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        DataReader dataReader = (DataReader) context.lookup("java:global/injection-of-ejbs/DataReader");
+
+        assertNotNull(dataReader);
+
+        assertEquals("LOCAL:42", dataReader.readDataFromLocalStore());
+        assertEquals("REMOTE:42", dataReader.readDataFromRemoteStore());
+        assertEquals("LOCALBEAN:42", dataReader.readDataFromLocalBeanStore());
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java b/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
index e1128ae..2d40541 100644
--- a/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
+++ b/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
@@ -1,76 +1,76 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.jpa;
-//START SNIPPET: code
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-@Entity
-public class Movie {
-
-    @Id
-    @GeneratedValue
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.jpa;
+//START SNIPPET: code
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Movie {
+
+    @Id
+    @GeneratedValue
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movies.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movies.java b/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movies.java
index f56c718..be34072 100644
--- a/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movies.java
+++ b/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movies.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.jpa;
-
-//START SNIPPET: code
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.jpa;
+
+//START SNIPPET: code
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-entitymanager/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-entitymanager/src/test/java/org/superbiz/injection/jpa/MoviesTest.java b/examples/injection-of-entitymanager/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
index 8fd2684..bdb36b7 100644
--- a/examples/injection-of-entitymanager/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
+++ b/examples/injection-of-entitymanager/src/test/java/org/superbiz/injection/jpa/MoviesTest.java
@@ -1,57 +1,57 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.jpa;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MoviesTest extends TestCase {
-
-    public void test() throws Exception {
-
-        final Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        EJBContainer container = EJBContainer.createEJBContainer(p);
-        final Context context = container.getContext();
-
-        Movies movies = (Movies) context.lookup("java:global/injection-of-entitymanager/Movies");
-
-        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-        List<Movie> list = movies.getMovies();
-        assertEquals("List.size()", 3, list.size());
-
-        for (Movie movie : list) {
-            movies.deleteMovie(movie);
-        }
-
-        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-
-        container.close();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.jpa;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MoviesTest extends TestCase {
+
+    public void test() throws Exception {
+
+        final Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        EJBContainer container = EJBContainer.createEJBContainer(p);
+        final Context context = container.getContext();
+
+        Movies movies = (Movies) context.lookup("java:global/injection-of-entitymanager/Movies");
+
+        movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+        movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+        movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+        List<Movie> list = movies.getMovies();
+        assertEquals("List.size()", 3, list.size());
+
+        for (Movie movie : list) {
+            movies.deleteMovie(movie);
+        }
+
+        assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+        container.close();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Configuration.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Configuration.java b/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Configuration.java
index c994dae..49fcf1d 100644
--- a/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Configuration.java
+++ b/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Configuration.java
@@ -1,63 +1,63 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection.enventry;
-
-import javax.annotation.Resource;
-import javax.ejb.Singleton;
-import java.util.Date;
-
-/**
- * This example demostrates the use of the injection of environment entries
- * using <b>Resource</b> annotation.
- * <p/>
- * "EJB Core Contracts and Requirements" specification section 16.4.1.1.
- *
- * @version $Rev$ $Date$
- */
-//START SNIPPET: code
-@Singleton
-public class Configuration {
-
-    @Resource
-    private String color;
-
-    @Resource
-    private Shape shape;
-
-    @Resource
-    private Class strategy;
-
-    @Resource(name = "date")
-    private long date;
-
-    public String getColor() {
-        return color;
-    }
-
-    public Shape getShape() {
-        return shape;
-    }
-
-    public Class getStrategy() {
-        return strategy;
-    }
-
-    public Date getDate() {
-        return new Date(date);
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.enventry;
+
+import javax.annotation.Resource;
+import javax.ejb.Singleton;
+import java.util.Date;
+
+/**
+ * This example demostrates the use of the injection of environment entries
+ * using <b>Resource</b> annotation.
+ * <p/>
+ * "EJB Core Contracts and Requirements" specification section 16.4.1.1.
+ *
+ * @version $Rev$ $Date$
+ */
+//START SNIPPET: code
+@Singleton
+public class Configuration {
+
+    @Resource
+    private String color;
+
+    @Resource
+    private Shape shape;
+
+    @Resource
+    private Class strategy;
+
+    @Resource(name = "date")
+    private long date;
+
+    public String getColor() {
+        return color;
+    }
+
+    public Shape getShape() {
+        return shape;
+    }
+
+    public Class getStrategy() {
+        return strategy;
+    }
+
+    public Date getDate() {
+        return new Date(date);
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Widget.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Widget.java b/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Widget.java
index eacf373..d65a82c 100644
--- a/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Widget.java
+++ b/examples/injection-of-env-entry/src/main/java/org/superbiz/injection/enventry/Widget.java
@@ -1,27 +1,27 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.enventry;
-
-/**
- * Exists to show that any class object can be injected and does
- * not need to be loaded directly in app code.
- *
- * @version $Revision$ $Date$
- */
-public class Widget {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.enventry;
+
+/**
+ * Exists to show that any class object can be injected and does
+ * not need to be loaded directly in app code.
+ *
+ * @version $Revision$ $Date$
+ */
+public class Widget {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/injection-of-env-entry/src/test/java/org/superbiz/injection/enventry/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/examples/injection-of-env-entry/src/test/java/org/superbiz/injection/enventry/ConfigurationTest.java b/examples/injection-of-env-entry/src/test/java/org/superbiz/injection/enventry/ConfigurationTest.java
index 490800a..eb1d2f4 100644
--- a/examples/injection-of-env-entry/src/test/java/org/superbiz/injection/enventry/ConfigurationTest.java
+++ b/examples/injection-of-env-entry/src/test/java/org/superbiz/injection/enventry/ConfigurationTest.java
@@ -1,45 +1,45 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.injection.enventry;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.Date;
-
-//START SNIPPET: code
-public class ConfigurationTest extends TestCase {
-
-    public void test() throws Exception {
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        final Configuration configuration = (Configuration) context.lookup("java:global/injection-of-env-entry/Configuration");
-
-        assertEquals("orange", configuration.getColor());
-
-        assertEquals(Shape.TRIANGLE, configuration.getShape());
-
-        assertEquals(Widget.class, configuration.getStrategy());
-
-        assertEquals(new Date(123456789), configuration.getDate());
-    }
-}
-//END SNIPPET: code
- 
-
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.enventry;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.Date;
+
+//START SNIPPET: code
+public class ConfigurationTest extends TestCase {
+
+    public void test() throws Exception {
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        final Configuration configuration = (Configuration) context.lookup("java:global/injection-of-env-entry/Configuration");
+
+        assertEquals("orange", configuration.getColor());
+
+        assertEquals(Shape.TRIANGLE, configuration.getShape());
+
+        assertEquals(Widget.class, configuration.getStrategy());
+
+        assertEquals(new Date(123456789), configuration.getDate());
+    }
+}
+//END SNIPPET: code
+ 
+
+


[12/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/rest/SubjectService.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/rest/SubjectService.java b/examples/polling-parent/polling-web/src/main/java/jug/rest/SubjectService.java
index b4cf18d..1fc3483 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/rest/SubjectService.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/rest/SubjectService.java
@@ -1,112 +1,112 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.rest;
-
-import jug.dao.SubjectDao;
-import jug.dao.VoteDao;
-import jug.domain.Result;
-import jug.domain.Subject;
-import jug.domain.Value;
-import jug.domain.Vote;
-import jug.monitoring.VoteCounter;
-
-import javax.annotation.Resource;
-import javax.ejb.Lock;
-import javax.ejb.LockType;
-import javax.ejb.Singleton;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import java.util.Collection;
-import java.util.List;
-
-@Path("subject")
-@Singleton // an ejb just to be able to test in standalone
-@Lock(LockType.READ)
-@TransactionAttribute(TransactionAttributeType.SUPPORTS)
-@Produces({MediaType.APPLICATION_JSON})
-public class SubjectService {
-
-    @Inject
-    private SubjectDao dao;
-
-    @Inject
-    private VoteDao voteDao;
-
-    @Inject
-    private VoteCounter counter;
-
-    @Resource(name = "poll.blacklist")
-    private List<String> blackList;
-
-    @POST
-    @Path("create")
-    public Subject create(final String question, @QueryParam("name") final String name) {
-        if (blackList.contains(name)) {
-            throw new IllegalArgumentException("name blacklisted");
-        }
-
-        final Subject subject = dao.create(name, question);
-
-        counter.putSubject(subject);
-
-        return subject;
-    }
-
-    @GET
-    @Path("list")
-    public Collection<Subject> list() {
-        return dao.findAll();
-    }
-
-    @GET
-    @Path("find/{name}")
-    public Subject findByName(@PathParam("name") final String name) {
-        return dao.findByName(name);
-    }
-
-    @GET
-    @Path("best")
-    public Subject best() {
-        return dao.bestSubject();
-    }
-
-    @GET
-    @Path("result/{name}")
-    public Result result(@PathParam("name") final String name) {
-        return new Result(dao.subjectLikeVoteNumber(name), -dao.subjectNotLikeVoteNumber(name));
-    }
-
-    @POST
-    @Path("vote")
-    public Vote vote(final String input, @QueryParam("subject") final String subjectName) {
-        final Vote vote = voteDao.create(Value.valueOf(input));
-        final Subject subject = dao.findByName(subjectName);
-        dao.addVote(subject, vote);
-
-        counter.putSubject(subject); // update
-
-        return vote;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.rest;
+
+import jug.dao.SubjectDao;
+import jug.dao.VoteDao;
+import jug.domain.Result;
+import jug.domain.Subject;
+import jug.domain.Value;
+import jug.domain.Vote;
+import jug.monitoring.VoteCounter;
+
+import javax.annotation.Resource;
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import java.util.Collection;
+import java.util.List;
+
+@Path("subject")
+@Singleton // an ejb just to be able to test in standalone
+@Lock(LockType.READ)
+@TransactionAttribute(TransactionAttributeType.SUPPORTS)
+@Produces({MediaType.APPLICATION_JSON})
+public class SubjectService {
+
+    @Inject
+    private SubjectDao dao;
+
+    @Inject
+    private VoteDao voteDao;
+
+    @Inject
+    private VoteCounter counter;
+
+    @Resource(name = "poll.blacklist")
+    private List<String> blackList;
+
+    @POST
+    @Path("create")
+    public Subject create(final String question, @QueryParam("name") final String name) {
+        if (blackList.contains(name)) {
+            throw new IllegalArgumentException("name blacklisted");
+        }
+
+        final Subject subject = dao.create(name, question);
+
+        counter.putSubject(subject);
+
+        return subject;
+    }
+
+    @GET
+    @Path("list")
+    public Collection<Subject> list() {
+        return dao.findAll();
+    }
+
+    @GET
+    @Path("find/{name}")
+    public Subject findByName(@PathParam("name") final String name) {
+        return dao.findByName(name);
+    }
+
+    @GET
+    @Path("best")
+    public Subject best() {
+        return dao.bestSubject();
+    }
+
+    @GET
+    @Path("result/{name}")
+    public Result result(@PathParam("name") final String name) {
+        return new Result(dao.subjectLikeVoteNumber(name), -dao.subjectNotLikeVoteNumber(name));
+    }
+
+    @POST
+    @Path("vote")
+    public Vote vote(final String input, @QueryParam("subject") final String subjectName) {
+        final Vote vote = voteDao.create(Value.valueOf(input));
+        final Subject subject = dao.findByName(subjectName);
+        dao.addVote(subject, vote);
+
+        counter.putSubject(subject); // update
+
+        return vote;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/routing/DataSourceInitializer.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/routing/DataSourceInitializer.java b/examples/polling-parent/polling-web/src/main/java/jug/routing/DataSourceInitializer.java
index f734b02..5acbb8e 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/routing/DataSourceInitializer.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/routing/DataSourceInitializer.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.routing;
-
-import jug.domain.Subject;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-// hack for OpenJPA
-// it initializes lazily datasource (buildSchema) so simply call it here
-// for hibernate it works without this hack
-@ApplicationScoped
-public class DataSourceInitializer {
-
-    @PersistenceContext(unitName = "client1")
-    private EntityManager client1;
-
-    @PersistenceContext(unitName = "client2")
-    private EntityManager client2;
-
-    private boolean invoked = false;
-
-    public void init() {
-        if (invoked) {
-            return;
-        }
-
-        client1.find(Subject.class, 0);
-        client2.find(Subject.class, 0);
-        invoked = true;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.routing;
+
+import jug.domain.Subject;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+// hack for OpenJPA
+// it initializes lazily datasource (buildSchema) so simply call it here
+// for hibernate it works without this hack
+@ApplicationScoped
+public class DataSourceInitializer {
+
+    @PersistenceContext(unitName = "client1")
+    private EntityManager client1;
+
+    @PersistenceContext(unitName = "client2")
+    private EntityManager client2;
+
+    private boolean invoked = false;
+
+    public void init() {
+        if (invoked) {
+            return;
+        }
+
+        client1.find(Subject.class, 0);
+        client2.find(Subject.class, 0);
+        invoked = true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/routing/PollingRouter.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/routing/PollingRouter.java b/examples/polling-parent/polling-web/src/main/java/jug/routing/PollingRouter.java
index 4589034..087f55b 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/routing/PollingRouter.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/routing/PollingRouter.java
@@ -1,79 +1,79 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.routing;
-
-import org.apache.openejb.resource.jdbc.router.AbstractRouter;
-
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-public class PollingRouter extends AbstractRouter {
-
-    private Map<String, DataSource> dataSources = null;
-    private ThreadLocal<DataSource> currentDataSource = new ThreadLocal<DataSource>() {
-        @Override
-        public DataSource initialValue() {
-            return dataSources.get("jdbc/client1");
-        }
-    };
-
-    @Override
-    public DataSource getDataSource() {
-        if (dataSources == null) {
-            init();
-        }
-        return currentDataSource.get();
-    }
-
-    public void setDataSource(final String client) {
-        if (dataSources == null) {
-            init();
-        }
-
-        final String datasourceName = "jdbc/" + client;
-        if (!dataSources.containsKey(datasourceName)) {
-            throw new IllegalArgumentException("data source called " + datasourceName + " can't be found.");
-        }
-        final DataSource ds = dataSources.get(datasourceName);
-        currentDataSource.set(ds);
-    }
-
-    private synchronized void init() {
-        if (dataSources != null) {
-            return;
-        }
-
-        dataSources = new HashMap<String, DataSource>();
-        for (String ds : Arrays.asList("jdbc/client1", "jdbc/client2")) {
-            try {
-                final Object o = getOpenEJBResource(ds);
-                if (o instanceof DataSource) {
-                    dataSources.put(ds, DataSource.class.cast(o));
-                }
-            } catch (NamingException e) {
-                // ignored
-            }
-        }
-    }
-
-    public void clear() {
-        currentDataSource.remove();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.routing;
+
+import org.apache.openejb.resource.jdbc.router.AbstractRouter;
+
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public class PollingRouter extends AbstractRouter {
+
+    private Map<String, DataSource> dataSources = null;
+    private ThreadLocal<DataSource> currentDataSource = new ThreadLocal<DataSource>() {
+        @Override
+        public DataSource initialValue() {
+            return dataSources.get("jdbc/client1");
+        }
+    };
+
+    @Override
+    public DataSource getDataSource() {
+        if (dataSources == null) {
+            init();
+        }
+        return currentDataSource.get();
+    }
+
+    public void setDataSource(final String client) {
+        if (dataSources == null) {
+            init();
+        }
+
+        final String datasourceName = "jdbc/" + client;
+        if (!dataSources.containsKey(datasourceName)) {
+            throw new IllegalArgumentException("data source called " + datasourceName + " can't be found.");
+        }
+        final DataSource ds = dataSources.get(datasourceName);
+        currentDataSource.set(ds);
+    }
+
+    private synchronized void init() {
+        if (dataSources != null) {
+            return;
+        }
+
+        dataSources = new HashMap<String, DataSource>();
+        for (String ds : Arrays.asList("jdbc/client1", "jdbc/client2")) {
+            try {
+                final Object o = getOpenEJBResource(ds);
+                if (o instanceof DataSource) {
+                    dataSources.put(ds, DataSource.class.cast(o));
+                }
+            } catch (NamingException e) {
+                // ignored
+            }
+        }
+    }
+
+    public void clear() {
+        currentDataSource.remove();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/main/java/jug/routing/RoutingFilter.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/main/java/jug/routing/RoutingFilter.java b/examples/polling-parent/polling-web/src/main/java/jug/routing/RoutingFilter.java
index a503f38..4818578 100644
--- a/examples/polling-parent/polling-web/src/main/java/jug/routing/RoutingFilter.java
+++ b/examples/polling-parent/polling-web/src/main/java/jug/routing/RoutingFilter.java
@@ -1,72 +1,72 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.routing;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.annotation.WebFilter;
-import java.io.IOException;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.logging.Logger;
-
-@WebFilter(displayName = "routing-filter", urlPatterns = {"/*"})
-public class RoutingFilter implements Filter {
-
-    private static final Logger LOGGER = Logger.getLogger(RoutingFilter.class.getName());
-    private static final AtomicInteger COUNTER = new AtomicInteger();
-
-    @Resource(name = "ClientRouter", type = PollingRouter.class)
-    private PollingRouter router;
-
-    @Inject
-    private DataSourceInitializer init;
-
-    @Override
-    public void init(final FilterConfig filterConfig) throws ServletException {
-        init.init();
-    }
-
-    @Override
-    public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException {
-        String client = servletRequest.getParameter("client");
-        if (client == null) {
-            client = getRandomClient();
-        }
-        LOGGER.info("using client " + client);
-        router.setDataSource(client);
-        try {
-            filterChain.doFilter(servletRequest, servletResponse);
-        } finally {
-            router.clear();
-        }
-    }
-
-    private String getRandomClient() {
-        return "client" + (1 + COUNTER.getAndIncrement() % 2); // 2 clients
-    }
-
-    @Override
-    public void destroy() {
-        // no-op
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.routing;
+
+import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Logger;
+
+@WebFilter(displayName = "routing-filter", urlPatterns = {"/*"})
+public class RoutingFilter implements Filter {
+
+    private static final Logger LOGGER = Logger.getLogger(RoutingFilter.class.getName());
+    private static final AtomicInteger COUNTER = new AtomicInteger();
+
+    @Resource(name = "ClientRouter", type = PollingRouter.class)
+    private PollingRouter router;
+
+    @Inject
+    private DataSourceInitializer init;
+
+    @Override
+    public void init(final FilterConfig filterConfig) throws ServletException {
+        init.init();
+    }
+
+    @Override
+    public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException {
+        String client = servletRequest.getParameter("client");
+        if (client == null) {
+            client = getRandomClient();
+        }
+        LOGGER.info("using client " + client);
+        router.setDataSource(client);
+        try {
+            filterChain.doFilter(servletRequest, servletResponse);
+        } finally {
+            router.clear();
+        }
+    }
+
+    private String getRandomClient() {
+        return "client" + (1 + COUNTER.getAndIncrement() % 2); // 2 clients
+    }
+
+    @Override
+    public void destroy() {
+        // no-op
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/test/java/jug/rest/SubjectServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/test/java/jug/rest/SubjectServiceTest.java b/examples/polling-parent/polling-web/src/test/java/jug/rest/SubjectServiceTest.java
index aa09db9..45e5af9 100644
--- a/examples/polling-parent/polling-web/src/test/java/jug/rest/SubjectServiceTest.java
+++ b/examples/polling-parent/polling-web/src/test/java/jug/rest/SubjectServiceTest.java
@@ -1,80 +1,80 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.rest;
-
-import jug.routing.DataSourceInitializer;
-import jug.routing.PollingRouter;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.openejb.OpenEjbContainer;
-import org.apache.openejb.loader.IO;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.annotation.Resource;
-import javax.ejb.embeddable.EJBContainer;
-import javax.inject.Inject;
-import javax.naming.NamingException;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import static org.junit.Assert.assertTrue;
-
-public class SubjectServiceTest {
-
-    private static EJBContainer container;
-
-    @Inject
-    private DataSourceInitializer init;
-
-    @Resource(name = "ClientRouter", type = PollingRouter.class)
-    private PollingRouter router;
-
-    @BeforeClass
-    public static void start() {
-        final Properties properties = new Properties();
-        properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");
-        properties.setProperty(EJBContainer.APP_NAME, "polling/api");
-        properties.setProperty(EJBContainer.PROVIDER, "openejb");
-        container = EJBContainer.createEJBContainer(properties);
-    }
-
-    @Before
-    public void inject() throws NamingException {
-        container.getContext().bind("inject", this);
-        init.init();
-    }
-
-    @AfterClass
-    public static void stop() {
-        container.close();
-    }
-
-    @Test
-    public void createVote() throws IOException {
-        final Response response = WebClient.create("http://localhost:4204/polling/")
-                                           .path("api/subject/create")
-                                           .accept("application/json")
-                                           .query("name", "TOMEE_JUG_JSON")
-                                           .post("was it cool?");
-        final String output = IO.slurp((InputStream) response.getEntity());
-        assertTrue("output doesn't contain TOMEE_JUG_JSON '" + output + "'", output.contains("TOMEE_JUG_JSON"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.rest;
+
+import jug.routing.DataSourceInitializer;
+import jug.routing.PollingRouter;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.openejb.OpenEjbContainer;
+import org.apache.openejb.loader.IO;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.annotation.Resource;
+import javax.ejb.embeddable.EJBContainer;
+import javax.inject.Inject;
+import javax.naming.NamingException;
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+public class SubjectServiceTest {
+
+    private static EJBContainer container;
+
+    @Inject
+    private DataSourceInitializer init;
+
+    @Resource(name = "ClientRouter", type = PollingRouter.class)
+    private PollingRouter router;
+
+    @BeforeClass
+    public static void start() {
+        final Properties properties = new Properties();
+        properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");
+        properties.setProperty(EJBContainer.APP_NAME, "polling/api");
+        properties.setProperty(EJBContainer.PROVIDER, "openejb");
+        container = EJBContainer.createEJBContainer(properties);
+    }
+
+    @Before
+    public void inject() throws NamingException {
+        container.getContext().bind("inject", this);
+        init.init();
+    }
+
+    @AfterClass
+    public static void stop() {
+        container.close();
+    }
+
+    @Test
+    public void createVote() throws IOException {
+        final Response response = WebClient.create("http://localhost:4204/polling/")
+                .path("api/subject/create")
+                .accept("application/json")
+                .query("name", "TOMEE_JUG_JSON")
+                .post("was it cool?");
+        final String output = IO.slurp((InputStream) response.getEntity());
+        assertTrue("output doesn't contain TOMEE_JUG_JSON '" + output + "'", output.contains("TOMEE_JUG_JSON"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/polling-parent/polling-web/src/test/java/jug/rest/arquillian/SubjectServiceTomEETest.java
----------------------------------------------------------------------
diff --git a/examples/polling-parent/polling-web/src/test/java/jug/rest/arquillian/SubjectServiceTomEETest.java b/examples/polling-parent/polling-web/src/test/java/jug/rest/arquillian/SubjectServiceTomEETest.java
index 27ce3c2..058ce82 100644
--- a/examples/polling-parent/polling-web/src/test/java/jug/rest/arquillian/SubjectServiceTomEETest.java
+++ b/examples/polling-parent/polling-web/src/test/java/jug/rest/arquillian/SubjectServiceTomEETest.java
@@ -1,84 +1,83 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package jug.rest.arquillian;
-
-import jug.dao.SubjectDao;
-import jug.domain.Subject;
-import jug.monitoring.VoteCounter;
-import jug.rest.SubjectService;
-import jug.routing.PollingRouter;
-import org.apache.commons.io.IOUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.ziplock.JarLocation;
-import org.apache.ziplock.WebModule;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.BufferedInputStream;
-import java.net.URL;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-@RunAsClient
-@RunWith(Arquillian.class)
-public class SubjectServiceTomEETest {
-
-    @ArquillianResource
-    private URL url;
-
-    @Deployment
-    public static WebArchive archive() {
-        return new WebModule(SubjectServiceTomEETest.class).getArchive()
-                   .addClass(VoteCounter.class)
-                   .addPackage(Subject.class.getPackage()) // domain
-                   .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
-                   .addAsWebInfResource(new ClassLoaderAsset("META-INF/env-entries.properties"), "env-entries.properties")
-                   .addAsWebInfResource(new ClassLoaderAsset("META-INF/resources.xml"), "resources.xml")
-                   .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
-                   .addPackage(PollingRouter.class.getPackage()) // core
-                   .addPackage(SubjectDao.class.getPackage()) // core
-                   .addPackage(SubjectService.class.getPackage()) // front
-                   .addAsLibrary(JarLocation.jarLocation(IOUtils.class)) // helper for client test
-                   .addAsLibrary(JarLocation.jarLocation(Test.class)); // junit
-    }
-
-    @Test
-    public void checkThereIsSomeOutput() throws Exception {
-        final String base = url.toExternalForm();
-        WebClient.create(base)
-            .path("api/subject/create")
-            .accept("application/json")
-            .query("name", "SubjectServiceTomEETest")
-            .post("SubjectServiceTomEETest");
-        for (int i = 0; i < 2; i++) { // we have a dynamic datasource so let it round
-            final URL url = new URL(base + "api/subject/list");
-            final String output = IOUtils.toString(new BufferedInputStream(url.openStream()));
-            if (output.contains("SubjectServiceTomEETest")) {
-                return;
-            }
-        }
-        fail("created entry not found");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jug.rest.arquillian;
+
+import jug.dao.SubjectDao;
+import jug.domain.Subject;
+import jug.monitoring.VoteCounter;
+import jug.rest.SubjectService;
+import jug.routing.PollingRouter;
+import org.apache.commons.io.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.ziplock.JarLocation;
+import org.apache.ziplock.WebModule;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.BufferedInputStream;
+import java.net.URL;
+
+import static org.junit.Assert.fail;
+
+@RunAsClient
+@RunWith(Arquillian.class)
+public class SubjectServiceTomEETest {
+
+    @ArquillianResource
+    private URL url;
+
+    @Deployment
+    public static WebArchive archive() {
+        return new WebModule(SubjectServiceTomEETest.class).getArchive()
+                .addClass(VoteCounter.class)
+                .addPackage(Subject.class.getPackage()) // domain
+                .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
+                .addAsWebInfResource(new ClassLoaderAsset("META-INF/env-entries.properties"), "env-entries.properties")
+                .addAsWebInfResource(new ClassLoaderAsset("META-INF/resources.xml"), "resources.xml")
+                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+                .addPackage(PollingRouter.class.getPackage()) // core
+                .addPackage(SubjectDao.class.getPackage()) // core
+                .addPackage(SubjectService.class.getPackage()) // front
+                .addAsLibrary(JarLocation.jarLocation(IOUtils.class)) // helper for client test
+                .addAsLibrary(JarLocation.jarLocation(Test.class)); // junit
+    }
+
+    @Test
+    public void checkThereIsSomeOutput() throws Exception {
+        final String base = url.toExternalForm();
+        WebClient.create(base)
+                .path("api/subject/create")
+                .accept("application/json")
+                .query("name", "SubjectServiceTomEETest")
+                .post("SubjectServiceTomEETest");
+        for (int i = 0; i < 2; i++) { // we have a dynamic datasource so let it round
+            final URL url = new URL(base + "api/subject/list");
+            final String output = IOUtils.toString(new BufferedInputStream(url.openStream()));
+            if (output.contains("SubjectServiceTomEETest")) {
+                return;
+            }
+        }
+        fail("created entry not found");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index ec984b4..6c26f87 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -21,15 +21,19 @@
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <artifactId>tomee-project</artifactId>
     <groupId>org.apache.tomee</groupId>
     <version>7.0.0-SNAPSHOT</version>
   </parent>
-  <modelVersion>4.0.0</modelVersion>
+
   <artifactId>examples</artifactId>
   <packaging>pom</packaging>
   <name>OpenEJB :: Examples</name>
+
   <modules>
     <module>access-timeout-meta</module>
     <module>access-timeout</module>
@@ -165,7 +169,7 @@
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa-maven-plugin</artifactId>
-      <version>2.3.0</version>
+      <version>${openjpa.version}</version>
     </dependency>
   </dependencies>
 
@@ -177,7 +181,6 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-assembly-plugin</artifactId>
-            <version>2.3</version>
             <inherited>false</inherited>
             <configuration>
               <descriptors>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/pom.xml
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/pom.xml b/examples/projectstage-demo/pom.xml
index be4155a..d240d61 100644
--- a/examples/projectstage-demo/pom.xml
+++ b/examples/projectstage-demo/pom.xml
@@ -23,7 +23,7 @@
 
   <groupId>org.superbiz</groupId>
   <artifactId>projectstage-demo</artifactId>
-  <version>1.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: DeltaSpike ProjectStage</name>
 
   <properties>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/main/java/org/superbiz/Manager.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/main/java/org/superbiz/Manager.java b/examples/projectstage-demo/src/main/java/org/superbiz/Manager.java
index 738751d..5f9c2ff 100644
--- a/examples/projectstage-demo/src/main/java/org/superbiz/Manager.java
+++ b/examples/projectstage-demo/src/main/java/org/superbiz/Manager.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-public class Manager {
-
-    private final String name;
-
-    public Manager(String name) {
-        this.name = name;
-    }
-
-    public String name() {
-        return name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+public class Manager {
+
+    private final String name;
+
+    public Manager(String name) {
+        this.name = name;
+    }
+
+    public String name() {
+        return name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/main/java/org/superbiz/ManagerFactory.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/main/java/org/superbiz/ManagerFactory.java b/examples/projectstage-demo/src/main/java/org/superbiz/ManagerFactory.java
index 2837afc..b4b2bee 100644
--- a/examples/projectstage-demo/src/main/java/org/superbiz/ManagerFactory.java
+++ b/examples/projectstage-demo/src/main/java/org/superbiz/ManagerFactory.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-
-public final class ManagerFactory {
-
-    @Inject
-    private ProjectStage projectStage;
-
-    @Produces
-    public Manager currentManager() {
-        if (ProjectStage.UnitTest.equals(projectStage)) {
-            return new Manager("test");
-        } else if (ProjectStage.Development.equals(projectStage)) {
-            return new Manager("dev");
-        }
-        return new Manager(projectStage.toString());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+public final class ManagerFactory {
+
+    @Inject
+    private ProjectStage projectStage;
+
+    @Produces
+    public Manager currentManager() {
+        if (ProjectStage.UnitTest.equals(projectStage)) {
+            return new Manager("test");
+        } else if (ProjectStage.Development.equals(projectStage)) {
+            return new Manager("dev");
+        }
+        return new Manager(projectStage.toString());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/BaseTestForProjectStage.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/BaseTestForProjectStage.java b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/BaseTestForProjectStage.java
index eb72e69..f7d0e31 100644
--- a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/BaseTestForProjectStage.java
+++ b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/BaseTestForProjectStage.java
@@ -1,57 +1,57 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.projectstage;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-import org.apache.ziplock.JarLocation;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.Manager;
-import org.superbiz.ManagerFactory;
-import org.superbiz.projectstage.util.ProjectStageProducer;
-
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertEquals;
-
-@RunWith(Arquillian.class)
-public abstract class BaseTestForProjectStage {
-
-    @Inject
-    protected Manager manager;
-
-    protected static WebArchive war(final String projectStageName) {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addClasses(ProjectStageProducer.class, BaseTestForProjectStage.class, Manager.class, ManagerFactory.class)
-                         .addAsResource(new StringAsset("org.apache.deltaspike.ProjectStage = " + projectStageName), ArchivePaths.create(ProjectStageProducer.CONFIG_PATH))
-                         .addAsServiceProvider(ConfigSourceProvider.class, ProjectStageProducer.class)
-                         .addAsLibraries(JarLocation.jarLocation(ProjectStage.class))
-                         .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
-    }
-
-    @Test
-    public void checkManagerValue() {
-        assertEquals(ProjectStageProducer.value("org.apache.deltaspike.ProjectStage"), manager.name());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.projectstage;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.Manager;
+import org.superbiz.ManagerFactory;
+import org.superbiz.projectstage.util.ProjectStageProducer;
+
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(Arquillian.class)
+public abstract class BaseTestForProjectStage {
+
+    @Inject
+    protected Manager manager;
+
+    protected static WebArchive war(final String projectStageName) {
+        return ShrinkWrap.create(WebArchive.class)
+                .addClasses(ProjectStageProducer.class, BaseTestForProjectStage.class, Manager.class, ManagerFactory.class)
+                .addAsResource(new StringAsset("org.apache.deltaspike.ProjectStage = " + projectStageName), ArchivePaths.create(ProjectStageProducer.CONFIG_PATH))
+                .addAsServiceProvider(ConfigSourceProvider.class, ProjectStageProducer.class)
+                .addAsLibraries(JarLocation.jarLocation(ProjectStage.class))
+                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
+    }
+
+    @Test
+    public void checkManagerValue() {
+        assertEquals(ProjectStageProducer.value("org.apache.deltaspike.ProjectStage"), manager.name());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/DevProjectStageTest.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/DevProjectStageTest.java b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/DevProjectStageTest.java
index aeab10a..515dffa 100644
--- a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/DevProjectStageTest.java
+++ b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/DevProjectStageTest.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.projectstage;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class DevProjectStageTest extends BaseTestForProjectStage {
-
-    @Deployment
-    public static WebArchive war() {
-        return BaseTestForProjectStage.war(ProjectStage.Development.toString());
-    }
-
-    @Test
-    @Override
-    public void checkManagerValue() {
-        assertEquals("dev", manager.name());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.projectstage;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class DevProjectStageTest extends BaseTestForProjectStage {
+
+    @Deployment
+    public static WebArchive war() {
+        return BaseTestForProjectStage.war(ProjectStage.Development.toString());
+    }
+
+    @Test
+    @Override
+    public void checkManagerValue() {
+        assertEquals("dev", manager.name());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/ProductionProjectStageTest.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/ProductionProjectStageTest.java b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/ProductionProjectStageTest.java
index baa360e..752ee6f 100644
--- a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/ProductionProjectStageTest.java
+++ b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/ProductionProjectStageTest.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.projectstage;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-
-public class ProductionProjectStageTest extends BaseTestForProjectStage {
-
-    @Deployment
-    public static WebArchive war() {
-        return BaseTestForProjectStage.war(ProjectStage.Production.toString());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.projectstage;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class ProductionProjectStageTest extends BaseTestForProjectStage {
+
+    @Deployment
+    public static WebArchive war() {
+        return BaseTestForProjectStage.war(ProjectStage.Production.toString());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/TestingProjectStageTest.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/TestingProjectStageTest.java b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/TestingProjectStageTest.java
index 186d07d..1dd98e5 100644
--- a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/TestingProjectStageTest.java
+++ b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/TestingProjectStageTest.java
@@ -1,38 +1,38 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.projectstage;
-
-import org.apache.deltaspike.core.api.projectstage.ProjectStage;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class TestingProjectStageTest extends BaseTestForProjectStage {
-
-    @Deployment
-    public static WebArchive war() {
-        return BaseTestForProjectStage.war(ProjectStage.UnitTest.toString());
-    }
-
-    @Test
-    @Override
-    public void checkManagerValue() {
-        assertEquals("test", manager.name());
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.projectstage;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestingProjectStageTest extends BaseTestForProjectStage {
+
+    @Deployment
+    public static WebArchive war() {
+        return BaseTestForProjectStage.war(ProjectStage.UnitTest.toString());
+    }
+
+    @Test
+    @Override
+    public void checkManagerValue() {
+        assertEquals("test", manager.name());
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/util/ProjectStageProducer.java
----------------------------------------------------------------------
diff --git a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/util/ProjectStageProducer.java b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/util/ProjectStageProducer.java
index e01a26d..750a7d7 100644
--- a/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/util/ProjectStageProducer.java
+++ b/examples/projectstage-demo/src/test/java/org/superbiz/projectstage/util/ProjectStageProducer.java
@@ -1,78 +1,78 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.projectstage.util;
-
-import org.apache.deltaspike.core.spi.config.ConfigSource;
-import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-public final class ProjectStageProducer implements ConfigSourceProvider {
-
-    public static final String CONFIG_PATH = "project-stage.properties";
-
-    private static final Properties PROPERTIES = new Properties();
-
-    static {
-        try {
-            PROPERTIES.load(ProjectStageProducer.class.getResourceAsStream("/project-stage.properties"));
-        } catch (IOException e) {
-            // no-op
-        }
-    }
-
-    @Override
-    public List<ConfigSource> getConfigSources() {
-        return new ArrayList<ConfigSource>() {{
-            add(new ConfigSource() {
-                @Override
-                public int getOrdinal() {
-                    return 0;
-                }
-
-                @Override
-                public String getPropertyValue(final String key) {
-                    return value(key);
-                }
-
-                @Override
-                public String getConfigName() {
-                    return "test-project-stage";
-                }
-
-                @Override
-                public Map<String, String> getProperties() {
-                    return Collections.emptyMap();
-                }
-
-                @Override
-                public boolean isScannable() {
-                    return false;
-                }
-            });
-        }};
-    }
-
-    public static String value(final String key) {
-        return PROPERTIES.getProperty(key);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.projectstage.util;
+
+import org.apache.deltaspike.core.spi.config.ConfigSource;
+import org.apache.deltaspike.core.spi.config.ConfigSourceProvider;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+public final class ProjectStageProducer implements ConfigSourceProvider {
+
+    public static final String CONFIG_PATH = "project-stage.properties";
+
+    private static final Properties PROPERTIES = new Properties();
+
+    static {
+        try {
+            PROPERTIES.load(ProjectStageProducer.class.getResourceAsStream("/project-stage.properties"));
+        } catch (IOException e) {
+            // no-op
+        }
+    }
+
+    @Override
+    public List<ConfigSource> getConfigSources() {
+        return new ArrayList<ConfigSource>() {{
+            add(new ConfigSource() {
+                @Override
+                public int getOrdinal() {
+                    return 0;
+                }
+
+                @Override
+                public String getPropertyValue(final String key) {
+                    return value(key);
+                }
+
+                @Override
+                public String getConfigName() {
+                    return "test-project-stage";
+                }
+
+                @Override
+                public Map<String, String> getProperties() {
+                    return Collections.emptyMap();
+                }
+
+                @Override
+                public boolean isScannable() {
+                    return false;
+                }
+            });
+        }};
+    }
+
+    public static String value(final String key) {
+        return PROPERTIES.getProperty(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/quartz-app/quartz-beans/pom.xml
----------------------------------------------------------------------
diff --git a/examples/quartz-app/quartz-beans/pom.xml b/examples/quartz-app/quartz-beans/pom.xml
index cd16d51..d4e59a0 100644
--- a/examples/quartz-app/quartz-beans/pom.xml
+++ b/examples/quartz-app/quartz-beans/pom.xml
@@ -31,7 +31,7 @@
     <dependency>
       <groupId>org.superbiz.quartz</groupId>
       <artifactId>quartz-ra</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
+      <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/JobBean.java
----------------------------------------------------------------------
diff --git a/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/JobBean.java b/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/JobBean.java
index b22c2b5..490098d 100644
--- a/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/JobBean.java
+++ b/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/JobBean.java
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
-    * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.quartz;
-
-import org.apache.openejb.resource.quartz.QuartzResourceAdapter;
-import org.apache.openejb.quartz.Job;
-import org.apache.openejb.quartz.JobBuilder;
-import org.apache.openejb.quartz.JobDetail;
-import org.apache.openejb.quartz.JobExecutionContext;
-import org.apache.openejb.quartz.JobExecutionException;
-import org.apache.openejb.quartz.Scheduler;
-import org.apache.openejb.quartz.SimpleScheduleBuilder;
-import org.apache.openejb.quartz.SimpleTrigger;
-import org.apache.openejb.quartz.TriggerBuilder;
-
-import javax.ejb.Stateless;
-import javax.naming.InitialContext;
-import java.util.Date;
-
-@Stateless
-public class JobBean implements JobScheduler {
-
-    @Override
-    public Date createJob() throws Exception {
-
-        final QuartzResourceAdapter ra = (QuartzResourceAdapter) new InitialContext().lookup("java:openejb/Resource/QuartzResourceAdapter");
-        final Scheduler s = ra.getScheduler();
-
-        //Add a job type
-        final JobDetail jd = JobBuilder.newJob(MyTestJob.class).withIdentity("job1", "group1").build();
-        jd.getJobDataMap().put("MyJobKey", "MyJobValue");
-
-        //Schedule my 'test' job to run now
-        final SimpleTrigger trigger = TriggerBuilder.newTrigger()
-                                                    .withIdentity("trigger1", "group1")
-                                                    .forJob(jd)
-                                                    .withSchedule(SimpleScheduleBuilder.simpleSchedule()
-                                                                                       .withRepeatCount(0)
-                                                                                       .withIntervalInSeconds(0))
-                                                    .build();
-        return s.scheduleJob(jd, trigger);
-    }
-
-    public static class MyTestJob implements Job {
-
-        @Override
-        public void execute(JobExecutionContext context) throws JobExecutionException {
-            System.out.println("This is a simple test job to get: " + context.getJobDetail().getJobDataMap().get("MyJobKey"));
-        }
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+    * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.quartz;
+
+import org.apache.openejb.quartz.Job;
+import org.apache.openejb.quartz.JobBuilder;
+import org.apache.openejb.quartz.JobDetail;
+import org.apache.openejb.quartz.JobExecutionContext;
+import org.apache.openejb.quartz.JobExecutionException;
+import org.apache.openejb.quartz.Scheduler;
+import org.apache.openejb.quartz.SimpleScheduleBuilder;
+import org.apache.openejb.quartz.SimpleTrigger;
+import org.apache.openejb.quartz.TriggerBuilder;
+import org.apache.openejb.resource.quartz.QuartzResourceAdapter;
+
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import java.util.Date;
+
+@Stateless
+public class JobBean implements JobScheduler {
+
+    @Override
+    public Date createJob() throws Exception {
+
+        final QuartzResourceAdapter ra = (QuartzResourceAdapter) new InitialContext().lookup("java:openejb/Resource/QuartzResourceAdapter");
+        final Scheduler s = ra.getScheduler();
+
+        //Add a job type
+        final JobDetail jd = JobBuilder.newJob(MyTestJob.class).withIdentity("job1", "group1").build();
+        jd.getJobDataMap().put("MyJobKey", "MyJobValue");
+
+        //Schedule my 'test' job to run now
+        final SimpleTrigger trigger = TriggerBuilder.newTrigger()
+                .withIdentity("trigger1", "group1")
+                .forJob(jd)
+                .withSchedule(SimpleScheduleBuilder.simpleSchedule()
+                        .withRepeatCount(0)
+                        .withIntervalInSeconds(0))
+                .build();
+        return s.scheduleJob(jd, trigger);
+    }
+
+    public static class MyTestJob implements Job {
+
+        @Override
+        public void execute(JobExecutionContext context) throws JobExecutionException {
+            System.out.println("This is a simple test job to get: " + context.getJobDetail().getJobDataMap().get("MyJobKey"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/QuartzMdb.java
----------------------------------------------------------------------
diff --git a/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/QuartzMdb.java b/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/QuartzMdb.java
index b8f9aa7..43dd789 100644
--- a/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/QuartzMdb.java
+++ b/examples/quartz-app/quartz-beans/src/main/java/org/superbiz/quartz/QuartzMdb.java
@@ -1,35 +1,35 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.quartz;
-
-import org.apache.openejb.quartz.Job;
-import org.apache.openejb.quartz.JobExecutionContext;
-import org.apache.openejb.quartz.JobExecutionException;
-
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-
-@MessageDriven(activationConfig = {
-  @ActivationConfigProperty(propertyName = "cronExpression", propertyValue = "* * * * * ?")
-})
-public class QuartzMdb implements Job {
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        System.out.println("Executing Job");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.quartz;
+
+import org.apache.openejb.quartz.Job;
+import org.apache.openejb.quartz.JobExecutionContext;
+import org.apache.openejb.quartz.JobExecutionException;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+
+@MessageDriven(activationConfig = {
+        @ActivationConfigProperty(propertyName = "cronExpression", propertyValue = "* * * * * ?")
+})
+public class QuartzMdb implements Job {
+
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        System.out.println("Executing Job");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java
----------------------------------------------------------------------
diff --git a/examples/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java b/examples/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java
index 1fc9a81..e68f51c 100644
--- a/examples/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java
+++ b/examples/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java
@@ -1,67 +1,67 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.quartz;
-
-import org.apache.openejb.config.OutputGeneratedDescriptors;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Date;
-import java.util.Properties;
-
-public class QuartzMdbTest {
-
-    private static InitialContext initialContext = null;
-
-    @BeforeClass
-    public static void beforeClass() throws Exception {
-        System.setProperty(OutputGeneratedDescriptors.OUTPUT_DESCRIPTORS, "false"); // just to avoid to dump files in /tmp
-        if (null == initialContext) {
-            Properties properties = new Properties();
-            properties.setProperty("openejb.deployments.classpath.include", ".*quartz-.*");
-            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-
-            initialContext = new InitialContext(properties);
-        }
-    }
-
-    @AfterClass
-    public static void afterClass() throws Exception {
-        if (null != initialContext) {
-            initialContext.close();
-            initialContext = null;
-        }
-    }
-
-    @Test
-    public void testLookup() throws Exception {
-
-        final JobScheduler jbi = (JobScheduler) initialContext.lookup("JobBeanLocal");
-        final Date d = jbi.createJob();
-        Thread.sleep(500);
-        System.out.println("Scheduled test job should have run at: " + d.toString());
-    }
-
-    @Test
-    public void testMdb() throws Exception {
-        // Sleep 3 seconds and give quartz a chance to execute our MDB
-        Thread.sleep(3000);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.quartz;
+
+import org.apache.openejb.config.OutputGeneratedDescriptors;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Date;
+import java.util.Properties;
+
+public class QuartzMdbTest {
+
+    private static InitialContext initialContext = null;
+
+    @BeforeClass
+    public static void beforeClass() throws Exception {
+        System.setProperty(OutputGeneratedDescriptors.OUTPUT_DESCRIPTORS, "false"); // just to avoid to dump files in /tmp
+        if (null == initialContext) {
+            Properties properties = new Properties();
+            properties.setProperty("openejb.deployments.classpath.include", ".*quartz-.*");
+            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+            initialContext = new InitialContext(properties);
+        }
+    }
+
+    @AfterClass
+    public static void afterClass() throws Exception {
+        if (null != initialContext) {
+            initialContext.close();
+            initialContext = null;
+        }
+    }
+
+    @Test
+    public void testLookup() throws Exception {
+
+        final JobScheduler jbi = (JobScheduler) initialContext.lookup("JobBeanLocal");
+        final Date d = jbi.createJob();
+        Thread.sleep(500);
+        System.out.println("Scheduled test job should have run at: " + d.toString());
+    }
+
+    @Test
+    public void testMdb() throws Exception {
+        // Sleep 3 seconds and give quartz a chance to execute our MDB
+        Thread.sleep(3000);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java
----------------------------------------------------------------------
diff --git a/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java b/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java
index 3a623c9..5af4e0e 100644
--- a/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java
+++ b/examples/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.reloadable.pu;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class Person {
-
-    @Id
-    private long id;
-    private String name;
-
-    public Person() {
-        // no-op
-    }
-
-    public Person(long id, String name) {
-        this.id = id;
-        this.name = name;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.reloadable.pu;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Person {
+
+    @Id
+    private long id;
+    private String name;
+
+    public Person() {
+        // no-op
+    }
+
+    public Person(long id, String name) {
+        this.id = id;
+        this.name = name;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}


[07/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/CallbackCounter.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/CallbackCounter.java b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/CallbackCounter.java
index 8c8b53d..0e4cd56 100644
--- a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/CallbackCounter.java
+++ b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/CallbackCounter.java
@@ -1,73 +1,73 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.ejb.PostActivate;
-import javax.ejb.PrePassivate;
-import javax.ejb.Stateful;
-import javax.ejb.StatefulTimeout;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-import java.io.Serializable;
-import java.util.concurrent.TimeUnit;
-
-@Stateful
-@StatefulTimeout(value = 1, unit = TimeUnit.SECONDS)
-public class CallbackCounter implements Serializable {
-
-    private int count = 0;
-
-    @PrePassivate
-    public void prePassivate() {
-        ExecutionChannel.getInstance().notifyObservers("prePassivate");
-    }
-
-    @PostActivate
-    public void postActivate() {
-        ExecutionChannel.getInstance().notifyObservers("postActivate");
-    }
-
-    @PostConstruct
-    public void postConstruct() {
-        ExecutionChannel.getInstance().notifyObservers("postConstruct");
-    }
-
-    @PreDestroy
-    public void preDestroy() {
-        ExecutionChannel.getInstance().notifyObservers("preDestroy");
-    }
-
-    @AroundInvoke
-    public Object intercept(InvocationContext ctx) throws Exception {
-        ExecutionChannel.getInstance().notifyObservers(ctx.getMethod().getName());
-        return ctx.proceed();
-    }
-
-    public int count() {
-        return count;
-    }
-
-    public int increment() {
-        return ++count;
-    }
-
-    public int reset() {
-        return (count = 0);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.PostActivate;
+import javax.ejb.PrePassivate;
+import javax.ejb.Stateful;
+import javax.ejb.StatefulTimeout;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+import java.io.Serializable;
+import java.util.concurrent.TimeUnit;
+
+@Stateful
+@StatefulTimeout(value = 1, unit = TimeUnit.SECONDS)
+public class CallbackCounter implements Serializable {
+
+    private int count = 0;
+
+    @PrePassivate
+    public void prePassivate() {
+        ExecutionChannel.getInstance().notifyObservers("prePassivate");
+    }
+
+    @PostActivate
+    public void postActivate() {
+        ExecutionChannel.getInstance().notifyObservers("postActivate");
+    }
+
+    @PostConstruct
+    public void postConstruct() {
+        ExecutionChannel.getInstance().notifyObservers("postConstruct");
+    }
+
+    @PreDestroy
+    public void preDestroy() {
+        ExecutionChannel.getInstance().notifyObservers("preDestroy");
+    }
+
+    @AroundInvoke
+    public Object intercept(InvocationContext ctx) throws Exception {
+        ExecutionChannel.getInstance().notifyObservers(ctx.getMethod().getName());
+        return ctx.proceed();
+    }
+
+    public int count() {
+        return count;
+    }
+
+    public int increment() {
+        return ++count;
+    }
+
+    public int reset() {
+        return (count = 0);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionChannel.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionChannel.java b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionChannel.java
index 601ccab..eb04530 100644
--- a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionChannel.java
+++ b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionChannel.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ExecutionChannel {
-
-    private static final ExecutionChannel INSTANCE = new ExecutionChannel();
-
-    private final List<ExecutionObserver> observers = new ArrayList<ExecutionObserver>();
-
-    public static ExecutionChannel getInstance() {
-        return INSTANCE;
-    }
-
-    public void addObserver(ExecutionObserver observer) {
-        this.observers.add(observer);
-    }
-
-    public void notifyObservers(Object value) {
-        for (ExecutionObserver observer : this.observers) {
-            observer.onExecution(value);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExecutionChannel {
+
+    private static final ExecutionChannel INSTANCE = new ExecutionChannel();
+
+    private final List<ExecutionObserver> observers = new ArrayList<ExecutionObserver>();
+
+    public static ExecutionChannel getInstance() {
+        return INSTANCE;
+    }
+
+    public void addObserver(ExecutionObserver observer) {
+        this.observers.add(observer);
+    }
+
+    public void notifyObservers(Object value) {
+        for (ExecutionObserver observer : this.observers) {
+            observer.onExecution(value);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionObserver.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionObserver.java b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionObserver.java
index e4a6614..920a74e 100644
--- a/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionObserver.java
+++ b/examples/simple-stateful-callbacks/src/main/java/org/superbiz/counter/ExecutionObserver.java
@@ -1,23 +1,23 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-public interface ExecutionObserver {
-
-    void onExecution(Object value);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+public interface ExecutionObserver {
+
+    void onExecution(Object value);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful-callbacks/src/test/java/org/superbiz/counter/CounterCallbacksTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful-callbacks/src/test/java/org/superbiz/counter/CounterCallbacksTest.java b/examples/simple-stateful-callbacks/src/test/java/org/superbiz/counter/CounterCallbacksTest.java
index 1701a52..c5d24bc 100644
--- a/examples/simple-stateful-callbacks/src/test/java/org/superbiz/counter/CounterCallbacksTest.java
+++ b/examples/simple-stateful-callbacks/src/test/java/org/superbiz/counter/CounterCallbacksTest.java
@@ -1,125 +1,125 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-public class CounterCallbacksTest implements ExecutionObserver {
-
-    private List<Object> received = new ArrayList<Object>();
-
-    public Context getContext() throws NamingException {
-        final Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        return new InitialContext(p);
-
-    }
-
-    @Test
-    public void test() throws Exception {
-        final Map<String, Object> p = new HashMap<String, Object>();
-        p.put("MySTATEFUL", "new://Container?type=STATEFUL");
-        p.put("MySTATEFUL.Capacity", "2"); //How many instances of Stateful beans can our server hold in memory?
-        p.put("MySTATEFUL.Frequency", "1"); //Interval in seconds between checks
-        p.put("MySTATEFUL.BulkPassivate", "0"); //No bulkPassivate - just passivate entities whenever it is needed
-        final EJBContainer container = EJBContainer.createEJBContainer(p);
-
-        //this is going to track the execution
-        ExecutionChannel.getInstance().addObserver(this);
-
-        {
-            final Context context = getContext();
-
-            CallbackCounter counterA = (CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter");
-            Assert.assertNotNull(counterA);
-            Assert.assertEquals("postConstruct", this.received.remove(0));
-
-            Assert.assertEquals(0, counterA.count());
-            Assert.assertEquals("count", this.received.remove(0));
-
-            Assert.assertEquals(1, counterA.increment());
-            Assert.assertEquals("increment", this.received.remove(0));
-
-            Assert.assertEquals(0, counterA.reset());
-            Assert.assertEquals("reset", this.received.remove(0));
-
-            Assert.assertEquals(1, counterA.increment());
-            Assert.assertEquals("increment", this.received.remove(0));
-
-            System.out.println("Waiting 2 seconds...");
-            Thread.sleep(2000);
-
-            Assert.assertEquals("preDestroy", this.received.remove(0));
-
-            try {
-                counterA.increment();
-                Assert.fail("The ejb is not supposed to be there.");
-            } catch (javax.ejb.NoSuchEJBException e) {
-                //excepted
-            }
-
-            context.close();
-        }
-
-        {
-            final Context context = getContext();
-
-            CallbackCounter counterA = (CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter");
-            Assert.assertEquals("postConstruct", this.received.remove(0));
-
-            Assert.assertEquals(1, counterA.increment());
-            Assert.assertEquals("increment", this.received.remove(0));
-
-            ((CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter")).count();
-            Assert.assertEquals("postConstruct", this.received.remove(0));
-            Assert.assertEquals("count", this.received.remove(0));
-
-            ((CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter")).count();
-            Assert.assertEquals("postConstruct", this.received.remove(0));
-            Assert.assertEquals("count", this.received.remove(0));
-
-            System.out.println("Waiting 2 seconds...");
-            Thread.sleep(2000);
-            Assert.assertEquals("prePassivate", this.received.remove(0));
-
-            context.close();
-        }
-        container.close();
-
-        Assert.assertEquals("preDestroy", this.received.remove(0));
-        Assert.assertEquals("preDestroy", this.received.remove(0));
-
-        Assert.assertTrue(this.received.toString(), this.received.isEmpty());
-    }
-
-    @Override
-    public void onExecution(Object value) {
-        System.out.println("Test step -> " + value);
-        this.received.add(value);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+public class CounterCallbacksTest implements ExecutionObserver {
+
+    private List<Object> received = new ArrayList<Object>();
+
+    public Context getContext() throws NamingException {
+        final Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        return new InitialContext(p);
+
+    }
+
+    @Test
+    public void test() throws Exception {
+        final Map<String, Object> p = new HashMap<String, Object>();
+        p.put("MySTATEFUL", "new://Container?type=STATEFUL");
+        p.put("MySTATEFUL.Capacity", "2"); //How many instances of Stateful beans can our server hold in memory?
+        p.put("MySTATEFUL.Frequency", "1"); //Interval in seconds between checks
+        p.put("MySTATEFUL.BulkPassivate", "0"); //No bulkPassivate - just passivate entities whenever it is needed
+        final EJBContainer container = EJBContainer.createEJBContainer(p);
+
+        //this is going to track the execution
+        ExecutionChannel.getInstance().addObserver(this);
+
+        {
+            final Context context = getContext();
+
+            CallbackCounter counterA = (CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter");
+            Assert.assertNotNull(counterA);
+            Assert.assertEquals("postConstruct", this.received.remove(0));
+
+            Assert.assertEquals(0, counterA.count());
+            Assert.assertEquals("count", this.received.remove(0));
+
+            Assert.assertEquals(1, counterA.increment());
+            Assert.assertEquals("increment", this.received.remove(0));
+
+            Assert.assertEquals(0, counterA.reset());
+            Assert.assertEquals("reset", this.received.remove(0));
+
+            Assert.assertEquals(1, counterA.increment());
+            Assert.assertEquals("increment", this.received.remove(0));
+
+            System.out.println("Waiting 2 seconds...");
+            Thread.sleep(2000);
+
+            Assert.assertEquals("preDestroy", this.received.remove(0));
+
+            try {
+                counterA.increment();
+                Assert.fail("The ejb is not supposed to be there.");
+            } catch (javax.ejb.NoSuchEJBException e) {
+                //excepted
+            }
+
+            context.close();
+        }
+
+        {
+            final Context context = getContext();
+
+            CallbackCounter counterA = (CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter");
+            Assert.assertEquals("postConstruct", this.received.remove(0));
+
+            Assert.assertEquals(1, counterA.increment());
+            Assert.assertEquals("increment", this.received.remove(0));
+
+            ((CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter")).count();
+            Assert.assertEquals("postConstruct", this.received.remove(0));
+            Assert.assertEquals("count", this.received.remove(0));
+
+            ((CallbackCounter) context.lookup("java:global/simple-stateful-callbacks/CallbackCounter")).count();
+            Assert.assertEquals("postConstruct", this.received.remove(0));
+            Assert.assertEquals("count", this.received.remove(0));
+
+            System.out.println("Waiting 2 seconds...");
+            Thread.sleep(2000);
+            Assert.assertEquals("prePassivate", this.received.remove(0));
+
+            context.close();
+        }
+        container.close();
+
+        Assert.assertEquals("preDestroy", this.received.remove(0));
+        Assert.assertEquals("preDestroy", this.received.remove(0));
+
+        Assert.assertTrue(this.received.toString(), this.received.isEmpty());
+    }
+
+    @Override
+    public void onExecution(Object value) {
+        System.out.println("Test step -> " + value);
+        this.received.add(value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful/src/main/java/org/superbiz/counter/Counter.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful/src/main/java/org/superbiz/counter/Counter.java b/examples/simple-stateful/src/main/java/org/superbiz/counter/Counter.java
index cee4fe0..9d7fc42 100644
--- a/examples/simple-stateful/src/main/java/org/superbiz/counter/Counter.java
+++ b/examples/simple-stateful/src/main/java/org/superbiz/counter/Counter.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-import javax.ejb.Stateful;
-
-/**
- * This is an EJB 3 style pojo stateful session bean
- * Every stateful session bean implementation must be annotated
- * using the annotation @Stateful
- * This EJB has 2 business interfaces: CounterRemote, a remote business
- * interface, and CounterLocal, a local business interface
- * <p/>
- * Per EJB3 rules when the @Remote or @Local annotation isn't present
- * in the bean class (this class), all interfaces are considered
- * local unless explicitly annotated otherwise.  If you look
- * in the CounterRemote interface, you'll notice it uses the @Remote
- * annotation while the CounterLocal interface is not annotated relying
- * on the EJB3 default rules to make it a local interface.
- */
-//START SNIPPET: code
-@Stateful
-public class Counter {
-
-    private int count = 0;
-
-    public int count() {
-        return count;
-    }
-
-    public int increment() {
-        return ++count;
-    }
-
-    public int reset() {
-        return (count = 0);
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+import javax.ejb.Stateful;
+
+/**
+ * This is an EJB 3 style pojo stateful session bean
+ * Every stateful session bean implementation must be annotated
+ * using the annotation @Stateful
+ * This EJB has 2 business interfaces: CounterRemote, a remote business
+ * interface, and CounterLocal, a local business interface
+ * <p/>
+ * Per EJB3 rules when the @Remote or @Local annotation isn't present
+ * in the bean class (this class), all interfaces are considered
+ * local unless explicitly annotated otherwise.  If you look
+ * in the CounterRemote interface, you'll notice it uses the @Remote
+ * annotation while the CounterLocal interface is not annotated relying
+ * on the EJB3 default rules to make it a local interface.
+ */
+//START SNIPPET: code
+@Stateful
+public class Counter {
+
+    private int count = 0;
+
+    public int count() {
+        return count;
+    }
+
+    public int increment() {
+        return ++count;
+    }
+
+    public int reset() {
+        return (count = 0);
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateful/src/test/java/org/superbiz/counter/CounterTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateful/src/test/java/org/superbiz/counter/CounterTest.java b/examples/simple-stateful/src/test/java/org/superbiz/counter/CounterTest.java
index 6511821..00706d1 100644
--- a/examples/simple-stateful/src/test/java/org/superbiz/counter/CounterTest.java
+++ b/examples/simple-stateful/src/test/java/org/superbiz/counter/CounterTest.java
@@ -1,54 +1,54 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.counter;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-
-public class CounterTest extends TestCase {
-
-    //START SNIPPET: local
-    public void test() throws Exception {
-
-        final Context context = EJBContainer.createEJBContainer().getContext();
-
-        Counter counterA = (Counter) context.lookup("java:global/simple-stateful/Counter");
-
-        assertEquals(0, counterA.count());
-        assertEquals(0, counterA.reset());
-        assertEquals(1, counterA.increment());
-        assertEquals(2, counterA.increment());
-        assertEquals(0, counterA.reset());
-
-        counterA.increment();
-        counterA.increment();
-        counterA.increment();
-        counterA.increment();
-
-        assertEquals(4, counterA.count());
-
-        // Get a new counter
-        Counter counterB = (Counter) context.lookup("java:global/simple-stateful/Counter");
-
-        // The new bean instance starts out at 0
-        assertEquals(0, counterB.count());
-    }
-    //END SNIPPET: local
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.counter;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+public class CounterTest extends TestCase {
+
+    //START SNIPPET: local
+    public void test() throws Exception {
+
+        final Context context = EJBContainer.createEJBContainer().getContext();
+
+        Counter counterA = (Counter) context.lookup("java:global/simple-stateful/Counter");
+
+        assertEquals(0, counterA.count());
+        assertEquals(0, counterA.reset());
+        assertEquals(1, counterA.increment());
+        assertEquals(2, counterA.increment());
+        assertEquals(0, counterA.reset());
+
+        counterA.increment();
+        counterA.increment();
+        counterA.increment();
+        counterA.increment();
+
+        assertEquals(4, counterA.count());
+
+        // Get a new counter
+        Counter counterB = (Counter) context.lookup("java:global/simple-stateful/Counter");
+
+        // The new bean instance starts out at 0
+        assertEquals(0, counterB.count());
+    }
+    //END SNIPPET: local
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
index cc85fdb..d425840 100644
--- a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
+++ b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
@@ -1,64 +1,64 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.ejb.Stateless;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-@Stateless
-public class CalculatorBean {
-
-    @PostConstruct
-    public void postConstruct() {
-        ExecutionChannel.getInstance().notifyObservers("postConstruct");
-    }
-
-    @PreDestroy
-    public void preDestroy() {
-        ExecutionChannel.getInstance().notifyObservers("preDestroy");
-    }
-
-    @AroundInvoke
-    public Object intercept(InvocationContext ctx) throws Exception {
-        ExecutionChannel.getInstance().notifyObservers(ctx.getMethod().getName());
-        return ctx.proceed();
-    }
-
-    public int add(int a, int b) {
-        return a + b;
-    }
-
-    public int subtract(int a, int b) {
-        return a - b;
-    }
-
-    public int multiply(int a, int b) {
-        return a * b;
-    }
-
-    public int divide(int a, int b) {
-        return a / b;
-    }
-
-    public int remainder(int a, int b) {
-        return a % b;
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.Stateless;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+@Stateless
+public class CalculatorBean {
+
+    @PostConstruct
+    public void postConstruct() {
+        ExecutionChannel.getInstance().notifyObservers("postConstruct");
+    }
+
+    @PreDestroy
+    public void preDestroy() {
+        ExecutionChannel.getInstance().notifyObservers("preDestroy");
+    }
+
+    @AroundInvoke
+    public Object intercept(InvocationContext ctx) throws Exception {
+        ExecutionChannel.getInstance().notifyObservers(ctx.getMethod().getName());
+        return ctx.proceed();
+    }
+
+    public int add(int a, int b) {
+        return a + b;
+    }
+
+    public int subtract(int a, int b) {
+        return a - b;
+    }
+
+    public int multiply(int a, int b) {
+        return a * b;
+    }
+
+    public int divide(int a, int b) {
+        return a / b;
+    }
+
+    public int remainder(int a, int b) {
+        return a % b;
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionChannel.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionChannel.java b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionChannel.java
index 5c078cf..a0520ed 100644
--- a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionChannel.java
+++ b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionChannel.java
@@ -1,41 +1,41 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ExecutionChannel {
-
-    private static final ExecutionChannel INSTANCE = new ExecutionChannel();
-
-    private final List<ExecutionObserver> observers = new ArrayList<ExecutionObserver>();
-
-    public static ExecutionChannel getInstance() {
-        return INSTANCE;
-    }
-
-    public void addObserver(ExecutionObserver observer) {
-        this.observers.add(observer);
-    }
-
-    public void notifyObservers(Object value) {
-        for (ExecutionObserver observer : this.observers) {
-            observer.onExecution(value);
-        }
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExecutionChannel {
+
+    private static final ExecutionChannel INSTANCE = new ExecutionChannel();
+
+    private final List<ExecutionObserver> observers = new ArrayList<ExecutionObserver>();
+
+    public static ExecutionChannel getInstance() {
+        return INSTANCE;
+    }
+
+    public void addObserver(ExecutionObserver observer) {
+        this.observers.add(observer);
+    }
+
+    public void notifyObservers(Object value) {
+        for (ExecutionObserver observer : this.observers) {
+            observer.onExecution(value);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionObserver.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionObserver.java b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionObserver.java
index ee2a644..5fbf890 100644
--- a/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionObserver.java
+++ b/examples/simple-stateless-callbacks/src/main/java/org/superbiz/stateless/basic/ExecutionObserver.java
@@ -1,23 +1,23 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-public interface ExecutionObserver {
-
-    void onExecution(Object value);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+public interface ExecutionObserver {
+
+    void onExecution(Object value);
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-callbacks/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-callbacks/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java b/examples/simple-stateless-callbacks/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
index a42fe8e..1f17559 100644
--- a/examples/simple-stateless-callbacks/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
+++ b/examples/simple-stateless-callbacks/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
@@ -1,89 +1,89 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-public class CalculatorTest implements ExecutionObserver {
-
-    private static final String JNDI = "java:global/simple-stateless-callbacks/CalculatorBean";
-
-    private List<Object> received = new ArrayList<Object>();
-
-    public Context getContext() throws NamingException {
-        final Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        return new InitialContext(p);
-
-    }
-
-    @Test
-    public void test() throws Exception {
-        ExecutionChannel.getInstance().addObserver(this);
-
-        final EJBContainer container = EJBContainer.createEJBContainer();
-
-        {
-            final CalculatorBean calculator = (CalculatorBean) getContext().lookup(JNDI);
-
-            Assert.assertEquals(10, calculator.add(4, 6));
-
-            //the bean is constructed only when it is used for the first time
-            Assert.assertEquals("postConstruct", this.received.remove(0));
-            Assert.assertEquals("add", this.received.remove(0));
-
-            Assert.assertEquals(-2, calculator.subtract(4, 6));
-            Assert.assertEquals("subtract", this.received.remove(0));
-
-            Assert.assertEquals(24, calculator.multiply(4, 6));
-            Assert.assertEquals("multiply", this.received.remove(0));
-
-            Assert.assertEquals(2, calculator.divide(12, 6));
-            Assert.assertEquals("divide", this.received.remove(0));
-
-            Assert.assertEquals(4, calculator.remainder(46, 6));
-            Assert.assertEquals("remainder", this.received.remove(0));
-        }
-
-        {
-            final CalculatorBean calculator = (CalculatorBean) getContext().lookup(JNDI);
-
-            Assert.assertEquals(10, calculator.add(4, 6));
-            Assert.assertEquals("add", this.received.remove(0));
-
-        }
-
-        container.close();
-        Assert.assertEquals("preDestroy", this.received.remove(0));
-        Assert.assertTrue(this.received.isEmpty());
-    }
-
-    @Override
-    public void onExecution(Object value) {
-        System.out.println("Test step -> " + value);
-        this.received.add(value);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class CalculatorTest implements ExecutionObserver {
+
+    private static final String JNDI = "java:global/simple-stateless-callbacks/CalculatorBean";
+
+    private List<Object> received = new ArrayList<Object>();
+
+    public Context getContext() throws NamingException {
+        final Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        return new InitialContext(p);
+
+    }
+
+    @Test
+    public void test() throws Exception {
+        ExecutionChannel.getInstance().addObserver(this);
+
+        final EJBContainer container = EJBContainer.createEJBContainer();
+
+        {
+            final CalculatorBean calculator = (CalculatorBean) getContext().lookup(JNDI);
+
+            Assert.assertEquals(10, calculator.add(4, 6));
+
+            //the bean is constructed only when it is used for the first time
+            Assert.assertEquals("postConstruct", this.received.remove(0));
+            Assert.assertEquals("add", this.received.remove(0));
+
+            Assert.assertEquals(-2, calculator.subtract(4, 6));
+            Assert.assertEquals("subtract", this.received.remove(0));
+
+            Assert.assertEquals(24, calculator.multiply(4, 6));
+            Assert.assertEquals("multiply", this.received.remove(0));
+
+            Assert.assertEquals(2, calculator.divide(12, 6));
+            Assert.assertEquals("divide", this.received.remove(0));
+
+            Assert.assertEquals(4, calculator.remainder(46, 6));
+            Assert.assertEquals("remainder", this.received.remove(0));
+        }
+
+        {
+            final CalculatorBean calculator = (CalculatorBean) getContext().lookup(JNDI);
+
+            Assert.assertEquals(10, calculator.add(4, 6));
+            Assert.assertEquals("add", this.received.remove(0));
+
+        }
+
+        container.close();
+        Assert.assertEquals("preDestroy", this.received.remove(0));
+        Assert.assertTrue(this.received.isEmpty());
+    }
+
+    @Override
+    public void onExecution(Object value) {
+        System.out.println("Test step -> " + value);
+        this.received.add(value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorImpl.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorImpl.java b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorImpl.java
index 347b460..12a862b 100644
--- a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorImpl.java
+++ b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorImpl.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-/**
- * This is an EJB 3 stateless session bean, configured using an EJB 3
- * deployment descriptor as opposed to using annotations.
- * This EJB has 2 business interfaces: CalculatorRemote, a remote business
- * interface, and CalculatorLocal, a local business interface
- */
-//START SNIPPET: code
-public class CalculatorImpl implements CalculatorRemote, CalculatorLocal {
-
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+/**
+ * This is an EJB 3 stateless session bean, configured using an EJB 3
+ * deployment descriptor as opposed to using annotations.
+ * This EJB has 2 business interfaces: CalculatorRemote, a remote business
+ * interface, and CalculatorLocal, a local business interface
+ */
+//START SNIPPET: code
+public class CalculatorImpl implements CalculatorRemote, CalculatorLocal {
+
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorLocal.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorLocal.java b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorLocal.java
index ed64e88..b9a58f9 100644
--- a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorLocal.java
+++ b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorLocal.java
@@ -1,30 +1,30 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-/**
- * This is an EJB 3 local business interface
- * This interface is specified using the business-local tag in the deployment descriptor
- */
-//START SNIPPET: code
-public interface CalculatorLocal {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+/**
+ * This is an EJB 3 local business interface
+ * This interface is specified using the business-local tag in the deployment descriptor
+ */
+//START SNIPPET: code
+public interface CalculatorLocal {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorRemote.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorRemote.java b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorRemote.java
index 2e61a11..4a3f6a4 100644
--- a/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorRemote.java
+++ b/examples/simple-stateless-with-descriptor/src/main/java/org/superbiz/calculator/CalculatorRemote.java
@@ -1,31 +1,31 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-/**
- * This is an EJB 3 remote business interface
- * This interface is specified using the business-local tag in the deployment descriptor
- */
-//START SNIPPET: code
-public interface CalculatorRemote {
-
-    public int sum(int add1, int add2);
-
-    public int multiply(int mul1, int mul2);
-
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+/**
+ * This is an EJB 3 remote business interface
+ * This interface is specified using the business-local tag in the deployment descriptor
+ */
+//START SNIPPET: code
+public interface CalculatorRemote {
+
+    public int sum(int add1, int add2);
+
+    public int multiply(int mul1, int mul2);
+
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java b/examples/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java
index ab24ac4..9c6bd7f 100644
--- a/examples/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java
+++ b/examples/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java
@@ -1,72 +1,72 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import junit.framework.TestCase;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-public class CalculatorTest extends TestCase {
-
-    //START SNIPPET: setup
-    private InitialContext initialContext;
-
-    protected void setUp() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-
-        initialContext = new InitialContext(properties);
-    }
-    //END SNIPPET: setup    
-
-    /**
-     * Lookup the Calculator bean via its remote home interface
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: remote
-    public void testCalculatorViaRemoteInterface() throws Exception {
-        Object object = initialContext.lookup("CalculatorImplRemote");
-
-        assertNotNull(object);
-        assertTrue(object instanceof CalculatorRemote);
-        CalculatorRemote calc = (CalculatorRemote) object;
-        assertEquals(10, calc.sum(4, 6));
-        assertEquals(12, calc.multiply(3, 4));
-    }
-    //END SNIPPET: remote
-
-    /**
-     * Lookup the Calculator bean via its local home interface
-     *
-     * @throws Exception
-     */
-    //START SNIPPET: local    
-    public void testCalculatorViaLocalInterface() throws Exception {
-        Object object = initialContext.lookup("CalculatorImplLocal");
-
-        assertNotNull(object);
-        assertTrue(object instanceof CalculatorLocal);
-        CalculatorLocal calc = (CalculatorLocal) object;
-        assertEquals(10, calc.sum(4, 6));
-        assertEquals(12, calc.multiply(3, 4));
-    }
-    //END SNIPPET: local
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import junit.framework.TestCase;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Properties;
+
+public class CalculatorTest extends TestCase {
+
+    //START SNIPPET: setup
+    private InitialContext initialContext;
+
+    protected void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+        initialContext = new InitialContext(properties);
+    }
+    //END SNIPPET: setup    
+
+    /**
+     * Lookup the Calculator bean via its remote home interface
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: remote
+    public void testCalculatorViaRemoteInterface() throws Exception {
+        Object object = initialContext.lookup("CalculatorImplRemote");
+
+        assertNotNull(object);
+        assertTrue(object instanceof CalculatorRemote);
+        CalculatorRemote calc = (CalculatorRemote) object;
+        assertEquals(10, calc.sum(4, 6));
+        assertEquals(12, calc.multiply(3, 4));
+    }
+    //END SNIPPET: remote
+
+    /**
+     * Lookup the Calculator bean via its local home interface
+     *
+     * @throws Exception
+     */
+    //START SNIPPET: local    
+    public void testCalculatorViaLocalInterface() throws Exception {
+        Object object = initialContext.lookup("CalculatorImplLocal");
+
+        assertNotNull(object);
+        assertTrue(object instanceof CalculatorLocal);
+        CalculatorLocal calc = (CalculatorLocal) object;
+        assertEquals(10, calc.sum(4, 6));
+        assertEquals(12, calc.multiply(3, 4));
+    }
+    //END SNIPPET: local
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java b/examples/simple-stateless/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
index dd3f471..0acc0e4 100644
--- a/examples/simple-stateless/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
+++ b/examples/simple-stateless/src/main/java/org/superbiz/stateless/basic/CalculatorBean.java
@@ -1,49 +1,49 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-import javax.ejb.Stateless;
-
-/**
- * This is an EJB 3.1 style pojo Stateless session bean
- */
-//START SNIPPET: code
-@Stateless
-public class CalculatorBean {
-
-    public int add(int a, int b) {
-        return a + b;
-    }
-
-    public int subtract(int a, int b) {
-        return a - b;
-    }
-
-    public int multiply(int a, int b) {
-        return a * b;
-    }
-
-    public int divide(int a, int b) {
-        return a / b;
-    }
-
-    public int remainder(int a, int b) {
-        return a % b;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+import javax.ejb.Stateless;
+
+/**
+ * This is an EJB 3.1 style pojo Stateless session bean
+ */
+//START SNIPPET: code
+@Stateless
+public class CalculatorBean {
+
+    public int add(int a, int b) {
+        return a + b;
+    }
+
+    public int subtract(int a, int b) {
+        return a - b;
+    }
+
+    public int multiply(int a, int b) {
+        return a * b;
+    }
+
+    public int divide(int a, int b) {
+        return a / b;
+    }
+
+    public int remainder(int a, int b) {
+        return a % b;
+    }
+
+}
 //END SNIPPET: code
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-stateless/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-stateless/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java b/examples/simple-stateless/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
index 8425883..6972326 100644
--- a/examples/simple-stateless/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
+++ b/examples/simple-stateless/src/test/java/org/superbiz/stateless/basic/CalculatorTest.java
@@ -1,107 +1,107 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.stateless.basic;
-
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.NamingException;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-public class CalculatorTest {
-
-    private static EJBContainer ejbContainer;
-
-    private CalculatorBean calculator;
-
-    @BeforeClass
-    public static void startTheContainer() {
-        ejbContainer = EJBContainer.createEJBContainer();
-    }
-
-    @Before
-    public void lookupABean() throws NamingException {
-        Object object = ejbContainer.getContext().lookup("java:global/simple-stateless/CalculatorBean");
-
-        assertTrue(object instanceof CalculatorBean);
-
-        calculator = (CalculatorBean) object;
-    }
-
-    @AfterClass
-    public static void stopTheContainer() {
-        if (ejbContainer != null) {
-            ejbContainer.close();
-        }
-    }
-
-    /**
-     * Test Add method
-     */
-    @Test
-    public void testAdd() {
-
-        assertEquals(10, calculator.add(4, 6));
-
-    }
-
-    /**
-     * Test Subtract method
-     */
-    @Test
-    public void testSubtract() {
-
-        assertEquals(-2, calculator.subtract(4, 6));
-
-    }
-
-    /**
-     * Test Multiply method
-     */
-    @Test
-    public void testMultiply() {
-
-        assertEquals(24, calculator.multiply(4, 6));
-
-    }
-
-    /**
-     * Test Divide method
-     */
-    @Test
-    public void testDivide() {
-
-        assertEquals(2, calculator.divide(12, 6));
-
-    }
-
-    /**
-     * Test Remainder method
-     */
-    @Test
-    public void testRemainder() {
-
-        assertEquals(4, calculator.remainder(46, 6));
-
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.stateless.basic;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class CalculatorTest {
+
+    private static EJBContainer ejbContainer;
+
+    private CalculatorBean calculator;
+
+    @BeforeClass
+    public static void startTheContainer() {
+        ejbContainer = EJBContainer.createEJBContainer();
+    }
+
+    @Before
+    public void lookupABean() throws NamingException {
+        Object object = ejbContainer.getContext().lookup("java:global/simple-stateless/CalculatorBean");
+
+        assertTrue(object instanceof CalculatorBean);
+
+        calculator = (CalculatorBean) object;
+    }
+
+    @AfterClass
+    public static void stopTheContainer() {
+        if (ejbContainer != null) {
+            ejbContainer.close();
+        }
+    }
+
+    /**
+     * Test Add method
+     */
+    @Test
+    public void testAdd() {
+
+        assertEquals(10, calculator.add(4, 6));
+
+    }
+
+    /**
+     * Test Subtract method
+     */
+    @Test
+    public void testSubtract() {
+
+        assertEquals(-2, calculator.subtract(4, 6));
+
+    }
+
+    /**
+     * Test Multiply method
+     */
+    @Test
+    public void testMultiply() {
+
+        assertEquals(24, calculator.multiply(4, 6));
+
+    }
+
+    /**
+     * Test Divide method
+     */
+    @Test
+    public void testDivide() {
+
+        assertEquals(2, calculator.divide(12, 6));
+
+    }
+
+    /**
+     * Test Remainder method
+     */
+    @Test
+    public void testRemainder() {
+
+        assertEquals(4, calculator.remainder(46, 6));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-webservice-without-interface/src/main/java/org/superbiz/calculator/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/simple-webservice-without-interface/src/main/java/org/superbiz/calculator/Calculator.java b/examples/simple-webservice-without-interface/src/main/java/org/superbiz/calculator/Calculator.java
index b90e992..25c2cc8 100644
--- a/examples/simple-webservice-without-interface/src/main/java/org/superbiz/calculator/Calculator.java
+++ b/examples/simple-webservice-without-interface/src/main/java/org/superbiz/calculator/Calculator.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-@Stateless
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorWsService",
-               targetNamespace = "http://superbiz.org/wsdl")
-public class Calculator {
-
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorWsService",
+        targetNamespace = "http://superbiz.org/wsdl")
+public class Calculator {
+
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
----------------------------------------------------------------------
diff --git a/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java b/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
index a4acd24..0b7c89c 100644
--- a/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
+++ b/examples/simple-webservice-without-interface/src/test/java/org/superbiz/calculator/CalculatorTest.java
@@ -1,70 +1,70 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.NamingException;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.junit.Assert.assertTrue;
-
-public class CalculatorTest {
-
-    private static EJBContainer container;
-	
-	//Random port to avoid test conflicts
-    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        final Properties properties = new Properties();
-        properties.setProperty("openejb.embedded.remotable", "true");
-		
-		//Just for this test we change the default port from 4204 to avoid conflicts
-		properties.setProperty("httpejbd.port", "" + port);
-
-        container = EJBContainer.createEJBContainer(properties);
-    }
-
-    @Before
-    public void inject() throws NamingException {
-        if (container != null) {
-            container.getContext().bind("inject", this);
-        }
-    }
-
-    @AfterClass
-    public static void close() {
-        if (container != null) {
-            container.close();
-        }
-    }
-
-    @Test
-    public void wsdlExists() throws Exception {
-        final URL url = new URL("http://localhost:" + port + "/simple-webservice-without-interface/Calculator?wsdl");
-        assertTrue(IOUtils.readLines(url.openStream()).size() > 0);
-        assertTrue(IOUtils.readLines(url.openStream()).toString().contains("CalculatorWsService"));
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.NamingException;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+public class CalculatorTest {
+
+    private static EJBContainer container;
+
+    //Random port to avoid test conflicts
+    private static final int port = Integer.parseInt(System.getProperty("httpejbd.port", "" + org.apache.openejb.util.NetworkUtil.getNextAvailablePort()));
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        final Properties properties = new Properties();
+        properties.setProperty("openejb.embedded.remotable", "true");
+
+        //Just for this test we change the default port from 4204 to avoid conflicts
+        properties.setProperty("httpejbd.port", "" + port);
+
+        container = EJBContainer.createEJBContainer(properties);
+    }
+
+    @Before
+    public void inject() throws NamingException {
+        if (container != null) {
+            container.getContext().bind("inject", this);
+        }
+    }
+
+    @AfterClass
+    public static void close() {
+        if (container != null) {
+            container.close();
+        }
+    }
+
+    @Test
+    public void wsdlExists() throws Exception {
+        final URL url = new URL("http://localhost:" + port + "/simple-webservice-without-interface/Calculator?wsdl");
+        assertTrue(IOUtils.readLines(url.openStream()).size() > 0);
+        assertTrue(IOUtils.readLines(url.openStream()).toString().contains("CalculatorWsService"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/Calculator.java
----------------------------------------------------------------------
diff --git a/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/Calculator.java b/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/Calculator.java
index 8e683a2..e916956 100644
--- a/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/Calculator.java
+++ b/examples/simple-webservice/src/main/java/org/superbiz/calculator/ws/Calculator.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.superbiz.calculator.ws;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-@Stateless
-@WebService(
-               portName = "CalculatorPort",
-               serviceName = "CalculatorService",
-               targetNamespace = "http://superbiz.org/wsdl",
-               endpointInterface = "org.superbiz.calculator.ws.CalculatorWs")
-public class Calculator implements CalculatorWs {
-
-    public int sum(int add1, int add2) {
-        return add1 + add2;
-    }
-
-    public int multiply(int mul1, int mul2) {
-        return mul1 * mul2;
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.calculator.ws;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+@Stateless
+@WebService(
+        portName = "CalculatorPort",
+        serviceName = "CalculatorService",
+        targetNamespace = "http://superbiz.org/wsdl",
+        endpointInterface = "org.superbiz.calculator.ws.CalculatorWs")
+public class Calculator implements CalculatorWs {
+
+    public int sum(int add1, int add2) {
+        return add1 + add2;
+    }
+
+    public int multiply(int mul1, int mul2) {
+        return mul1 * mul2;
+    }
+}


[17/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mbean-auto-registration/src/main/java/org/superbiz/mbean/GuessHowManyMBean.java
----------------------------------------------------------------------
diff --git a/examples/mbean-auto-registration/src/main/java/org/superbiz/mbean/GuessHowManyMBean.java b/examples/mbean-auto-registration/src/main/java/org/superbiz/mbean/GuessHowManyMBean.java
index 5dadbe2..00c2eb3 100755
--- a/examples/mbean-auto-registration/src/main/java/org/superbiz/mbean/GuessHowManyMBean.java
+++ b/examples/mbean-auto-registration/src/main/java/org/superbiz/mbean/GuessHowManyMBean.java
@@ -1,48 +1,48 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.mbean;
-
-import javax.management.Description;
-import javax.management.MBean;
-import javax.management.ManagedAttribute;
-import javax.management.ManagedOperation;
-
-@MBean
-@Description("play with me to guess a number")
-public class GuessHowManyMBean {
-
-    private int value = 0;
-
-    @ManagedAttribute
-    @Description("you are cheating!")
-    public int getValue() {
-        return value;
-    }
-
-    @ManagedAttribute
-    public void setValue(int value) {
-        this.value = value;
-    }
-
-    @ManagedOperation
-    public String tryValue(int userValue) {
-        if (userValue == value) {
-            return "winner";
-        }
-        return "not the correct value, please have another try";
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.mbean;
+
+import javax.management.Description;
+import javax.management.MBean;
+import javax.management.ManagedAttribute;
+import javax.management.ManagedOperation;
+
+@MBean
+@Description("play with me to guess a number")
+public class GuessHowManyMBean {
+
+    private int value = 0;
+
+    @ManagedAttribute
+    @Description("you are cheating!")
+    public int getValue() {
+        return value;
+    }
+
+    @ManagedAttribute
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    @ManagedOperation
+    public String tryValue(int userValue) {
+        if (userValue == value) {
+            return "winner";
+        }
+        return "not the correct value, please have another try";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java b/examples/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java
index 1ef3031..b74daf0 100755
--- a/examples/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java
+++ b/examples/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java
@@ -1,51 +1,51 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.mbean;
-
-import org.apache.openejb.monitoring.LocalMBeanServer;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-
-public class GuessHowManyMBeanTest {
-
-    private static final String OBJECT_NAME = "openejb.user.mbeans:group=org.superbiz.mbean,application=mbean-auto-registration,name=GuessHowManyMBean";
-
-    @Test
-    public void play() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty(LocalMBeanServer.OPENEJB_JMX_ACTIVE, Boolean.TRUE.toString());
-        EJBContainer container = EJBContainer.createEJBContainer(properties);
-
-        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
-        ObjectName objectName = new ObjectName(OBJECT_NAME);
-        assertEquals(0, server.getAttribute(objectName, "value"));
-        server.setAttribute(objectName, new Attribute("value", 3));
-        assertEquals(3, server.getAttribute(objectName, "value"));
-        assertEquals("winner", server.invoke(objectName, "tryValue", new Object[]{3}, null));
-        assertEquals("not the correct value, please have another try", server.invoke(objectName, "tryValue", new Object[]{2}, null));
-
-        container.close();
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.mbean;
+
+import org.apache.openejb.monitoring.LocalMBeanServer;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.management.Attribute;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.lang.management.ManagementFactory;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+
+public class GuessHowManyMBeanTest {
+
+    private static final String OBJECT_NAME = "openejb.user.mbeans:group=org.superbiz.mbean,application=mbean-auto-registration,name=GuessHowManyMBean";
+
+    @Test
+    public void play() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(LocalMBeanServer.OPENEJB_JMX_ACTIVE, Boolean.TRUE.toString());
+        EJBContainer container = EJBContainer.createEJBContainer(properties);
+
+        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+        ObjectName objectName = new ObjectName(OBJECT_NAME);
+        assertEquals(0, server.getAttribute(objectName, "value"));
+        server.setAttribute(objectName, new Attribute("value", 3));
+        assertEquals(3, server.getAttribute(objectName, "value"));
+        assertEquals("winner", server.invoke(objectName, "tryValue", new Object[]{3}, null));
+        assertEquals("not the correct value, please have another try", server.invoke(objectName, "tryValue", new Object[]{2}, null));
+
+        container.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/pom.xml b/examples/moviefun-rest/pom.xml
index 055700f..d19e433 100644
--- a/examples/moviefun-rest/pom.xml
+++ b/examples/moviefun-rest/pom.xml
@@ -18,7 +18,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>moviefun-rest</artifactId>
   <packaging>war</packaging>
-  <version>1.1-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Web Examples :: Moviefun Rest</name>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/Movie.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/Movie.java b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/Movie.java
index 4a8032b..bbeec38 100644
--- a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/Movie.java
+++ b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/Movie.java
@@ -1,102 +1,102 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@Entity
-@XmlRootElement(name = "movie")
-public class Movie {
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-    private String genre;
-    private int rating;
-
-    public Movie() {
-    }
-
-    public Movie(String title, String director, String genre, int rating, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-        this.genre = genre;
-        this.rating = rating;
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-    public String getGenre() {
-        return genre;
-    }
-
-    public void setGenre(String genre) {
-        this.genre = genre;
-    }
-
-    public int getRating() {
-        return rating;
-    }
-
-    public void setRating(int rating) {
-        this.rating = rating;
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Entity
+@XmlRootElement(name = "movie")
+public class Movie {
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+    private String genre;
+    private int rating;
+
+    public Movie() {
+    }
+
+    public Movie(String title, String director, String genre, int rating, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+        this.genre = genre;
+        this.rating = rating;
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+    public String getGenre() {
+        return genre;
+    }
+
+    public void setGenre(String genre) {
+        this.genre = genre;
+    }
+
+    public int getRating() {
+        return rating;
+    }
+
+    public void setRating(int rating) {
+        this.rating = rating;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/MoviesBean.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/MoviesBean.java b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/MoviesBean.java
index 6f90e82..ff94d67 100644
--- a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/MoviesBean.java
+++ b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/MoviesBean.java
@@ -1,91 +1,91 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.TypedQuery;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Path;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import javax.persistence.metamodel.EntityType;
-import java.util.List;
-
-@Stateless
-public class MoviesBean {
-
-    @PersistenceContext(unitName = "movie-unit")
-    private EntityManager entityManager;
-
-    public Movie find(Long id) {
-        return entityManager.find(Movie.class, id);
-    }
-
-    public void addMovie(Movie movie) {
-        entityManager.persist(movie);
-    }
-
-    public void editMovie(Movie movie) {
-        entityManager.merge(movie);
-    }
-
-    public void deleteMovie(long id) {
-        Movie movie = entityManager.find(Movie.class, id);
-        entityManager.remove(movie);
-    }
-
-    public List<Movie> getMovies(Integer firstResult, Integer maxResults, String field, String searchTerm) {
-        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Movie> cq = qb.createQuery(Movie.class);
-        Root<Movie> root = cq.from(Movie.class);
-        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
-        if (field != null && searchTerm != null && !"".equals(field.trim()) && !"".equals(searchTerm.trim())) {
-            Path<String> path = root.get(type.getDeclaredSingularAttribute(field.trim(), String.class));
-            Predicate condition = qb.like(path, "%" + searchTerm.trim() + "%");
-            cq.where(condition);
-        }
-        TypedQuery<Movie> q = entityManager.createQuery(cq);
-        if (maxResults != null) {
-            q.setMaxResults(maxResults);
-        }
-        if (firstResult != null) {
-            q.setFirstResult(firstResult);
-        }
-        return q.getResultList();
-    }
-
-    public int count(String field, String searchTerm) {
-        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Long> cq = qb.createQuery(Long.class);
-        Root<Movie> root = cq.from(Movie.class);
-        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
-        cq.select(qb.count(root));
-        if (field != null && searchTerm != null && !"".equals(field.trim()) && !"".equals(searchTerm.trim())) {
-            Path<String> path = root.get(type.getDeclaredSingularAttribute(field.trim(), String.class));
-            Predicate condition = qb.like(path, "%" + searchTerm.trim() + "%");
-            cq.where(condition);
-        }
-        return entityManager.createQuery(cq).getSingleResult().intValue();
-    }
-
-    public void clean() {
-        entityManager.createQuery("delete from Movie").executeUpdate();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.persistence.metamodel.EntityType;
+import java.util.List;
+
+@Stateless
+public class MoviesBean {
+
+    @PersistenceContext(unitName = "movie-unit")
+    private EntityManager entityManager;
+
+    public Movie find(Long id) {
+        return entityManager.find(Movie.class, id);
+    }
+
+    public void addMovie(Movie movie) {
+        entityManager.persist(movie);
+    }
+
+    public void editMovie(Movie movie) {
+        entityManager.merge(movie);
+    }
+
+    public void deleteMovie(long id) {
+        Movie movie = entityManager.find(Movie.class, id);
+        entityManager.remove(movie);
+    }
+
+    public List<Movie> getMovies(Integer firstResult, Integer maxResults, String field, String searchTerm) {
+        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Movie> cq = qb.createQuery(Movie.class);
+        Root<Movie> root = cq.from(Movie.class);
+        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
+        if (field != null && searchTerm != null && !"".equals(field.trim()) && !"".equals(searchTerm.trim())) {
+            Path<String> path = root.get(type.getDeclaredSingularAttribute(field.trim(), String.class));
+            Predicate condition = qb.like(path, "%" + searchTerm.trim() + "%");
+            cq.where(condition);
+        }
+        TypedQuery<Movie> q = entityManager.createQuery(cq);
+        if (maxResults != null) {
+            q.setMaxResults(maxResults);
+        }
+        if (firstResult != null) {
+            q.setFirstResult(firstResult);
+        }
+        return q.getResultList();
+    }
+
+    public int count(String field, String searchTerm) {
+        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Long> cq = qb.createQuery(Long.class);
+        Root<Movie> root = cq.from(Movie.class);
+        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
+        cq.select(qb.count(root));
+        if (field != null && searchTerm != null && !"".equals(field.trim()) && !"".equals(searchTerm.trim())) {
+            Path<String> path = root.get(type.getDeclaredSingularAttribute(field.trim(), String.class));
+            Predicate condition = qb.like(path, "%" + searchTerm.trim() + "%");
+            cq.where(condition);
+        }
+        return entityManager.createQuery(cq).getSingleResult().intValue();
+    }
+
+    public void clean() {
+        entityManager.createQuery("delete from Movie").executeUpdate();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/ApplicationConfig.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/ApplicationConfig.java b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/ApplicationConfig.java
index 303dd6e..7466bb4 100644
--- a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/ApplicationConfig.java
+++ b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/ApplicationConfig.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun.rest;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-@ApplicationPath("/rest")
-public class ApplicationConfig extends Application {
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Set<Class<?>> getClasses() {
-        return new HashSet<Class<?>>(Arrays.asList(LoadRest.class, MoviesRest.class));
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun.rest;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+@ApplicationPath("/rest")
+public class ApplicationConfig extends Application {
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public Set<Class<?>> getClasses() {
+        return new HashSet<Class<?>>(Arrays.asList(LoadRest.class, MoviesRest.class));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/LoadRest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/LoadRest.java b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/LoadRest.java
index 021027b..a2b23d8 100644
--- a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/LoadRest.java
+++ b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/LoadRest.java
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun.rest;
-
-import org.superbiz.moviefun.Movie;
-import org.superbiz.moviefun.MoviesBean;
-
-import javax.ejb.EJB;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-@Path("load")
-public class LoadRest {
-    @EJB
-    private MoviesBean moviesBean;
-
-    @POST
-    public void load() {
-        moviesBean.addMovie(new Movie("Wedding Crashers", "David Dobkin", "Comedy", 7, 2005));
-        moviesBean.addMovie(new Movie("Starsky & Hutch", "Todd Phillips", "Action", 6, 2004));
-        moviesBean.addMovie(new Movie("Shanghai Knights", "David Dobkin", "Action", 6, 2003));
-        moviesBean.addMovie(new Movie("I-Spy", "Betty Thomas", "Adventure", 5, 2002));
-        moviesBean.addMovie(new Movie("The Royal Tenenbaums", "Wes Anderson", "Comedy", 8, 2001));
-        moviesBean.addMovie(new Movie("Zoolander", "Ben Stiller", "Comedy", 6, 2001));
-        moviesBean.addMovie(new Movie("Shanghai Noon", "Tom Dey", "Comedy", 7, 2000));
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun.rest;
+
+import org.superbiz.moviefun.Movie;
+import org.superbiz.moviefun.MoviesBean;
+
+import javax.ejb.EJB;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+@Path("load")
+public class LoadRest {
+    @EJB
+    private MoviesBean moviesBean;
+
+    @POST
+    public void load() {
+        moviesBean.addMovie(new Movie("Wedding Crashers", "David Dobkin", "Comedy", 7, 2005));
+        moviesBean.addMovie(new Movie("Starsky & Hutch", "Todd Phillips", "Action", 6, 2004));
+        moviesBean.addMovie(new Movie("Shanghai Knights", "David Dobkin", "Action", 6, 2003));
+        moviesBean.addMovie(new Movie("I-Spy", "Betty Thomas", "Adventure", 5, 2002));
+        moviesBean.addMovie(new Movie("The Royal Tenenbaums", "Wes Anderson", "Comedy", 8, 2001));
+        moviesBean.addMovie(new Movie("Zoolander", "Ben Stiller", "Comedy", 6, 2001));
+        moviesBean.addMovie(new Movie("Shanghai Noon", "Tom Dey", "Comedy", 7, 2000));
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/MoviesRest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/MoviesRest.java b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/MoviesRest.java
index 74a8450..946513c 100644
--- a/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/MoviesRest.java
+++ b/examples/moviefun-rest/src/main/java/org/superbiz/moviefun/rest/MoviesRest.java
@@ -1,80 +1,80 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun.rest;
-
-import org.superbiz.moviefun.Movie;
-import org.superbiz.moviefun.MoviesBean;
-
-import javax.ejb.EJB;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import java.util.List;
-
-@Path("movies")
-@Produces({"application/json"})
-public class MoviesRest {
-
-    @EJB
-    private MoviesBean service;
-
-    @GET
-    @Path("{id}")
-    public Movie find(@PathParam("id") Long id) {
-        return service.find(id);
-    }
-
-    @GET
-    public List<Movie> getMovies(@QueryParam("first") Integer first, @QueryParam("max") Integer max,
-                                 @QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) {
-        return service.getMovies(first, max, field, searchTerm);
-    }
-
-    @POST
-    @Consumes("application/json")
-    public Movie addMovie(Movie movie) {
-        service.addMovie(movie);
-        return movie;
-    }
-
-    @PUT
-    @Path("{id}")
-    @Consumes("application/json")
-    public Movie editMovie(Movie movie) {
-        service.editMovie(movie);
-        return movie;
-    }
-
-    @DELETE
-    @Path("{id}")
-    public void deleteMovie(@PathParam("id") long id) {
-        service.deleteMovie(id);
-    }
-
-    @GET
-    @Path("count")
-    public int count(@QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) {
-        return service.count(field, searchTerm);
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun.rest;
+
+import org.superbiz.moviefun.Movie;
+import org.superbiz.moviefun.MoviesBean;
+
+import javax.ejb.EJB;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import java.util.List;
+
+@Path("movies")
+@Produces({"application/json"})
+public class MoviesRest {
+
+    @EJB
+    private MoviesBean service;
+
+    @GET
+    @Path("{id}")
+    public Movie find(@PathParam("id") Long id) {
+        return service.find(id);
+    }
+
+    @GET
+    public List<Movie> getMovies(@QueryParam("first") Integer first, @QueryParam("max") Integer max,
+                                 @QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) {
+        return service.getMovies(first, max, field, searchTerm);
+    }
+
+    @POST
+    @Consumes("application/json")
+    public Movie addMovie(Movie movie) {
+        service.addMovie(movie);
+        return movie;
+    }
+
+    @PUT
+    @Path("{id}")
+    @Consumes("application/json")
+    public Movie editMovie(Movie movie) {
+        service.editMovie(movie);
+        return movie;
+    }
+
+    @DELETE
+    @Path("{id}")
+    public void deleteMovie(@PathParam("id") long id) {
+        service.deleteMovie(id);
+    }
+
+    @GET
+    @Path("count")
+    public int count(@QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) {
+        return service.count(field, searchTerm);
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
index 89fe1e1..93f6b75 100644
--- a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
+++ b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEJBTest.java
@@ -1,77 +1,77 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.ejb.EJB;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class MoviesEJBTest {
-
-    @Deployment
-    public static WebArchive createDeployment() {
-        return ShrinkWrap.create(WebArchive.class, "test.war")
-                .addClasses(Movie.class, MoviesBean.class, MoviesEJBTest.class)
-                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
-                .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
-    }
-
-    @EJB
-    private MoviesBean movies;
-
-    @Before
-    @After
-    public void clean() {
-        movies.clean();
-    }
-
-    @Test
-    public void shouldBeAbleToAddAMovie() throws Exception {
-        assertNotNull("Verify that the ejb was injected", movies);
-
-        final Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        assertEquals(1, movies.count("title", "a"));
-        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
-        assertEquals(1, moviesFound.size());
-        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        assertEquals("Action", moviesFound.get(0).getGenre());
-        assertEquals(9, moviesFound.get(0).getRating());
-        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.EJB;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class MoviesEJBTest {
+
+    @Deployment
+    public static WebArchive createDeployment() {
+        return ShrinkWrap.create(WebArchive.class, "test.war")
+                .addClasses(Movie.class, MoviesBean.class, MoviesEJBTest.class)
+                .addAsResource(new ClassLoaderAsset("META-INF/ejb-jar.xml"), "META-INF/ejb-jar.xml")
+                .addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml");
+    }
+
+    @EJB
+    private MoviesBean movies;
+
+    @Before
+    @After
+    public void clean() {
+        movies.clean();
+    }
+
+    @Test
+    public void shouldBeAbleToAddAMovie() throws Exception {
+        assertNotNull("Verify that the ejb was injected", movies);
+
+        final Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        assertEquals(1, movies.count("title", "a"));
+        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
+        assertEquals(1, moviesFound.size());
+        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        assertEquals("Action", moviesFound.get(0).getGenre());
+        assertEquals(9, moviesFound.get(0).getRating());
+        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
index b4c8c4e..7abccb6 100644
--- a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
+++ b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesEmbeddedEJBTest.java
@@ -1,75 +1,75 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class MoviesEmbeddedEJBTest {
-
-    private static EJBContainer ejbContainer;
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-    }
-
-    @AfterClass
-    public static void tearDown() {
-        if (ejbContainer != null) {
-            ejbContainer.close();
-        }
-    }
-
-    @Before
-    @After
-    public void clean() throws Exception {
-        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
-        movies.clean();
-    }
-
-    @Test
-    public void testShouldAddAMovie() throws Exception {
-        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
-
-        final Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        assertEquals(1, movies.count("title", "Bad Boys"));
-        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
-        assertEquals(1, moviesFound.size());
-        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        assertEquals("Action", moviesFound.get(0).getGenre());
-        assertEquals(9, moviesFound.get(0).getRating());
-        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class MoviesEmbeddedEJBTest {
+
+    private static EJBContainer ejbContainer;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+    }
+
+    @AfterClass
+    public static void tearDown() {
+        if (ejbContainer != null) {
+            ejbContainer.close();
+        }
+    }
+
+    @Before
+    @After
+    public void clean() throws Exception {
+        MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
+        movies.clean();
+    }
+
+    @Test
+    public void testShouldAddAMovie() throws Exception {
+        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
+
+        final Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        assertEquals(1, movies.count("title", "Bad Boys"));
+        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
+        assertEquals(1, moviesFound.size());
+        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        assertEquals("Action", moviesFound.get(0).getGenre());
+        assertEquals(9, moviesFound.get(0).getRating());
+        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesTest.java b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesTest.java
index fdff9ab..0545c97 100644
--- a/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesTest.java
+++ b/examples/moviefun-rest/src/test/java/org/superbiz/moviefun/MoviesTest.java
@@ -1,75 +1,75 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class MoviesTest {
-
-    private static EJBContainer ejbContainer;
-
-    @BeforeClass
-    public static void setUp() throws Exception {
-        ejbContainer = EJBContainer.createEJBContainer();
-    }
-
-    @AfterClass
-    public static void tearDown() {
-        if (ejbContainer != null) {
-            ejbContainer.close();
-        }
-    }
-
-    @Before
-    @After
-    public void clean() throws Exception {
-        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
-        movies.clean();
-    }
-
-    @Test
-    public void testShouldAddAMovie() throws Exception {
-        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
-
-        final Movie movie = new Movie();
-        movie.setDirector("Michael Bay");
-        movie.setGenre("Action");
-        movie.setRating(9);
-        movie.setTitle("Bad Boys");
-        movie.setYear(1995);
-        movies.addMovie(movie);
-
-        assertEquals(1, movies.count("title", "a"));
-        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
-        assertEquals(1, moviesFound.size());
-        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
-        assertEquals("Action", moviesFound.get(0).getGenre());
-        assertEquals(9, moviesFound.get(0).getRating());
-        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
-        assertEquals(1995, moviesFound.get(0).getYear());
-    }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class MoviesTest {
+
+    private static EJBContainer ejbContainer;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        ejbContainer = EJBContainer.createEJBContainer();
+    }
+
+    @AfterClass
+    public static void tearDown() {
+        if (ejbContainer != null) {
+            ejbContainer.close();
+        }
+    }
+
+    @Before
+    @After
+    public void clean() throws Exception {
+        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
+        movies.clean();
+    }
+
+    @Test
+    public void testShouldAddAMovie() throws Exception {
+        final MoviesBean movies = (MoviesBean) ejbContainer.getContext().lookup("java:global/moviefun-rest/MoviesBean!org.superbiz.moviefun.MoviesBean");
+
+        final Movie movie = new Movie();
+        movie.setDirector("Michael Bay");
+        movie.setGenre("Action");
+        movie.setRating(9);
+        movie.setTitle("Bad Boys");
+        movie.setYear(1995);
+        movies.addMovie(movie);
+
+        assertEquals(1, movies.count("title", "a"));
+        final List<Movie> moviesFound = movies.getMovies(0, 100, "title", "Bad Boys");
+        assertEquals(1, moviesFound.size());
+        assertEquals("Michael Bay", moviesFound.get(0).getDirector());
+        assertEquals("Action", moviesFound.get(0).getGenre());
+        assertEquals(9, moviesFound.get(0).getRating());
+        assertEquals("Bad Boys", moviesFound.get(0).getTitle());
+        assertEquals(1995, moviesFound.get(0).getYear());
+    }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/pom.xml
----------------------------------------------------------------------
diff --git a/examples/moviefun/pom.xml b/examples/moviefun/pom.xml
index 40766c8..fe32268 100644
--- a/examples/moviefun/pom.xml
+++ b/examples/moviefun/pom.xml
@@ -18,7 +18,7 @@
   <groupId>org.superbiz</groupId>
   <artifactId>moviefun</artifactId>
   <packaging>war</packaging>
-  <version>1.1-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Web Examples :: Moviefun</name>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/main/java/org/superbiz/moviefun/ActionServlet.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/main/java/org/superbiz/moviefun/ActionServlet.java b/examples/moviefun/src/main/java/org/superbiz/moviefun/ActionServlet.java
index 81e8821..92aecec 100644
--- a/examples/moviefun/src/main/java/org/superbiz/moviefun/ActionServlet.java
+++ b/examples/moviefun/src/main/java/org/superbiz/moviefun/ActionServlet.java
@@ -1,138 +1,138 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.apache.commons.lang.StringUtils;
-
-import javax.ejb.EJB;
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @version $Revision$ $Date$
- */
-@WebServlet("/moviefun/*")
-public class ActionServlet extends HttpServlet {
-
-    private static final long serialVersionUID = -5832176047021911038L;
-
-    public static int PAGE_SIZE = 5;
-
-    @EJB
-    private MoviesBean moviesBean;
-
-    @Override
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        process(request, response);
-    }
-
-    @Override
-    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        process(request, response);
-    }
-
-    private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        String action = request.getParameter("action");
-
-        if ("Add".equals(action)) {
-
-            String title = request.getParameter("title");
-            String director = request.getParameter("director");
-            String genre = request.getParameter("genre");
-            int rating = Integer.parseInt(request.getParameter("rating"));
-            int year = Integer.parseInt(request.getParameter("year"));
-
-            Movie movie = new Movie(title, director, genre, rating, year);
-
-            moviesBean.addMovie(movie);
-            response.sendRedirect("moviefun");
-            return;
-
-        } else if ("Remove".equals(action)) {
-
-            String[] ids = request.getParameterValues("id");
-            for (String id : ids) {
-                moviesBean.deleteMovieId(new Long(id));
-            }
-
-            response.sendRedirect("moviefun");
-            return;
-
-        } else {
-            String key = request.getParameter("key");
-            String field = request.getParameter("field");
-
-            int count = 0;
-
-            if (StringUtils.isEmpty(key) || StringUtils.isEmpty(field)) {
-                count = moviesBean.countAll();
-                key = "";
-                field = "";
-            } else {
-                count = moviesBean.count(field, key);
-            }
-
-            int page = 1;
-
-            try {
-                page = Integer.parseInt(request.getParameter("page"));
-            } catch (Exception e) {
-            }
-
-            int pageCount = (count / PAGE_SIZE);
-            if (pageCount == 0 || count % PAGE_SIZE != 0) {
-                pageCount++;
-            }
-
-            if (page < 1) {
-                page = 1;
-            }
-
-            if (page > pageCount) {
-                page = pageCount;
-            }
-
-            int start = (page - 1) * PAGE_SIZE;
-            List<Movie> range;
-
-            if (StringUtils.isEmpty(key) || StringUtils.isEmpty(field)) {
-                range = moviesBean.findAll(start, PAGE_SIZE);
-            } else {
-                range = moviesBean.findRange(field, key, start, PAGE_SIZE);
-            }
-
-            int end = start + range.size();
-
-            request.setAttribute("count", count);
-            request.setAttribute("start", start + 1);
-            request.setAttribute("end", end);
-            request.setAttribute("page", page);
-            request.setAttribute("pageCount", pageCount);
-            request.setAttribute("movies", range);
-            request.setAttribute("key", key);
-            request.setAttribute("field", field);
-        }
-
-        request.getRequestDispatcher("WEB-INF/moviefun.jsp").forward(request, response);
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.apache.commons.lang.StringUtils;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@WebServlet("/moviefun/*")
+public class ActionServlet extends HttpServlet {
+
+    private static final long serialVersionUID = -5832176047021911038L;
+
+    public static int PAGE_SIZE = 5;
+
+    @EJB
+    private MoviesBean moviesBean;
+
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        process(request, response);
+    }
+
+    @Override
+    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        process(request, response);
+    }
+
+    private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        String action = request.getParameter("action");
+
+        if ("Add".equals(action)) {
+
+            String title = request.getParameter("title");
+            String director = request.getParameter("director");
+            String genre = request.getParameter("genre");
+            int rating = Integer.parseInt(request.getParameter("rating"));
+            int year = Integer.parseInt(request.getParameter("year"));
+
+            Movie movie = new Movie(title, director, genre, rating, year);
+
+            moviesBean.addMovie(movie);
+            response.sendRedirect("moviefun");
+            return;
+
+        } else if ("Remove".equals(action)) {
+
+            String[] ids = request.getParameterValues("id");
+            for (String id : ids) {
+                moviesBean.deleteMovieId(new Long(id));
+            }
+
+            response.sendRedirect("moviefun");
+            return;
+
+        } else {
+            String key = request.getParameter("key");
+            String field = request.getParameter("field");
+
+            int count = 0;
+
+            if (StringUtils.isEmpty(key) || StringUtils.isEmpty(field)) {
+                count = moviesBean.countAll();
+                key = "";
+                field = "";
+            } else {
+                count = moviesBean.count(field, key);
+            }
+
+            int page = 1;
+
+            try {
+                page = Integer.parseInt(request.getParameter("page"));
+            } catch (Exception e) {
+            }
+
+            int pageCount = (count / PAGE_SIZE);
+            if (pageCount == 0 || count % PAGE_SIZE != 0) {
+                pageCount++;
+            }
+
+            if (page < 1) {
+                page = 1;
+            }
+
+            if (page > pageCount) {
+                page = pageCount;
+            }
+
+            int start = (page - 1) * PAGE_SIZE;
+            List<Movie> range;
+
+            if (StringUtils.isEmpty(key) || StringUtils.isEmpty(field)) {
+                range = moviesBean.findAll(start, PAGE_SIZE);
+            } else {
+                range = moviesBean.findRange(field, key, start, PAGE_SIZE);
+            }
+
+            int end = start + range.size();
+
+            request.setAttribute("count", count);
+            request.setAttribute("start", start + 1);
+            request.setAttribute("end", end);
+            request.setAttribute("page", page);
+            request.setAttribute("pageCount", pageCount);
+            request.setAttribute("movies", range);
+            request.setAttribute("key", key);
+            request.setAttribute("field", field);
+        }
+
+        request.getRequestDispatcher("WEB-INF/moviefun.jsp").forward(request, response);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/main/java/org/superbiz/moviefun/Movie.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/main/java/org/superbiz/moviefun/Movie.java b/examples/moviefun/src/main/java/org/superbiz/moviefun/Movie.java
index e6ab8de..831fbb9 100644
--- a/examples/moviefun/src/main/java/org/superbiz/moviefun/Movie.java
+++ b/examples/moviefun/src/main/java/org/superbiz/moviefun/Movie.java
@@ -1,104 +1,104 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-@Entity
-public class Movie implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    private long id;
-
-    private String director;
-    private String title;
-    private int year;
-    private String genre;
-    private int rating;
-
-    public Movie() {
-    }
-
-    public Movie(String title, String director, String genre, int rating, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-        this.genre = genre;
-        this.rating = rating;
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-    public String getGenre() {
-        return genre;
-    }
-
-    public void setGenre(String genre) {
-        this.genre = genre;
-    }
-
-    public int getRating() {
-        return rating;
-    }
-
-    public void setRating(int rating) {
-        this.rating = rating;
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+@Entity
+public class Movie implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private long id;
+
+    private String director;
+    private String title;
+    private int year;
+    private String genre;
+    private int rating;
+
+    public Movie() {
+    }
+
+    public Movie(String title, String director, String genre, int rating, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+        this.genre = genre;
+        this.rating = rating;
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+    public String getGenre() {
+        return genre;
+    }
+
+    public void setGenre(String genre) {
+        this.genre = genre;
+    }
+
+    public int getRating() {
+        return rating;
+    }
+
+    public void setRating(int rating) {
+        this.rating = rating;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/main/java/org/superbiz/moviefun/MoviesBean.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/main/java/org/superbiz/moviefun/MoviesBean.java b/examples/moviefun/src/main/java/org/superbiz/moviefun/MoviesBean.java
index cfee3f8..bb2d708 100644
--- a/examples/moviefun/src/main/java/org/superbiz/moviefun/MoviesBean.java
+++ b/examples/moviefun/src/main/java/org/superbiz/moviefun/MoviesBean.java
@@ -1,115 +1,115 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.TypedQuery;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Path;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import javax.persistence.metamodel.EntityType;
-import java.util.List;
-
-@Stateless
-public class MoviesBean {
-
-    @PersistenceContext(unitName = "movie-unit")
-    private EntityManager entityManager;
-
-    public Movie find(Long id) {
-        return entityManager.find(Movie.class, id);
-    }
-
-    public void addMovie(Movie movie) {
-        entityManager.persist(movie);
-    }
-
-    public void editMovie(Movie movie) {
-        entityManager.merge(movie);
-    }
-
-    public void deleteMovie(Movie movie) {
-        entityManager.remove(movie);
-    }
-
-    public void deleteMovieId(long id) {
-        Movie movie = entityManager.find(Movie.class, id);
-        deleteMovie(movie);
-    }
-
-    public List<Movie> getMovies() {
-        CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
-        cq.select(cq.from(Movie.class));
-        return entityManager.createQuery(cq).getResultList();
-    }
-
-    public List<Movie> findAll(int firstResult, int maxResults) {
-        CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
-        cq.select(cq.from(Movie.class));
-        TypedQuery<Movie> q = entityManager.createQuery(cq);
-        q.setMaxResults(maxResults);
-        q.setFirstResult(firstResult);
-        return q.getResultList();
-    }
-
-    public int countAll() {
-        CriteriaQuery<Long> cq = entityManager.getCriteriaBuilder().createQuery(Long.class);
-        Root<Movie> rt = cq.from(Movie.class);
-        cq.select(entityManager.getCriteriaBuilder().count(rt));
-        TypedQuery<Long> q = entityManager.createQuery(cq);
-        return (q.getSingleResult()).intValue();
-    }
-
-    public int count(String field, String searchTerm) {
-        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Long> cq = qb.createQuery(Long.class);
-        Root<Movie> root = cq.from(Movie.class);
-        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
-
-        Path<String> path = root.get(type.getDeclaredSingularAttribute(field, String.class));
-        Predicate condition = qb.like(path, "%" + searchTerm + "%");
-
-        cq.select(qb.count(root));
-        cq.where(condition);
-
-        return entityManager.createQuery(cq).getSingleResult().intValue();
-    }
-
-    public List<Movie> findRange(String field, String searchTerm, int firstResult, int maxResults) {
-        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
-        CriteriaQuery<Movie> cq = qb.createQuery(Movie.class);
-        Root<Movie> root = cq.from(Movie.class);
-        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
-
-        Path<String> path = root.get(type.getDeclaredSingularAttribute(field, String.class));
-        Predicate condition = qb.like(path, "%" + searchTerm + "%");
-
-        cq.where(condition);
-        TypedQuery<Movie> q = entityManager.createQuery(cq);
-        q.setMaxResults(maxResults);
-        q.setFirstResult(firstResult);
-        return q.getResultList();
-    }
-
-    public void clean() {
-        entityManager.createQuery("delete from Movie").executeUpdate();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.persistence.metamodel.EntityType;
+import java.util.List;
+
+@Stateless
+public class MoviesBean {
+
+    @PersistenceContext(unitName = "movie-unit")
+    private EntityManager entityManager;
+
+    public Movie find(Long id) {
+        return entityManager.find(Movie.class, id);
+    }
+
+    public void addMovie(Movie movie) {
+        entityManager.persist(movie);
+    }
+
+    public void editMovie(Movie movie) {
+        entityManager.merge(movie);
+    }
+
+    public void deleteMovie(Movie movie) {
+        entityManager.remove(movie);
+    }
+
+    public void deleteMovieId(long id) {
+        Movie movie = entityManager.find(Movie.class, id);
+        deleteMovie(movie);
+    }
+
+    public List<Movie> getMovies() {
+        CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
+        cq.select(cq.from(Movie.class));
+        return entityManager.createQuery(cq).getResultList();
+    }
+
+    public List<Movie> findAll(int firstResult, int maxResults) {
+        CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
+        cq.select(cq.from(Movie.class));
+        TypedQuery<Movie> q = entityManager.createQuery(cq);
+        q.setMaxResults(maxResults);
+        q.setFirstResult(firstResult);
+        return q.getResultList();
+    }
+
+    public int countAll() {
+        CriteriaQuery<Long> cq = entityManager.getCriteriaBuilder().createQuery(Long.class);
+        Root<Movie> rt = cq.from(Movie.class);
+        cq.select(entityManager.getCriteriaBuilder().count(rt));
+        TypedQuery<Long> q = entityManager.createQuery(cq);
+        return (q.getSingleResult()).intValue();
+    }
+
+    public int count(String field, String searchTerm) {
+        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Long> cq = qb.createQuery(Long.class);
+        Root<Movie> root = cq.from(Movie.class);
+        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
+
+        Path<String> path = root.get(type.getDeclaredSingularAttribute(field, String.class));
+        Predicate condition = qb.like(path, "%" + searchTerm + "%");
+
+        cq.select(qb.count(root));
+        cq.where(condition);
+
+        return entityManager.createQuery(cq).getSingleResult().intValue();
+    }
+
+    public List<Movie> findRange(String field, String searchTerm, int firstResult, int maxResults) {
+        CriteriaBuilder qb = entityManager.getCriteriaBuilder();
+        CriteriaQuery<Movie> cq = qb.createQuery(Movie.class);
+        Root<Movie> root = cq.from(Movie.class);
+        EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
+
+        Path<String> path = root.get(type.getDeclaredSingularAttribute(field, String.class));
+        Predicate condition = qb.like(path, "%" + searchTerm + "%");
+
+        cq.where(condition);
+        TypedQuery<Movie> q = entityManager.createQuery(cq);
+        q.setMaxResults(maxResults);
+        q.setFirstResult(firstResult);
+        return q.getResultList();
+    }
+
+    public void clean() {
+        entityManager.createQuery("delete from Movie").executeUpdate();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/moviefun/src/test/java/org/superbiz/moviefun/Basedir.java
----------------------------------------------------------------------
diff --git a/examples/moviefun/src/test/java/org/superbiz/moviefun/Basedir.java b/examples/moviefun/src/test/java/org/superbiz/moviefun/Basedir.java
index aaabf36..f7368dc 100644
--- a/examples/moviefun/src/test/java/org/superbiz/moviefun/Basedir.java
+++ b/examples/moviefun/src/test/java/org/superbiz/moviefun/Basedir.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.moviefun;
-
-import org.apache.ziplock.JarLocation;
-
-import java.io.File;
-
-/**
-* @version $Revision$ $Date$
-*/
-public class Basedir {
-
-    public static File basedir(final String s) {
-        final File classes = JarLocation.jarLocation(MoviesArquillianHtmlUnitTest.class);
-        final File target = classes.getParentFile();
-        final File basedir = target.getParentFile();
-        return new File(basedir, s);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.apache.ziplock.JarLocation;
+
+import java.io.File;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class Basedir {
+
+    public static File basedir(final String s) {
+        final File classes = JarLocation.jarLocation(MoviesArquillianHtmlUnitTest.class);
+        final File target = classes.getParentFile();
+        final File basedir = target.getParentFile();
+        return new File(basedir, s);
+    }
+}


[05/33] tomee git commit: Align SNAPSHOT versions & reformat examples

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java b/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java
index 3dba45b..6a5b404 100644
--- a/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java
+++ b/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java
@@ -1,154 +1,152 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.ejb.SessionContext;
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MovieTest {
-
-    @EJB
-    private UserInfo userInfo;
-
-    @EJB
-    private Movies movies;
-
-    private EJBContainer container;
-
-    @Before
-    public void setUp() throws Exception {
-        // Uncomment this line to set the login/logout functionality on Debug
-        //System.setProperty("log4j.category.OpenEJB.security", "debug");
-
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        this.container = EJBContainer.createEJBContainer(p);
-        this.container.getContext().bind("inject", this);
-    }
-
-    @After
-    public void tearDown() {
-        this.container.close();
-    }
-
-    @Test
-    public void testAsManager() throws Exception {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.put(Context.SECURITY_PRINCIPAL, "jane");
-        p.put(Context.SECURITY_CREDENTIALS, "waterfall");
-
-        InitialContext context = new InitialContext(p);
-        Assert.assertEquals("Wrong user", "jane", userInfo.getUserName());
-        Assert.assertTrue("jane is supposed to be a Manager", userInfo.isCallerInRole("Manager"));
-        Assert.assertTrue("jane is supposed to be an Employee", userInfo.isCallerInRole("Employee"));
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testAsEmployee() throws Exception {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.put(Context.SECURITY_PRINCIPAL, "joe");
-        p.put(Context.SECURITY_CREDENTIALS, "cool");
-
-        InitialContext context = new InitialContext(p);
-        Assert.assertEquals("Wrong user", "joe", userInfo.getUserName());
-        Assert.assertTrue("joe is supposed to be an Employee", userInfo.isCallerInRole("Employee"));
-
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                try {
-                    movies.deleteMovie(movie);
-                    Assert.fail("Employees should not be allowed to delete");
-                } catch (EJBAccessException e) {
-                    // Good, Employees cannot delete things
-                }
-            }
-
-            // The list should still be three movies long
-            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testUnauthenticated() throws Exception {
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            Assert.fail("Unauthenticated users should not be able to add movies. User: " + userInfo.getUserName());
-        } catch (EJBAccessException e) {
-            // Good, guests cannot add things
-        }
-
-        try {
-            movies.deleteMovie(null);
-            Assert.fail("Unauthenticated users should not be allowed to delete");
-        } catch (EJBAccessException e) {
-            // Good, Unauthenticated users cannot delete things
-        }
-
-        try {
-            // Read access should be allowed
-            movies.getMovies();
-        } catch (EJBAccessException e) {
-            Assert.fail("Read access should be allowed");
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MovieTest {
+
+    @EJB
+    private UserInfo userInfo;
+
+    @EJB
+    private Movies movies;
+
+    private EJBContainer container;
+
+    @Before
+    public void setUp() throws Exception {
+        // Uncomment this line to set the login/logout functionality on Debug
+        //System.setProperty("log4j.category.OpenEJB.security", "debug");
+
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        this.container = EJBContainer.createEJBContainer(p);
+        this.container.getContext().bind("inject", this);
+    }
+
+    @After
+    public void tearDown() {
+        this.container.close();
+    }
+
+    @Test
+    public void testAsManager() throws Exception {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.put(Context.SECURITY_PRINCIPAL, "jane");
+        p.put(Context.SECURITY_CREDENTIALS, "waterfall");
+
+        InitialContext context = new InitialContext(p);
+        Assert.assertEquals("Wrong user", "jane", userInfo.getUserName());
+        Assert.assertTrue("jane is supposed to be a Manager", userInfo.isCallerInRole("Manager"));
+        Assert.assertTrue("jane is supposed to be an Employee", userInfo.isCallerInRole("Employee"));
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testAsEmployee() throws Exception {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.put(Context.SECURITY_PRINCIPAL, "joe");
+        p.put(Context.SECURITY_CREDENTIALS, "cool");
+
+        InitialContext context = new InitialContext(p);
+        Assert.assertEquals("Wrong user", "joe", userInfo.getUserName());
+        Assert.assertTrue("joe is supposed to be an Employee", userInfo.isCallerInRole("Employee"));
+
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                try {
+                    movies.deleteMovie(movie);
+                    Assert.fail("Employees should not be allowed to delete");
+                } catch (EJBAccessException e) {
+                    // Good, Employees cannot delete things
+                }
+            }
+
+            // The list should still be three movies long
+            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testUnauthenticated() throws Exception {
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            Assert.fail("Unauthenticated users should not be able to add movies. User: " + userInfo.getUserName());
+        } catch (EJBAccessException e) {
+            // Good, guests cannot add things
+        }
+
+        try {
+            movies.deleteMovie(null);
+            Assert.fail("Unauthenticated users should not be allowed to delete");
+        } catch (EJBAccessException e) {
+            // Good, Unauthenticated users cannot delete things
+        }
+
+        try {
+            // Read access should be allowed
+            movies.getMovies();
+        } catch (EJBAccessException e) {
+            Assert.fail("Read access should be allowed");
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/UserInfo.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/UserInfo.java b/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/UserInfo.java
index 100af66..341239a 100644
--- a/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/UserInfo.java
+++ b/examples/testing-security-2/src/test/java/org/superbiz/injection/secure/UserInfo.java
@@ -1,36 +1,36 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.superbiz.injection.secure;
-
-import javax.annotation.Resource;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
-
-@Stateless
-public class UserInfo {
-    @Resource
-    private SessionContext sessionContext;
-
-    public String getUserName() {
-        return sessionContext.getCallerPrincipal().getName();
-    }
-
-    public boolean isCallerInRole(String role) {
-        return sessionContext.isCallerInRole(role);
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.superbiz.injection.secure;
+
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+@Stateless
+public class UserInfo {
+    @Resource
+    private SessionContext sessionContext;
+
+    public String getUserName() {
+        return sessionContext.getCallerPrincipal().getName();
+    }
+
+    public boolean isCallerInRole(String role) {
+        return sessionContext.isCallerInRole(role);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movie.java b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movie.java
index b5df45c..73fdf33 100644
--- a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movie.java
+++ b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movies.java b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movies.java
index b3ba8e8..100598b 100644
--- a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movies.java
+++ b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/Movies.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-//START SNIPPET: code
-
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    @RolesAllowed({"Employee", "Manager"})
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @RolesAllowed({"Manager"})
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @PermitAll
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+//START SNIPPET: code
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    @RolesAllowed({"Employee", "Manager"})
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @RolesAllowed({"Manager"})
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @PermitAll
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/MyLoginProvider.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/MyLoginProvider.java b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/MyLoginProvider.java
index a21c43e..bdf9540 100644
--- a/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/MyLoginProvider.java
+++ b/examples/testing-security-3/src/main/java/org/superbiz/injection/secure/MyLoginProvider.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import org.apache.openejb.core.security.jaas.LoginProvider;
-
-import javax.security.auth.login.FailedLoginException;
-import java.util.Arrays;
-import java.util.List;
-
-public class MyLoginProvider implements LoginProvider {
-
-    @Override
-    public List<String> authenticate(String user, String password) throws FailedLoginException {
-        if ("paul".equals(user) && "michelle".equals(password)) {
-            return Arrays.asList("Manager", "rockstar", "beatle");
-        }
-
-        if ("eddie".equals(user) && "jump".equals(password)) {
-            return Arrays.asList("Employee", "rockstar", "vanhalen");
-        }
-
-        throw new FailedLoginException("Bad user or password!");
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import org.apache.openejb.core.security.jaas.LoginProvider;
+
+import javax.security.auth.login.FailedLoginException;
+import java.util.Arrays;
+import java.util.List;
+
+public class MyLoginProvider implements LoginProvider {
+
+    @Override
+    public List<String> authenticate(String user, String password) throws FailedLoginException {
+        if ("paul".equals(user) && "michelle".equals(password)) {
+            return Arrays.asList("Manager", "rockstar", "beatle");
+        }
+
+        if ("eddie".equals(user) && "jump".equals(password)) {
+            return Arrays.asList("Employee", "rockstar", "vanhalen");
+        }
+
+        throw new FailedLoginException("Bad user or password!");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-3/src/test/java/org/superbiz/injection/secure/MovieTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-3/src/test/java/org/superbiz/injection/secure/MovieTest.java b/examples/testing-security-3/src/test/java/org/superbiz/injection/secure/MovieTest.java
index 18f505a..a939525 100644
--- a/examples/testing-security-3/src/test/java/org/superbiz/injection/secure/MovieTest.java
+++ b/examples/testing-security-3/src/test/java/org/superbiz/injection/secure/MovieTest.java
@@ -1,157 +1,157 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MovieTest {
-
-    @EJB
-    private Movies movies;
-
-    private EJBContainer container;
-
-    private Context getContext(String user, String pass) throws NamingException {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.setProperty("openejb.authentication.realmName", "ServiceProviderLogin");
-        p.put(Context.SECURITY_PRINCIPAL, user);
-        p.put(Context.SECURITY_CREDENTIALS, pass);
-        return new InitialContext(p);
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        this.container = EJBContainer.createEJBContainer(p);
-        this.container.getContext().bind("inject", this);
-    }
-
-    @After
-    public void tearDown() {
-        this.container.close();
-    }
-
-    @Test
-    public void testAsManager() throws Exception {
-        final Context context = getContext("paul", "michelle");
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testAsEmployee() throws Exception {
-        final Context context = getContext("eddie", "jump");
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                try {
-                    movies.deleteMovie(movie);
-                    Assert.fail("Employees should not be allowed to delete");
-                } catch (EJBAccessException e) {
-                    // Good, Employees cannot delete things
-                }
-            }
-
-            // The list should still be three movies long
-            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testUnauthenticated() throws Exception {
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            Assert.fail("Unauthenticated users should not be able to add movies");
-        } catch (EJBAccessException e) {
-            // Good, guests cannot add things
-        }
-
-        try {
-            movies.deleteMovie(null);
-            Assert.fail("Unauthenticated users should not be allowed to delete");
-        } catch (EJBAccessException e) {
-            // Good, Unauthenticated users cannot delete things
-        }
-
-        try {
-            // Read access should be allowed
-            movies.getMovies();
-        } catch (EJBAccessException e) {
-            Assert.fail("Read access should be allowed");
-        }
-    }
-
-    @Test
-    public void testLoginFailure() throws NamingException {
-        try {
-            getContext("eddie", "panama");
-            Assert.fail("supposed to have a login failure here");
-        } catch (javax.naming.AuthenticationException e) {
-            //expected
-        }
-
-        try {
-            getContext("jimmy", "foxylady");
-            Assert.fail("supposed to have a login failure here");
-        } catch (javax.naming.AuthenticationException e) {
-            //expected
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MovieTest {
+
+    @EJB
+    private Movies movies;
+
+    private EJBContainer container;
+
+    private Context getContext(String user, String pass) throws NamingException {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.setProperty("openejb.authentication.realmName", "ServiceProviderLogin");
+        p.put(Context.SECURITY_PRINCIPAL, user);
+        p.put(Context.SECURITY_CREDENTIALS, pass);
+        return new InitialContext(p);
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        this.container = EJBContainer.createEJBContainer(p);
+        this.container.getContext().bind("inject", this);
+    }
+
+    @After
+    public void tearDown() {
+        this.container.close();
+    }
+
+    @Test
+    public void testAsManager() throws Exception {
+        final Context context = getContext("paul", "michelle");
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testAsEmployee() throws Exception {
+        final Context context = getContext("eddie", "jump");
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                try {
+                    movies.deleteMovie(movie);
+                    Assert.fail("Employees should not be allowed to delete");
+                } catch (EJBAccessException e) {
+                    // Good, Employees cannot delete things
+                }
+            }
+
+            // The list should still be three movies long
+            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testUnauthenticated() throws Exception {
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            Assert.fail("Unauthenticated users should not be able to add movies");
+        } catch (EJBAccessException e) {
+            // Good, guests cannot add things
+        }
+
+        try {
+            movies.deleteMovie(null);
+            Assert.fail("Unauthenticated users should not be allowed to delete");
+        } catch (EJBAccessException e) {
+            // Good, Unauthenticated users cannot delete things
+        }
+
+        try {
+            // Read access should be allowed
+            movies.getMovies();
+        } catch (EJBAccessException e) {
+            Assert.fail("Read access should be allowed");
+        }
+    }
+
+    @Test
+    public void testLoginFailure() throws NamingException {
+        try {
+            getContext("eddie", "panama");
+            Assert.fail("supposed to have a login failure here");
+        } catch (javax.naming.AuthenticationException e) {
+            //expected
+        }
+
+        try {
+            getContext("jimmy", "foxylady");
+            Assert.fail("supposed to have a login failure here");
+        } catch (javax.naming.AuthenticationException e) {
+            //expected
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/LoginBean.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/LoginBean.java b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/LoginBean.java
index 7c88fff..4ee61a6 100644
--- a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/LoginBean.java
+++ b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/LoginBean.java
@@ -1,39 +1,39 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.ejb.Stateless;
-import javax.security.auth.login.FailedLoginException;
-import java.util.Arrays;
-import java.util.List;
-
-@Stateless
-public class LoginBean {
-
-    public List<String> authenticate(String user, String password) throws FailedLoginException {
-        if ("paul".equals(user) && "michelle".equals(password)) {
-            return Arrays.asList("Manager", "rockstar", "beatle");
-        }
-
-        if ("eddie".equals(user) && "jump".equals(password)) {
-            return Arrays.asList("Employee", "rockstar", "vanhalen");
-        }
-
-        throw new FailedLoginException("Bad user or password!");
-    }
-}
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.ejb.Stateless;
+import javax.security.auth.login.FailedLoginException;
+import java.util.Arrays;
+import java.util.List;
+
+@Stateless
+public class LoginBean {
+
+    public List<String> authenticate(String user, String password) throws FailedLoginException {
+        if ("paul".equals(user) && "michelle".equals(password)) {
+            return Arrays.asList("Manager", "rockstar", "beatle");
+        }
+
+        if ("eddie".equals(user) && "jump".equals(password)) {
+            return Arrays.asList("Employee", "rockstar", "vanhalen");
+        }
+
+        throw new FailedLoginException("Bad user or password!");
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movie.java b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movie.java
index b5df45c..73fdf33 100644
--- a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movie.java
+++ b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movies.java b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movies.java
index b3ba8e8..100598b 100644
--- a/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movies.java
+++ b/examples/testing-security-4/src/main/java/org/superbiz/injection/secure/Movies.java
@@ -1,55 +1,55 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-//START SNIPPET: code
-
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-    private EntityManager entityManager;
-
-    @RolesAllowed({"Employee", "Manager"})
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @RolesAllowed({"Manager"})
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @PermitAll
-    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+//START SNIPPET: code
+
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+    private EntityManager entityManager;
+
+    @RolesAllowed({"Employee", "Manager"})
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @RolesAllowed({"Manager"})
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @PermitAll
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-4/src/test/java/org/superbiz/injection/secure/MovieTest.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-4/src/test/java/org/superbiz/injection/secure/MovieTest.java b/examples/testing-security-4/src/test/java/org/superbiz/injection/secure/MovieTest.java
index 0e3654b..ec18a2f 100644
--- a/examples/testing-security-4/src/test/java/org/superbiz/injection/secure/MovieTest.java
+++ b/examples/testing-security-4/src/test/java/org/superbiz/injection/secure/MovieTest.java
@@ -1,161 +1,161 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.ejb.EJB;
-import javax.ejb.EJBAccessException;
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.List;
-import java.util.Properties;
-
-//START SNIPPET: code
-public class MovieTest {
-
-    @EJB
-    private Movies movies;
-
-    private EJBContainer container;
-
-    private Context getContext(String user, String pass) throws NamingException {
-        Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
-        p.setProperty("openejb.authentication.realmName", "ScriptLogin");
-        p.put(Context.SECURITY_PRINCIPAL, user);
-        p.put(Context.SECURITY_CREDENTIALS, pass);
-
-        return new InitialContext(p);
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        final ClassLoader ctxCl = Thread.currentThread().getContextClassLoader();
-        System.setProperty("openejb.ScriptLoginModule.scriptURI", ctxCl.getResource("loginscript.js").toExternalForm());
-
-        Properties p = new Properties();
-        p.put("movieDatabase", "new://Resource?type=DataSource");
-        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
-        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
-
-        this.container = EJBContainer.createEJBContainer(p);
-        this.container.getContext().bind("inject", this);
-    }
-
-    @After
-    public void tearDown() {
-        this.container.close();
-    }
-
-    @Test
-    public void testAsManager() throws Exception {
-        final Context context = getContext("paul", "michelle");
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                movies.deleteMovie(movie);
-            }
-
-            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testAsEmployee() throws Exception {
-        final Context context = getContext("eddie", "jump");
-
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
-            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
-
-            List<Movie> list = movies.getMovies();
-            Assert.assertEquals("List.size()", 3, list.size());
-
-            for (Movie movie : list) {
-                try {
-                    movies.deleteMovie(movie);
-                    Assert.fail("Employees should not be allowed to delete");
-                } catch (EJBAccessException e) {
-                    // Good, Employees cannot delete things
-                }
-            }
-
-            // The list should still be three movies long
-            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
-        } finally {
-            context.close();
-        }
-    }
-
-    @Test
-    public void testUnauthenticated() throws Exception {
-        try {
-            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
-            Assert.fail("Unauthenticated users should not be able to add movies");
-        } catch (EJBAccessException e) {
-            // Good, guests cannot add things
-        }
-
-        try {
-            movies.deleteMovie(null);
-            Assert.fail("Unauthenticated users should not be allowed to delete");
-        } catch (EJBAccessException e) {
-            // Good, Unauthenticated users cannot delete things
-        }
-
-        try {
-            // Read access should be allowed
-            movies.getMovies();
-        } catch (EJBAccessException e) {
-            Assert.fail("Read access should be allowed");
-        }
-    }
-
-    @Test
-    public void testLoginFailure() throws NamingException {
-        try {
-            getContext("eddie", "panama");
-            Assert.fail("supposed to have a login failure here");
-        } catch (javax.naming.AuthenticationException e) {
-            //expected
-        }
-
-        try {
-            getContext("jimmy", "foxylady");
-            Assert.fail("supposed to have a login failure here");
-        } catch (javax.naming.AuthenticationException e) {
-            //expected
-        }
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBAccessException;
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.List;
+import java.util.Properties;
+
+//START SNIPPET: code
+public class MovieTest {
+
+    @EJB
+    private Movies movies;
+
+    private EJBContainer container;
+
+    private Context getContext(String user, String pass) throws NamingException {
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+        p.setProperty("openejb.authentication.realmName", "ScriptLogin");
+        p.put(Context.SECURITY_PRINCIPAL, user);
+        p.put(Context.SECURITY_CREDENTIALS, pass);
+
+        return new InitialContext(p);
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        final ClassLoader ctxCl = Thread.currentThread().getContextClassLoader();
+        System.setProperty("openejb.ScriptLoginModule.scriptURI", ctxCl.getResource("loginscript.js").toExternalForm());
+
+        Properties p = new Properties();
+        p.put("movieDatabase", "new://Resource?type=DataSource");
+        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+        p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+
+        this.container = EJBContainer.createEJBContainer(p);
+        this.container.getContext().bind("inject", this);
+    }
+
+    @After
+    public void tearDown() {
+        this.container.close();
+    }
+
+    @Test
+    public void testAsManager() throws Exception {
+        final Context context = getContext("paul", "michelle");
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                movies.deleteMovie(movie);
+            }
+
+            Assert.assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testAsEmployee() throws Exception {
+        final Context context = getContext("eddie", "jump");
+
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+            movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+            List<Movie> list = movies.getMovies();
+            Assert.assertEquals("List.size()", 3, list.size());
+
+            for (Movie movie : list) {
+                try {
+                    movies.deleteMovie(movie);
+                    Assert.fail("Employees should not be allowed to delete");
+                } catch (EJBAccessException e) {
+                    // Good, Employees cannot delete things
+                }
+            }
+
+            // The list should still be three movies long
+            Assert.assertEquals("Movies.getMovies()", 3, movies.getMovies().size());
+        } finally {
+            context.close();
+        }
+    }
+
+    @Test
+    public void testUnauthenticated() throws Exception {
+        try {
+            movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+            Assert.fail("Unauthenticated users should not be able to add movies");
+        } catch (EJBAccessException e) {
+            // Good, guests cannot add things
+        }
+
+        try {
+            movies.deleteMovie(null);
+            Assert.fail("Unauthenticated users should not be allowed to delete");
+        } catch (EJBAccessException e) {
+            // Good, Unauthenticated users cannot delete things
+        }
+
+        try {
+            // Read access should be allowed
+            movies.getMovies();
+        } catch (EJBAccessException e) {
+            Assert.fail("Read access should be allowed");
+        }
+    }
+
+    @Test
+    public void testLoginFailure() throws NamingException {
+        try {
+            getContext("eddie", "panama");
+            Assert.fail("supposed to have a login failure here");
+        } catch (javax.naming.AuthenticationException e) {
+            //expected
+        }
+
+        try {
+            getContext("jimmy", "foxylady");
+            Assert.fail("supposed to have a login failure here");
+        } catch (javax.naming.AuthenticationException e) {
+            //expected
+        }
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movie.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movie.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movie.java
index b5df45c..73fdf33 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movie.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movie.java
@@ -1,61 +1,61 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-import javax.persistence.Entity;
-
-@Entity
-public class Movie {
-
-    private String director;
-    private String title;
-    private int year;
-
-    public Movie() {
-    }
-
-    public Movie(String director, String title, int year) {
-        this.director = director;
-        this.title = title;
-        this.year = year;
-    }
-
-    public String getDirector() {
-        return director;
-    }
-
-    public void setDirector(String director) {
-        this.director = director;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public int getYear() {
-        return year;
-    }
-
-    public void setYear(int year) {
-        this.year = year;
-    }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Movie {
+
+    private String director;
+    private String title;
+    private int year;
+
+    public Movie() {
+    }
+
+    public Movie(String director, String title, int year) {
+        this.director = director;
+        this.title = title;
+        this.year = year;
+    }
+
+    public String getDirector() {
+        return director;
+    }
+
+    public void setDirector(String director) {
+        this.director = director;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public int getYear() {
+        return year;
+    }
+
+    public void setYear(int year) {
+        this.year = year;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movies.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movies.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movies.java
index deee414..13b2b45 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movies.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/Movies.java
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure;
-
-//START SNIPPET: code
-
-import org.superbiz.injection.secure.api.AddPermission;
-import org.superbiz.injection.secure.api.DeletePermission;
-import org.superbiz.injection.secure.api.MovieUnit;
-import org.superbiz.injection.secure.api.ReadPermission;
-
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.List;
-
-@Stateful
-public class Movies {
-
-    @MovieUnit
-    private EntityManager entityManager;
-
-    @AddPermission
-    public void addMovie(Movie movie) throws Exception {
-        entityManager.persist(movie);
-    }
-
-    @DeletePermission
-    public void deleteMovie(Movie movie) throws Exception {
-        entityManager.remove(movie);
-    }
-
-    @ReadPermission
-    public List<Movie> getMovies() throws Exception {
-        Query query = entityManager.createQuery("SELECT m from Movie as m");
-        return query.getResultList();
-    }
-}
-//END SNIPPET: code
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure;
+
+//START SNIPPET: code
+
+import org.superbiz.injection.secure.api.AddPermission;
+import org.superbiz.injection.secure.api.DeletePermission;
+import org.superbiz.injection.secure.api.MovieUnit;
+import org.superbiz.injection.secure.api.ReadPermission;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful
+public class Movies {
+
+    @MovieUnit
+    private EntityManager entityManager;
+
+    @AddPermission
+    public void addMovie(Movie movie) throws Exception {
+        entityManager.persist(movie);
+    }
+
+    @DeletePermission
+    public void deleteMovie(Movie movie) throws Exception {
+        entityManager.remove(movie);
+    }
+
+    @ReadPermission
+    public List<Movie> getMovies() throws Exception {
+        Query query = entityManager.createQuery("SELECT m from Movie as m");
+        return query.getResultList();
+    }
+}
+//END SNIPPET: code

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/AddPermission.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/AddPermission.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/AddPermission.java
index 2f22414..843ae62 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/AddPermission.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/AddPermission.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.annotation.security.RolesAllowed;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface AddPermission {
-
-    public static interface $ {
-
-        @AddPermission
-        @RolesAllowed({"Employee", "Manager"})
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.annotation.security.RolesAllowed;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface AddPermission {
+
+    public static interface $ {
+
+        @AddPermission
+        @RolesAllowed({"Employee", "Manager"})
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/DeletePermission.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/DeletePermission.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/DeletePermission.java
index dd69028..0c3f783 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/DeletePermission.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/DeletePermission.java
@@ -1,37 +1,37 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.annotation.security.RolesAllowed;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-
-public @interface DeletePermission {
-
-    public static interface $ {
-
-        @DeletePermission
-        @RolesAllowed("Manager")
-        public void method();
-    }
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.annotation.security.RolesAllowed;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface DeletePermission {
+
+    public static interface $ {
+
+        @DeletePermission
+        @RolesAllowed("Manager")
+        public void method();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/Metatype.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/Metatype.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/Metatype.java
index eb08d38..341108d 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/Metatype.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/Metatype.java
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target(ElementType.ANNOTATION_TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Metatype {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.ANNOTATION_TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Metatype {
+
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/MovieUnit.java
----------------------------------------------------------------------
diff --git a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/MovieUnit.java b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/MovieUnit.java
index 795a4cf..81a89ef 100644
--- a/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/MovieUnit.java
+++ b/examples/testing-security-meta/src/main/java/org/superbiz/injection/secure/api/MovieUnit.java
@@ -1,33 +1,33 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.superbiz.injection.secure.api;
-
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Metatype
-@Target({ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-
-@PersistenceContext(name = "movie-unit", unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
-public @interface MovieUnit {
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.injection.secure.api;
+
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target({ElementType.METHOD, ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+
+@PersistenceContext(name = "movie-unit", unitName = "movie-unit", type = PersistenceContextType.EXTENDED)
+public @interface MovieUnit {
+
+}