[seam-commits] Seam SVN: r12517 - in modules/faces/trunk: docs/reference and 7 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Apr 16 17:09:03 EDT 2010


Author: lincolnthree
Date: 2010-04-16 17:09:02 -0400 (Fri, 16 Apr 2010)
New Revision: 12517

Added:
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/artifacts.xml
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/scopes.xml
Modified:
   modules/faces/trunk/docs/reference/
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/master.xml
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/preface.xml
   modules/faces/trunk/examples/short-ly/pom.xml
   modules/faces/trunk/impl/pom.xml
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/context/conversation/ConversationBoundaryInterceptor.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/Annotations.java
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/util/AnnotationsTest.java
   modules/faces/trunk/pom.xml
Log:
* Updated reference doc.
* Added strong warning to BeanManagerAware
* Updated POM to remove dependency on GlassFish repo (one more remains)
* Renamed Annotations utility methods


Property changes on: modules/faces/trunk/docs/reference
___________________________________________________________________
Name: svn:ignore
   + target
.settings
.classpath
.project


Added: modules/faces/trunk/docs/reference/src/main/docbook/en-US/artifacts.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/artifacts.xml	                        (rev 0)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/artifacts.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+<chapter id="artifacts">
+	<title>Faces Artifact Injection</title>
+	<para>
+		When creating CDI managed beans for use in the Web/UI layer, it is often necessary to access the FacesContext, NavigationHandler, and other
+		artifacts of the JSF environment. Seam Faces provides producers to allow injection of these artifacts in the proper scopes, enabling mock-testing
+		and other situations where the artifact may be difficult or tedious to resolve.
+	</para>
+	<para>
+		This is the full list of inject-able artifacts provided through Seam Faces.
+		<informaltable>
+			<tgroup cols="2">
+				<colspec colnum="1" colwidth="2*" />
+				<colspec colnum="2" colwidth="3*" />
+				<thead>
+					<row>
+						<entry>Artifact Class</entry>
+						<entry>Example</entry>
+					</row>
+				</thead>
+				<tbody>
+					<row>
+						<entry>javax.faces.context.FacesContext</entry>
+						<entry><programlisting>public class Bean {
+	@Inject FacesContext context;
+}</programlisting></entry>
+					</row>
+					<row>
+						<entry>javax.faces.application.NavigationHandler</entry>
+						<entry><programlisting>public class Bean {
+	@Inject NavigationHandler handler;
+}</programlisting></entry>
+					</row>
+				</tbody>
+			</tgroup>
+		</informaltable>
+	</para>
+</chapter>
\ No newline at end of file

Added: modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml	                        (rev 0)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+<chapter id="components">
+	<title>Faces View Components</title>
+	<para>
+		Mission statement for Faces Module components. Explain that they are functional, not UI-oriented.
+	</para>
+	<section id="viewaction">
+		<title>&lt;s:viewAction&gt;</title>
+		<para>
+			ViewAction doc
+			<programlisting><![CDATA[<s:viewAction> example]]></programlisting>
+			<tip>
+				<para>
+					Maybe a tip here?
+				</para>
+			</tip>
+		</para>
+	</section>
+</chapter>
\ No newline at end of file

Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -2,29 +2,15 @@
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
    "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
 <chapter id="events">
-	<title>JSF event propagation</title>
+	<title>Faces Events Propagation</title>
 	<para>
-		By including the seam-faces module in your web application you will also have the
-		JSF events propagated to the CDI event bridge so you can observe them in your beans.
-		The event bridge works by installing JSF listeners at appropriate extension points and 
-		firing events on the BeanManager with associated qualifiers, passing along the event object.
-		There are two categories of events, JSF phase events and JSF system events.
+		When the seam-faces module is installed in a web application, JSF events will automatically be propagated
+		via the CDI event-bridge, enabling managed beans to easily observe all Faces events.
 	</para>
