Weld SVN: r6706 - archetypes/javaee6-webapp/tags.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-17 15:48:20 -0400 (Sat, 17 Jul 2010)
New Revision: 6706
Removed:
archetypes/javaee6-webapp/tags/1.0.1.Beta1/
Log:
make way for retagging
14 years, 3 months
Weld SVN: r6705 - archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-17 15:24:44 -0400 (Sat, 17 Jul 2010)
New Revision: 6705
Modified:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java
Log:
whitespace and formatting; minor comments
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java 2010-07-17 19:20:39 UTC (rev 6704)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java 2010-07-17 19:24:44 UTC (rev 6705)
@@ -11,4 +11,7 @@
* NOTE As of JBoss AS 6.0.0.M3, JAX-RS does not activate properly.
*/
@ApplicationPath("/rest")
-public class JaxRsActivator extends Application{/* left blank intentionally */}
+public class JaxRsActivator extends Application
+{
+ /* class body intentionally left blank */
+}
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 19:20:39 UTC (rev 6704)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 19:24:44 UTC (rev 6705)
@@ -15,4 +15,7 @@
@Qualifier
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
-public @interface MemberRepository{/*left blank intentionally*/}
+public @interface MemberRepository
+{
+ /* class body intentionally left blank */
+}
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 19:20:39 UTC (rev 6704)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 19:24:44 UTC (rev 6705)
@@ -4,11 +4,13 @@
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
- * This class uses CDI to produce @MemberRepository EntityManagers.
+ * This class uses CDI to produce EntityManager instances qualified that are
+ * qualified as @MemberRepository. Therefore, to inject an instance, @Inject
+ * must be followed by @MemberRepository.
*/
public class MemberRepositoryProducer
{
- @SuppressWarnings("unused") //tell IDE to ignore warnings about em not being used.
+ @SuppressWarnings("unused") // tell IDE to ignore warnings about em not being used
@Produces
@MemberRepository
@PersistenceContext
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java 2010-07-17 19:20:39 UTC (rev 6704)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java 2010-07-17 19:24:44 UTC (rev 6705)
@@ -10,7 +10,7 @@
/**
* JAX-RS Example
*
- * This class produces a RESTful service to read the contents of the members table.
+ * This class produces a RESTful service to read the contents of the members table.
*/
@Path("/members")
@RequestScoped
@@ -24,7 +24,7 @@
@GET
public List<Member> listAllMembers()
{
- @SuppressWarnings("unchecked") //Force IDE to ignore warnings about "genericizing" the results of this query
+ @SuppressWarnings("unchecked") // Force IDE to ignore warnings about "genericizing" the results of this query
final List<Member> results = em.createQuery(ALL_MEMBERS).getResultList();
return results;
}
14 years, 3 months
Weld SVN: r6704 - archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-17 15:20:39 -0400 (Sat, 17 Jul 2010)
New Revision: 6704
Modified:
archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
Log:
whitespace
Modified: archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 18:24:54 UTC (rev 6703)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 19:20:39 UTC (rev 6704)
@@ -26,7 +26,7 @@
<!-- This section is optional. We are allowing index.jsf to handle the root URL (i.e., /). -->
<welcome-file-list>
- <!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
+ <!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
14 years, 3 months
Weld SVN: r6703 - archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:24:54 -0400 (Sat, 17 Jul 2010)
New Revision: 6703
Modified:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberListProducer.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
Log:
removed compiler warnings
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberListProducer.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberListProducer.java 2010-07-17 18:19:10 UTC (rev 6702)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberListProducer.java 2010-07-17 18:24:54 UTC (rev 6703)
@@ -25,18 +25,18 @@
@Produces
@Named
- public List<Member> getMembers()
+ public List<Member> listAllMembers()
{
return members;
}
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member)
{
- fetch();
+ retrieveAllMembersOrderedByName();
}
@PostConstruct
- public void fetch()
+ public void retrieveAllMembersOrderedByName()
{
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 18:19:10 UTC (rev 6702)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 18:24:54 UTC (rev 6703)
@@ -15,6 +15,4 @@
@Qualifier
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
-public @interface MemberRepository
-{
-}
+public @interface MemberRepository{/*left blank intentionally*/}
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 18:19:10 UTC (rev 6702)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 18:24:54 UTC (rev 6703)
@@ -8,6 +8,7 @@
*/
public class MemberRepositoryProducer
{
+ @SuppressWarnings("unused") //tell IDE to ignore warnings about em not being used.
@Produces
@MemberRepository
@PersistenceContext
14 years, 3 months
Weld SVN: r6702 - archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:19:10 -0400 (Sat, 17 Jul 2010)
New Revision: 6702
Added:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java
Removed:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsConfig.java
Log:
minor refactor, updated comments
Copied: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java (from rev 6701, archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsConfig.java)
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java (rev 0)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java 2010-07-17 18:19:10 UTC (rev 6702)
@@ -0,0 +1,14 @@
+package com.mycompany;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+/**
+ * This empty, annotated {@link Application} class is the Java EE 6 "no XML"
+ * approach to activate JAX-RS. Resources are served from the servlet path
+ * specified in the @ApplicationPath annotation.
+ *
+ * NOTE As of JBoss AS 6.0.0.M3, JAX-RS does not activate properly.
+ */
+@ApplicationPath("/rest")
+public class JaxRsActivator extends Application{/* left blank intentionally */}
Deleted: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsConfig.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsConfig.java 2010-07-17 18:05:40 UTC (rev 6701)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsConfig.java 2010-07-17 18:19:10 UTC (rev 6702)
@@ -1,7 +0,0 @@
-package com.mycompany;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-
-@ApplicationPath("/rest")
-public class JaxRsConfig extends Application {}
14 years, 3 months
Weld SVN: r6701 - archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:05:40 -0400 (Sat, 17 Jul 2010)
New Revision: 6701
Modified:
archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
Log:
Modified: archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 18:04:29 UTC (rev 6700)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 18:05:40 UTC (rev 6701)
@@ -26,7 +26,7 @@
<!-- This section is optional. We are allowing index.jsf to handle the root URL (i.e., /). -->
<welcome-file-list>
- <!-- Add additional welcome files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
+ <!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
14 years, 3 months
Weld SVN: r6700 - archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:04:29 -0400 (Sat, 17 Jul 2010)
New Revision: 6700
Modified:
archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
Log:
cleanup
Modified: archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 18:02:00 UTC (rev 6699)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-17 18:04:29 UTC (rev 6700)
@@ -26,8 +26,7 @@
<!-- This section is optional. We are allowing index.jsf to handle the root URL (i.e., /). -->
<welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>index.html</welcome-file>
+ <!-- Add additional welcome files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
14 years, 3 months
Weld SVN: r6699 - archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:02:00 -0400 (Sat, 17 Jul 2010)
New Revision: 6699
Modified:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java
Log:
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java 2010-07-17 18:00:14 UTC (rev 6698)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java 2010-07-17 18:02:00 UTC (rev 6699)
@@ -10,7 +10,7 @@
/**
* JAX-RS Example
*
- * This class alone produces a RESTful service to read the contents of the members table.
+ * This class produces a RESTful service to read the contents of the members table.
*/
@Path("/members")
@RequestScoped
14 years, 3 months
Weld SVN: r6698 - archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-17 14:00:14 -0400 (Sat, 17 Jul 2010)
New Revision: 6698
Added:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java
Removed:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResource.java
Modified:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
Log:
minor refactor, updated comments
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 17:01:36 UTC (rev 6697)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepository.java 2010-07-17 18:00:14 UTC (rev 6698)
@@ -8,9 +8,13 @@
import javax.inject.Qualifier;
/**
- * A qualifier used to differentiate between multiple data repositories
+ * A qualifier used to differentiate between multiple data repositories.
+ *
+ * If you only have 1 EntityManager, this annotation is optional
*/
@Qualifier
-(a)Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
-public @interface MemberRepository {}
+public @interface MemberRepository
+{
+}
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 17:01:36 UTC (rev 6697)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRepositoryProducer.java 2010-07-17 18:00:14 UTC (rev 6698)
@@ -3,7 +3,9 @@
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
+/**
+ * This class uses CDI to produce @MemberRepository EntityManagers.
+ */
public class MemberRepositoryProducer
{
@Produces
Deleted: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResource.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResource.java 2010-07-17 17:01:36 UTC (rev 6697)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResource.java 2010-07-17 18:00:14 UTC (rev 6698)
@@ -1,30 +0,0 @@
-package com.mycompany;
-
-import java.util.List;
-import javax.enterprise.context.RequestScoped;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-@Path("/members")
-@RequestScoped
-public class MemberResource
-{
- @Inject @MemberRepository
- private EntityManager em;
-
- @GET
- public List<Member> getMembers()
- {
- return em.createQuery("select m from Member m order by m.name").getResultList();
- }
-
- @GET
- @Path("/{id:[1-9][0-9]*}")
- public Member getMember(@PathParam("id") long id)
- {
- return em.find(Member.class, id);
- }
-}
Copied: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java (from rev 6697, archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResource.java)
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java (rev 0)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberResourceRESTService.java 2010-07-17 18:00:14 UTC (rev 6698)
@@ -0,0 +1,38 @@
+package com.mycompany;
+
+import java.util.List;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+/**
+ * JAX-RS Example
+ *
+ * This class alone produces a RESTful service to read the contents of the members table.
+ */
+@Path("/members")
+@RequestScoped
+public class MemberResourceRESTService
+{
+ private static final String ALL_MEMBERS = "select m from Member m order by m.name";
+ @Inject
+ @MemberRepository
+ private EntityManager em;
+
+ @GET
+ public List<Member> listAllMembers()
+ {
+ @SuppressWarnings("unchecked") //Force IDE to ignore warnings about "genericizing" the results of this query
+ final List<Member> results = em.createQuery(ALL_MEMBERS).getResultList();
+ return results;
+ }
+
+ @GET
+ @Path("/{id:[1-9][0-9]*}")
+ public Member lookupMemberById(@PathParam("id") long id)
+ {
+ return em.find(Member.class, id);
+ }
+}
14 years, 3 months
Weld SVN: r6697 - archetypes/javaee6-webapp/trunk/src/main/webapp/META-INF.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-17 13:01:36 -0400 (Sat, 17 Jul 2010)
New Revision: 6697
Modified:
archetypes/javaee6-webapp/trunk/src/main/webapp/META-INF/context.xml
Log:
period
Modified: archetypes/javaee6-webapp/trunk/src/main/webapp/META-INF/context.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/META-INF/context.xml 2010-07-17 17:00:56 UTC (rev 6696)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/META-INF/context.xml 2010-07-17 17:01:36 UTC (rev 6697)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This optional file is used by JBoss AS to get around an issue involving serialization of sessions between container restarts -->
-<!-- This file can be removed if you're using other containers, like Glassfish. -->
+<!-- This file can be removed if you're using other containers, like Glassfish -->
<Context>
<!-- disable storage of sessions across restarts by setting the pathname to an empty value -->
<Manager pathname=""/>
14 years, 3 months