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:43:04 UTC
[29/33] tomee git commit: Align SNAPSHOT versions & reformat examples
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 {
+
+}