-	
-	<section id="events.installation">
-		<title>Installation</title>
-		<para>
-			The event bridges are installed automatically by including the seam-faces.jar and seam-faces-api.jar
-			in the web application library folder. If you are using Maven as your build tool, you can add the
-			following dependency:
-		</para>
-		<programlisting role="XML"><![CDATA[
-			<dependency>
-				<groupId>org.jboss.seam</groupId>
-				<artifactId>seam-faces</artifactId>
-				<version>3.0.0-SNAPSHOT</version>
-			</dependency>]]></programlisting>		
-	</section>
+	<para>
+	There are two categories of events: JSF phase events, and JSF system events. Phase events are triggered
+	as JSF processes HTTP requests, while system events are raised at specific events during the JSF lifecycle.
+	</para>
 	<section id="events.phases">
 		<title>JSF phases events</title>
 		<para>
@@ -51,11 +37,10 @@
 			you would like to observe the full spectrum of events propagated you would write the following method in your
 			observer bean
 			<programlisting role="Java">
-				public void observeAll(@Observes PhaseEvent e)
-				{
-					// Do something with the event object
-				}
-			</programlisting>
+public void observeAll(@Observes PhaseEvent e)
+{
+	// Do something with the event object
+} </programlisting>
 		</para>
 		<para>
 			Since the example above flushes you with a lot of events you have to sort out yourself, you might want to 
@@ -65,35 +50,32 @@
 			<literal>@After</literal>. In order to split out the events into these categories, you would write two 
 			observer methods like
 			<programlisting role="Java">
-				public void observeBefore(@Observes @Before PhaseEvent e)
-				{
-					// Do something with the "before" event object
-				}
-				
-				public void observeAfter(@Observes @After PhaseEvent e)
-				{
-					// Do something with the "after" event object
-				}
-			</programlisting>
+public void observeBefore(@Observes @Before PhaseEvent e)
+{
+	// Do something with the "before" event object
+}
+
+public void observeAfter(@Observes @After PhaseEvent e)
+{
+	// Do something with the "after" event object
+} </programlisting>
 		</para>
 		<para>
 			If you are interested in both the "before" and "after" event of a particular phase, you can limit them
 			by adding a lifecycle qualifer that corresponds to the phase:
 			<programlisting role="Java">
-				public void observeRenderResponse(@Observes @RenderResponse PhaseEvent e)
-				{
-					// Do something with the "render response" event object
-				}
-			</programlisting>
+public void observeRenderResponse(@Observes @RenderResponse PhaseEvent e)
+{
+	// Do something with the "render response" event object
+} </programlisting>
 		</para>
 		<para>
 			By combining a temporal qualifier with a lifecycel one you can achieve the tightest qualification:
 			<programlisting role="Java">
-				public void observeBeforeRenderResponse(@Observes @Before @RenderResponse PhaseEvent e)
-				{
-					// Do something with the "before render response" event object
-				}
-			</programlisting>
+public void observeBeforeRenderResponse(@Observes @Before @RenderResponse PhaseEvent e)
+{
+	// Do something with the "before render response" event object
+} </programlisting>
 		</para>
 		<para>
 			This is the full list of temporal and lifecycle qualifers
@@ -266,18 +248,16 @@
 			view-centric component events <literal>PreRenderViewEvent</literal>, <literal>PostConstructViewMapEvent</literal> and  
 			<literal>PreDestroyViewMapEvent</literal> do not fire with the <literal>@Component</literal> qualifier.
 			<programlisting role="Java">
-				public void observePrePasswordValidation(@Observes @Component("form:password") PreValidateEvent e)
-				{
-					// Do something with the "before password is validated" event object
-				}
-			</programlisting>
+public void observePrePasswordValidation(@Observes @Component("form:password") PreValidateEvent e)
+{
+	// Do something with the "before password is validated" event object
+} </programlisting>
 			Global system events are observer without the component qualifier
 			<programlisting role="Java">
-				public void observeApplicationConstructed(@Observes PostConstructApplicationEvent e)
-				{
-					// Do something with the "after application is constructed" event object
-				}
-			</programlisting>
+public void observeApplicationConstructed(@Observes PostConstructApplicationEvent e)
+{
+	// Do something with the "after application is constructed" event object
+} </programlisting>
 			The name of the observing method is insignificant.
 		</para>
 	</section>

Added: modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml	                        (rev 0)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+<chapter id="installation">
+	<title>Installation</title>
+	<para>
+		Most features of Seam Faces are installed automatically by including the seam-faces.jar and seam-faces-api.jar
+		in the web application library folder. If you are using <ulink url="http://maven.apache.org/">Maven</ulink> as your build tool, you can add the
+		following dependency to your pom.xml file:
+	</para>
+	<programlisting role="XML"><![CDATA[<dependency>
+	<groupId>org.jboss.seam</groupId>
+	<artifactId>seam-faces</artifactId>
+	<version>${seam-faces-version}</version>
+</dependency>]]></programlisting>	
+	<tip>
+		<para>Replace ${seam-faces-version} with the most recent or appropriate version of Seam Faces.</para>			
+	</tip>
+	<section id="configuration">
+		<title>Configuration</title>
+		<para>
+			Some features of Seam Faces are not automatically configured, such as enhanced conversation support through annotations.
+			These features must be enabled in your web-application's WEB-INF/beans.xml file. There are two types of features: 
+			Interceptors and Decorators. The process described here will be similar for other Seam Modules as well.
+		</para>
+		<programlisting role="XML"><![CDATA[<beans>
+	<interceptors>
+	  <class>org.jboss.seam.faces.{package}.{Interceptor}</class>
+	</interceptors>
+	<decorators>
+	  <class>org.jboss.seam.faces.{package}.{Decorator}</class>
+	</decorators>
+</beans>]]></programlisting>	
+		<para>
+			Use the table below to configure 
+		</para>
+		<para>
+			<informaltable>
+				<tgroup cols="3">
+					<colspec colnum="1" colwidth="1*" />
+					<colspec colnum="2" colwidth="1*" />
+					<colspec colnum="3" colwidth="3*" />
+					<thead>
+						<row>
+							<entry>Feature</entry>
+							<entry>Type</entry>
+							<entry>Class</entry>
+						</row>
+					</thead>
+					<tbody>
+						<row>
+							<entry>Conversation Support</entry>
+							<entry>interceptor</entry>
+							<entry>org.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor</entry>
+						</row>
+					</tbody>
+				</tgroup>
+			</informaltable>
+		</para>
+	</section>
+</chapter>
\ No newline at end of file

Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/master.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/master.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/master.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -8,7 +8,11 @@
    <toc />
 
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml" />
+   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="installation.xml" />
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="events.xml" />
+   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="scopes.xml" />
+   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="artifacts.xml" />
+   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="components.xml" />
 
    <!--
    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapterXX.xml" />

Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/preface.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/preface.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/preface.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -2,8 +2,11 @@
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
    "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
 <preface>
-   <title>Preface: lorem ipsum</title>
+   <title>Introduction</title>
    <para>
+   The goal of Seam Faces is to provide a fully integrated CDI programming model to the JavaServer Faces (JSF) 2.0
+   web-framework. With features such as observing Events, providing injection support for life-cycle artifacts
+   (FacesContext, NavigationHandler,) and more. 
    </para>
 
 <!--

Added: modules/faces/trunk/docs/reference/src/main/docbook/en-US/scopes.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/scopes.xml	                        (rev 0)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/scopes.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+<chapter id="scopes">
+	<title>Faces Scoping Support</title>
+	<para>
+		JSF 2.0 introduced the concept of the @ViewScope, and the @FlashScope; however, CDI does not support the non-standard
+		ViewScope by default, and JSF 2.0 did not provide annotations for accessing the FlashScope. The Seam Faces module
+		does both.
+	</para>
+	<section id="viewscoped">
+		<title>@ViewScope</title>
+		<para>
+			To scope a bean to the View, use the <literal>@javax.faces.bean.ViewScoped</literal> annotation. This means that your bean will be stored in the 
+			<literal>javax.faces.component.UIViewRoot</literal> object associated with the view in which it was accessed. Each JSF view (faces-page) will store
+			its own instance of the bean, just like each HttpServletRequest has its own instance of a @RequestScoped bean.
+			<programlisting>@ViewScoped
+public class Bean {
+	// ...
+}</programlisting>
+			<caution>
+				<para>
+					@ViewScoped beans are destroyed when the JSF UIViewRoot object is destroyed. This means that the
+					life-span of @ViewScoped beans is dependent on the <literal>javax.faces.STATE_SAVING_METHOD</literal> employed by the application itself.
+				</para>
+			</caution>
+		</para>
+	</section>
+	<section id="flashscoped">
+		<title>@FlashScope</title>
+		<para>
+			To scope a bean to the Flash, use the <literal>@javax.faces.bean.FlashScoped</literal> annotation. This means that your bean will be stored in the 
+			<literal>javax.faces.context.Flash</literal>; however, the Flash is independent of the JSF view, and independent of the Request object. Objects stored in the
+			Flash will survive one page request, then be destroyed after processing of the next subsequent request. As such, the Flash scope
+			can be thought of as a scope that spans two requests; objects are added to the Flash during the first request, then removed from
+			the Flash and destroyed after the second request.
+			<programlisting>@FlashScoped
+public class Bean {
+	// ...
+}</programlisting>
+			<caution>
+				<para>
+					@FlashScoped beans are destroyed when the Flash is cleared. This means that the
+					life-span of @FlashScoped beans is limited to two HTTP requests.
+				</para>
+			</caution>
+		</para>
+	</section>
+</chapter>
\ No newline at end of file

Modified: modules/faces/trunk/examples/short-ly/pom.xml
===================================================================
--- modules/faces/trunk/examples/short-ly/pom.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/examples/short-ly/pom.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -3,11 +3,11 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>org.jboss.seam.faces</groupId>
-	<artifactId>faces-examples-short-ly</artifactId>
+	<artifactId>seam-faces-examples-short-ly</artifactId>
 
 	<packaging>war</packaging>
 	<version>0.0.1-SNAPSHOT</version>
-	<name>bit.ly clone with Seam &amp; PrettyFaces</name>
+	<name>Seam Faces Example bit.ly clone with PrettyFaces</name>
 
 	<url>http://seamframework.org</url>
 
@@ -17,10 +17,15 @@
 			<name>Repository hosting the jee6 artifacts</name>
 			<url>http://download.java.net/maven/2</url>
 		</repository>
+		<repository>
+			<id>JBoss.ORG</id>
+			<name>JBoss Maven Repository</name>
+			<url>http://repository.jboss.org/maven2/</url>
+		</repository>
 	</repositories>
 
 	<properties>
-		<hibernate.version>3.5.0-Final</hibernate.version>
+		<hibernate.version>3.5.1-Final</hibernate.version>
 	</properties>
 
 	<dependencies>
@@ -126,7 +131,7 @@
 				</configuration>
 			</plugin>
 		</plugins>
-		<finalName>tiny.url</finalName>
+		<finalName>short.ly</finalName>
 	</build>
 
 </project>

Modified: modules/faces/trunk/impl/pom.xml
===================================================================
--- modules/faces/trunk/impl/pom.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/impl/pom.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -33,17 +33,14 @@
 
 	<dependencies>
 		<dependency>
-			<!-- Required until the Servlet 3.0 API can be resolved in Central -->
-			<groupId>org.glassfish</groupId>
-			<artifactId>javax.servlet</artifactId>
-			<version>3.0</version>
-			<scope>compile</scope>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
 		</dependency>	
 		<dependency>
 			<artifactId>seam-faces-api</artifactId>
 			<groupId>org.jboss.seam.faces</groupId>
 			<version>${project.version}</version>
-			<scope>compile</scope>
+			<scope>compile</scope> 
 		</dependency>
 	</dependencies>
 

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/BeanManagerAware.java	2010-04-16 21:09:02 UTC (rev 12517)
@@ -25,10 +25,18 @@
 import java.util.List;
 
 import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
 import javax.inject.Inject;
 
 /**
- * Super-class for listeners that need a reference to the BeanManager
+ * Super-class for non-CDI-native components that need a reference to the
+ * {@link BeanManager}
+ * <p>
+ * <b>**WARNING**</b> This class is <b>NEVER</b> safe to use outside of specific
+ * seam-faces implementation classes, and should be <b>avoided at all costs</b>.
+ * If you need a handle to the {@link BeanManager} you should probably register
+ * an {@link Extension} instead of using this class; have you tried using @
+ * {@link Inject}?
  * 
  * @author Nicklas Karlsson
  */

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/context/conversation/ConversationBoundaryInterceptor.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/context/conversation/ConversationBoundaryInterceptor.java	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/context/conversation/ConversationBoundaryInterceptor.java	2010-04-16 21:09:02 UTC (rev 12517)
@@ -60,14 +60,14 @@
 
       try
       {
-         if (Annotations.has(ctx.getMethod(), Begin.class))
+         if (Annotations.isAnnotationPresent(ctx.getMethod(), Begin.class))
          {
             beginConversation(ctx);
          }
 
          result = ctx.proceed();
 
-         if (Annotations.has(ctx.getMethod(), End.class))
+         if (Annotations.isAnnotationPresent(ctx.getMethod(), End.class))
          {
             endConversation(ctx);
          }
@@ -84,7 +84,7 @@
 
    private void handleExceptionBegin(final InvocationContext ctx, final Exception e)
    {
-      if (Annotations.has(ctx.getMethod(), Begin.class))
+      if (Annotations.isAnnotationPresent(ctx.getMethod(), Begin.class))
       {
          List<? extends Class<? extends Exception>> typesPermittedByBegin = getPermittedExceptionTypesBegin(ctx.getMethod());
          for (Class<? extends Exception> type : typesPermittedByBegin)
@@ -101,7 +101,7 @@
 
    private void handleExceptionEnd(final InvocationContext ctx, final Exception e)
    {
-      if (Annotations.has(ctx.getMethod(), End.class))
+      if (Annotations.isAnnotationPresent(ctx.getMethod(), End.class))
       {
          List<? extends Class<? extends Exception>> typesPermittedByEnd = getPermittedExceptionTypesEnd(ctx.getMethod());
          boolean permitted = false;
@@ -122,7 +122,7 @@
 
    private void beginConversation(final InvocationContext ctx) throws Exception
    {
-      String cid = Annotations.get(ctx.getMethod(), Begin.class).id();
+      String cid = Annotations.getAnnotation(ctx.getMethod(), Begin.class).id();
       if ((cid != null) && !"".equals(cid))
       {
          conversation.begin(cid);
@@ -132,7 +132,7 @@
          conversation.begin();
       }
 
-      long timeout = Annotations.get(ctx.getMethod(), Begin.class).timeout();
+      long timeout = Annotations.getAnnotation(ctx.getMethod(), Begin.class).timeout();
       if (timeout != -1)
       {
          conversation.setTimeout(timeout);
@@ -149,11 +149,11 @@
 
    private List<? extends Class<? extends Exception>> getPermittedExceptionTypesBegin(final Method m)
    {
-      return Arrays.asList(Annotations.get(m, Begin.class).permit());
+      return Arrays.asList(Annotations.getAnnotation(m, Begin.class).permit());
    }
 
    private List<? extends Class<? extends Exception>> getPermittedExceptionTypesEnd(final Method m)
    {
-      return Arrays.asList(Annotations.get(m, End.class).permit());
+      return Arrays.asList(Annotations.getAnnotation(m, End.class).permit());
    }
 }

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/Annotations.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/Annotations.java	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/Annotations.java	2010-04-16 21:09:02 UTC (rev 12517)
@@ -48,7 +48,7 @@
     *         the declaring class of the method. Returns false if the annotation
     *         is not present.
     */
-   public static boolean has(final Method m, final Class<? extends Annotation> type)
+   public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> type)
    {
       boolean result = false;
       if (m.isAnnotationPresent(type))
@@ -68,7 +68,7 @@
 
       if (result == false)
       {
-         result = has(m.getDeclaringClass(), type);
+         result = isAnnotationPresent(m.getDeclaringClass(), type);
       }
       return result;
    }
@@ -83,7 +83,7 @@
     * @return True if annotation is present either on class, false if the
     *         annotation is not present.
     */
-   public static boolean has(final Class<?> c, final Class<? extends Annotation> type)
+   public static boolean isAnnotationPresent(final Class<?> c, final Class<? extends Annotation> type)
    {
       boolean result = false;
       if (c.isAnnotationPresent(type))
@@ -113,7 +113,7 @@
     * @return The annotation instance found on this method or enclosing class,
     *         or null if no matching annotation was found.
     */
-   public static <A extends Annotation> A get(final Method m, final Class<A> type)
+   public static <A extends Annotation> A getAnnotation(final Method m, final Class<A> type)
    {
       A result = m.getAnnotation(type);
       if (result == null)
@@ -128,7 +128,7 @@
       }
       if (result == null)
       {
-         result = get(m.getDeclaringClass(), type);
+         result = getAnnotation(m.getDeclaringClass(), type);
       }
       return result;
    }
@@ -143,7 +143,7 @@
     * @return The annotation instance found on this class, or null if no
     *         matching annotation was found.
     */
-   public static <A extends Annotation> A get(final Class<?> c, final Class<A> type)
+   public static <A extends Annotation> A getAnnotation(final Class<?> c, final Class<A> type)
    {
       A result = c.getAnnotation(type);
       if (result == null)

Modified: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/util/AnnotationsTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/util/AnnotationsTest.java	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/util/AnnotationsTest.java	2010-04-16 21:09:02 UTC (rev 12517)
@@ -42,8 +42,8 @@
    {
       Method begin = AnnotationTestObject.class.getMethod("begin", new Class[] {});
 
-      assertTrue(Annotations.has(begin, Begin.class));
-      assertFalse(Annotations.has(begin, End.class));
+      assertTrue(Annotations.isAnnotationPresent(begin, Begin.class));
+      assertFalse(Annotations.isAnnotationPresent(begin, End.class));
    }
 
    @Test
@@ -51,7 +51,7 @@
    {
       Method end = AnnotationTestObject.class.getMethod("end", new Class[] {});
 
-      assertTrue(Annotations.has(end, End.class));
+      assertTrue(Annotations.isAnnotationPresent(end, End.class));
    }
 
    @Test
@@ -60,14 +60,14 @@
       Method begin = AnnotationTestObject.class.getMethod("begin", new Class[] {});
       Method end = AnnotationTestObject.class.getMethod("end", new Class[] {});
 
-      assertTrue(Annotations.has(begin, Begin.class));
-      assertTrue(Annotations.has(end, Begin.class));
+      assertTrue(Annotations.isAnnotationPresent(begin, Begin.class));
+      assertTrue(Annotations.isAnnotationPresent(end, Begin.class));
    }
 
    public void testGetAnnotationOnMethodDirectly() throws Exception
    {
       Method end = AnnotationTestObject.class.getMethod("end", new Class[] {});
-      End anno = Annotations.get(end, End.class);
+      End anno = Annotations.getAnnotation(end, End.class);
 
       assertTrue(anno instanceof End);
    }
@@ -75,7 +75,7 @@
    public void testGetAnnotationOnMethodIndirectlyFromClass() throws Exception
    {
       Method end = AnnotationTestObject.class.getMethod("begin", new Class[] {});
-      Begin anno = Annotations.get(end, Begin.class);
+      Begin anno = Annotations.getAnnotation(end, Begin.class);
 
       assertTrue(anno instanceof Begin);
    }

Modified: modules/faces/trunk/pom.xml
===================================================================
--- modules/faces/trunk/pom.xml	2010-04-16 18:20:53 UTC (rev 12516)
+++ modules/faces/trunk/pom.xml	2010-04-16 21:09:02 UTC (rev 12517)
@@ -24,8 +24,8 @@
 	<modules>
 		<module>api</module>
 		<module>impl</module>
-		<!-- <module>docs</module>
-		<module>examples</module> -->
+		<module>docs/reference</module>
+		<module>examples/short-ly</module>
 	</modules>
 	
 	<repositories>
@@ -156,8 +156,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>2.0.2</version>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.5</source>
+                    <target>1.5</target>
                 </configuration>
             </plugin>
         </plugins>



More information about the seam-commits mailing list