Seam SVN: r8741 - /.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-19 19:07:52 -0400 (Tue, 19 Aug 2008)
New Revision: 8741
Added:
enterprise-doc/
Log:
15 years, 8 months
Seam SVN: r8740 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-19 18:09:38 -0400 (Tue, 19 Aug 2008)
New Revision: 8740
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
Log:
WS
Modified: trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-08-19 21:36:11 UTC (rev 8739)
+++ trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-08-19 22:09:38 UTC (rev 8740)
@@ -2,199 +2,194 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<chapter id="cache">
- <title>Caching</title>
-
- <para>
- In almost all enterprise applications, the database is the primary
- bottleneck, and the least scalable tier of the runtime environment.
- People from a PHP/Ruby environment will try to tell you that so-called
- "shared nothing" architectures scale well. While that may be literally
- true, I don't know of many interesting multi-user applications which
- can be implemented with no sharing of resources between different
- nodes of the cluster. What these silly people are really thinking of
- is a "share nothing except for the database" architecture. Of course,
- sharing the database is the primary problem with scaling a multi-user
- application—so the claim that this architecture is highly scalable
- is absurd, and tells you a lot about the kind of applications that these
- folks spend most of their time working on.
- </para>
-
- <para>
- Almost anything we can possibly do to share the database <emphasis>less
- often</emphasis> is worth doing.
- </para>
-
- <para>
- This calls for a cache. Well, not just one cache. A well designed Seam
- application will feature a rich, multi-layered caching strategy that
- impacts every layer of the application:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- The database, of course, has its own cache. This is
- super-important, but can't scale like a cache in the
- application tier.
- </para>
- </listitem>
- <listitem>
- <para>
- Your ORM solution (Hibernate, or some other JPA implementation)
- has a second-level cache of data from the database. This is
- a very powerful capability, but is often misused. In a clustered
- environment, keeping the data in the cache transactionally
- consistent across the whole cluster, and with the database,
- is quite expensive. It makes most sense for data which is shared
- between many users, and is updated rarely. In traditional
- stateless architectures, people often try to use the second-level
- cache for conversational state. This is always bad, and is
- especially wrong in Seam.
- </para>
- </listitem>
- <listitem>
- <para>
- The Seam conversation context is a cache of conversational state.
- Components you put into the conversation context can hold and cache
- state relating to the current user interaction.
- </para>
- </listitem>
- <listitem>
- <para>
- In particular, the
- Seam-managed persistence context (or an extended EJB container-managed
- persistence context associated with a conversation-scoped stateful
- session bean) acts as a cache of data that has been read in the
- current conversation. This cache tends to have a pretty high
- hitrate! Seam optimizes the replication of Seam-managed persistence
- contexts in a clustered environment, and there is no requirement for
- transactional consistency with the database (optimistic locking is
- sufficient) so you don't need to worry too much about the performance
- implications of this cache, unless you read thousands of objects into
- a single persistence context.
- </para>
- </listitem>
- <listitem>
- <para>
- The application can cache non-transactional state in the Seam
- application context. State kept in the application context is
- of course not visible to other nodes in the cluster.
- </para>
- </listitem>
- <listitem>
- <para>
- The application can cache transactional state using the Seam
- <literal>pojoCache</literal> component, which integrates
- JBossCache into the Seam environment. This state will be visible
- to other nodes if you run JBoss cache in a clustered mode.
- </para>
- </listitem>
- <listitem>
- <para>
- Finally, Seam lets you cache rendered fragments of a JSF page. Unlike
- the ORM second-level cache, this cache is not automatically invalidated
- when data changes, so you need to write application code to perform
- explicit invalidation, or set appropriate expiration policies.
- </para>
- </listitem>
- </itemizedlist>
-
- <para>
- For more information about the second-level cache, you'll need to refer to
- the documentation of your ORM solution, since this is an extremely complex
- topic. In this section we'll discuss the use of JBossCache directly, via
- the <literal>pojoCache</literal> component, or as the page fragment cache,
- via the <literal><s:cache></literal> control.
- </para>
-
- <section>
- <title>Using JBossCache in Seam</title>
-
- <para>
- The built-in <literal>pojoCache</literal> component manages an instance
- of <literal>org.jboss.cache.aop.PojoCache</literal>. You can safely put
- any immutable Java object in the cache, and it will be replicated across
- the cluster (assuming that replication is enabled). If you want to
- keep mutable objects in the cache, you'll need to run the JBossCache
- bytecode preprocessor to ensure that changes to the objects will be
- automatically detected and replicated.
- </para>
-
- <para>
- To use <literal>pojoCache</literal>, all you need to do is put the
- JBossCache jars in the classpath, and provide a resource named
- <literal>treecache.xml</literal> with an appropriate cache configuration.
- JBossCache has many scary and confusing configuration settings, so
- we won't discuss them here. Please refer to the JBossCache documentation
- for more information.
- </para>
-
- <para>
- You can find a sample <literal>treecache.xml</literal> in
- <literal>examples/blog/resources/treecache.xml</literal>.
- </para>
-
-
- <para>
- For an EAR depoyment of Seam, we recommend that the JBossCache jars and
- configuration go directly into the EAR. Make sure you place both
- <literal>jboss-cache.jar</literal> and <literal>jgroups.jar</literal>
- in your EAR's lib folder.
- </para>
-
- <para>
- Now you can inject the cache into any Seam component:
- </para>
-
- <programlisting role="JAVA"><![CDATA[@Name("chatroom")
+ <title>Caching</title>
+
+ <para>
+ In almost all enterprise applications, the database is the primary
+ bottleneck, and the least scalable tier of the runtime environment. People
+ from a PHP/Ruby environment will try to tell you that so-called "shared
+ nothing" architectures scale well. While that may be literally true, I
+ don't know of many interesting multi-user applications which can be
+ implemented with no sharing of resources between different nodes of the
+ cluster. What these silly people are really thinking of is a "share
+ nothing except for the database" architecture. Of course, sharing the
+ database is the primary problem with scaling a multi-user
+ application—so the claim that this architecture is highly scalable
+ is absurd, and tells you a lot about the kind of applications that these
+ folks spend most of their time working on.
+ </para>
+
+ <para>
+ Almost anything we can possibly do to share the database
+ <emphasis>less often</emphasis> is worth doing.
+ </para>
+
+ <para>
+ This calls for a cache. Well, not just one cache. A well designed Seam
+ application will feature a rich, multi-layered caching strategy that
+ impacts every layer of the application:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ The database, of course, has its own cache. This is super-important,
+ but can't scale like a cache in the application tier.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Your ORM solution (Hibernate, or some other JPA implementation) has
+ a second-level cache of data from the database. This is a very
+ powerful capability, but is often misused. In a clustered
+ environment, keeping the data in the cache transactionally
+ consistent across the whole cluster, and with the database, is quite
+ expensive. It makes most sense for data which is shared between many
+ users, and is updated rarely. In traditional stateless
+ architectures, people often try to use the second-level cache for
+ conversational state. This is always bad, and is especially wrong in
+ Seam.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The Seam conversation context is a cache of conversational state.
+ Components you put into the conversation context can hold and cache
+ state relating to the current user interaction.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In particular, the Seam-managed persistence context (or an extended
+ EJB container-managed persistence context associated with a
+ conversation-scoped stateful session bean) acts as a cache of data
+ that has been read in the current conversation. This cache tends to
+ have a pretty high hitrate! Seam optimizes the replication of
+ Seam-managed persistence contexts in a clustered environment, and
+ there is no requirement for transactional consistency with the
+ database (optimistic locking is sufficient) so you don't need to
+ worry too much about the performance implications of this cache,
+ unless you read thousands of objects into a single persistence
+ context.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The application can cache non-transactional state in the Seam
+ application context. State kept in the application context is of
+ course not visible to other nodes in the cluster.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The application can cache transactional state using the Seam
+ <literal>pojoCache</literal> component, which integrates JBossCache
+ into the Seam environment. This state will be visible to other nodes
+ if you run JBoss cache in a clustered mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Finally, Seam lets you cache rendered fragments of a JSF page.
+ Unlike the ORM second-level cache, this cache is not automatically
+ invalidated when data changes, so you need to write application code
+ to perform explicit invalidation, or set appropriate expiration
+ policies.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ For more information about the second-level cache, you'll need to refer to
+ the documentation of your ORM solution, since this is an extremely complex
+ topic. In this section we'll discuss the use of JBossCache directly, via
+ the <literal>pojoCache</literal> component, or as the page fragment cache,
+ via the <literal><s:cache></literal> control.
+ </para>
+
+ <section>
+ <title>Using JBossCache in Seam</title>
+
+ <para>
+ The built-in <literal>pojoCache</literal> component manages an instance
+ of <literal>org.jboss.cache.aop.PojoCache</literal>. You can safely put
+ any immutable Java object in the cache, and it will be replicated
+ across the cluster (assuming that replication is enabled). If you want
+ to keep mutable objects in the cache, you'll need to run the JBossCache
+ bytecode preprocessor to ensure that changes to the objects will be
+ automatically detected and replicated.
+ </para>
+
+ <para>
+ To use <literal>pojoCache</literal>, all you need to do is put the
+ JBossCache jars in the classpath, and provide a resource named
+ <literal>treecache.xml</literal> with an appropriate cache
+ configuration. JBossCache has many scary and confusing configuration
+ settings, so we won't discuss them here. Please refer to the JBossCache
+ documentation for more information.
+ </para>
+
+ <para>
+ You can find a sample <literal>treecache.xml</literal> in
+ <literal>examples/blog/resources/treecache.xml</literal>.
+ </para>
+
+
+ <para>
+ For an EAR depoyment of Seam, we recommend that the JBossCache jars and
+ configuration go directly into the EAR. Make sure you place both
+ <literal>jboss-cache.jar</literal> and <literal>jgroups.jar</literal>
+ in your EAR's lib folder.
+ </para>
+
+ <para>Now you can inject the cache into any Seam component:</para>
+
+ <programlisting role="JAVA"><![CDATA[@Name("chatroom")
public class Chatroom {
- @In PojoCache pojoCache;
+ @In PojoCache pojoCache;
- public void join(String username) {
- try
- {
+ public void join(String username) {
+ try {
Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
- if (userList==null)
- {
+ if (userList==null) {
userList = new HashSet<String>();
pojoCache.put("chatroom", "userList", userList);
}
userList.put(username);
- }
- catch (CacheException ce)
- {
+ } catch (CacheException ce) {
throw new RuntimeException(ce);
}
- }
+ }
}]]></programlisting>
- <para>
- If you want to have multiple JBossCache configurations in your application,
- use <literal>components.xml</literal>:
- </para>
-
- <programlisting role="JAVA"><![CDATA[<core:pojo-cache name="myCache" cfg-resource-name="myown/cache.xml"/>]]></programlisting>
-
- </section>
-
- <section>
- <title>Page fragment caching</title>
-
- <para>
- The most interesting user of JBossCache is the <literal><s:cache></literal>
- tag, Seam's solution to the problem of page fragment caching in JSF.
- <literal><s:cache></literal> uses <literal>pojoCache</literal> internally,
- so you need to follow the steps listed above before you can use it. (Put the jars
- in the EAR, wade through the scary configuration options, etc.)
- </para>
-
- <para>
- <literal><s:cache></literal> is used for caching some rendered content which
- changes rarely. For example, the welcome page of our blog displays the recent
- blog entries:
- </para>
-
- <programlisting role="XHTML"><![CDATA[<s:cache key="recentEntries-#{blog.id}" region="welcomePageFragments">
+ <para>
+ If you want to have multiple JBossCache configurations in your
+ application, use <literal>components.xml</literal>:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[<core:pojo-cache name="myCache" cfg-resource-name="myown/cache.xml"/>]]></programlisting>
+
+ </section>
+
+ <section>
+ <title>Page fragment caching</title>
+
+ <para>
+ The most interesting user of JBossCache is the
+ <literal><s:cache></literal> tag, Seam's solution to the problem
+ of page fragment caching in JSF. <literal><s:cache></literal>
+ uses <literal>pojoCache</literal> internally, so you need to follow the
+ steps listed above before you can use it. (Put the jars in the EAR,
+ wade through the scary configuration options, etc.)
+ </para>
+
+ <para>
+ <literal><s:cache></literal> is used for caching some rendered
+ content which changes rarely. For example, the welcome page of our blog
+ displays the recent blog entries:
+ </para>
+
+ <programlisting role="XHTML"><![CDATA[<s:cache key="recentEntries-#{blog.id}" region="welcomePageFragments">
<h:dataTable value="#{blog.recentEntries}" var="blogEntry">
<h:column>
<h3>#{blogEntry.title}</h3>
@@ -205,31 +200,34 @@
</h:dataTable>
</s:cache>]]></programlisting>
- <para>
- The <literal>key</literal> let's you have multiple cached versions of each page
- fragment. In this case, there is one cached version per blog. The
- <literal>region</literal> determines the JBossCache node that all version will
- be stored in. Different nodes may have different expiry policies. (That's the
- stuff you set up using the aforementioned scary configuration options.)
- </para>
-
- <para>
- Of course, the big problem with <literal><s:cache></literal> is that it
- is too stupid to know when the underlying data changes (for example, when the
- blogger posts a new entry). So you need to evict the cached fragment manually:
- </para>
-
- <programlisting role="JAVA"><![CDATA[public void post() {
+ <para>
+ The <literal>key</literal> let's you have multiple cached versions of
+ each page fragment. In this case, there is one cached version per blog.
+ The <literal>region</literal> determines the JBossCache node that all
+ version will be stored in. Different nodes may have different expiry
+ policies. (That's the stuff you set up using the aforementioned scary
+ configuration options.)
+ </para>
+
+ <para>
+ Of course, the big problem with <literal><s:cache></literal> is
+ that it is too stupid to know when the underlying data changes (for
+ example, when the blogger posts a new entry). So you need to evict the
+ cached fragment manually:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[public void post() {
...
entityManager.persist(blogEntry);
pojoCache.remove("welcomePageFragments", "recentEntries-" + blog.getId() );
}]]></programlisting>
-
- <para>
- Alternatively, if it is not critical that changes are immediately visible to the
- user, you could set a short expiry time on the JbossCache node.
- </para>
-
- </section>
-
+
+ <para>
+ Alternatively, if it is not critical that changes are immediately
+ visible to the user, you could set a short expiry time on the
+ JbossCache node.
+ </para>
+
+ </section>
+
</chapter>
\ No newline at end of file
15 years, 8 months
Seam SVN: r8739 - branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-19 17:36:11 -0400 (Tue, 19 Aug 2008)
New Revision: 8739
Modified:
branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
Log:
minor
Modified: branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
--- branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-08-19 20:20:09 UTC (rev 8738)
+++ branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-08-19 21:36:11 UTC (rev 8739)
@@ -153,8 +153,8 @@
<para>
Seam 2 will automatically install RichFaces' Ajax4JSF if it present
- in your project so you should, if it is present, remove the Ajax4JSF
- filter:
+ in your project so you should make sure the Ajax4JSF filter isn't
+ declared:
</para>
<programlisting role="XML"><![CDATA[<!--Remove for Seam 2-->
@@ -252,9 +252,9 @@
</para>
<para>
- For testing, you the jars in Seam's <literal>lib/test</literal>, the
- jars in Seam's <literal>lib/</literal> directory, your test classes
- and application classes together with the
+ For testing, you need the jars in Seam's <literal>lib/test</literal>,
+ the jars in Seam's <literal>lib/</literal> directory, your test
+ classes and application classes together with the
<literal>bootstrap/</literal> directory in your classpath.
<literal>SeamTest</literal> will automatically start the container.
</para>
15 years, 8 months
Seam SVN: r8738 - branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-19 16:20:09 -0400 (Tue, 19 Aug 2008)
New Revision: 8738
Added:
branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
Modified:
branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/master.xml
Log:
JBSEAM-1092
Added: branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
===================================================================
--- branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml (rev 0)
+++ branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-08-19 20:20:09 UTC (rev 8738)
@@ -0,0 +1,1275 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+]>
+
+<chapter id="migration">
+ <title>Migrating from Seam 1.2 to Seam 2</title>
+
+ <para>
+ There are two approaches to migrating your Seam 1.2 application to Seam 2.
+ The recommended approach, described in <xref linkend="migrating.skeleton"/>
+ is to create a new project using seam-gen in Seam 2, and migrate your code
+ across. We recognize that many projects may have extensive customizations
+ to their project, so we also provide instructions for how to upgrade your
+ project in-situ in <xref linkend="migrating.insitu" /> Due to the number
+ of changes introduced between Seam 1.2 and Seam 2, this may not always be
+ a straightforward process!
+ </para>
+
+ <para>
+ However you decide to migrate your application, you'll need to alter your
+ code, as many components have moved. <xref linkend="migrating.general"/>
+ details these changes.
+ </para>
+
+ <tip>
+ <para>
+ Don't forget to update the XSD's in <literal>pages.xml</literal> and
+ <literal>components.xml</literal> to point at the ones for Seam 2.
+ Just change the suffix from <literal>-1.2.xml</literal> to
+ <literal>-2.0.xml</literal>.
+ </para>
+ </tip>
+
+ <section id="migrating.skeleton">
+ <title>Creating a new project skeleton using seam-gen</title>
+
+ <para>
+ Start by creating a new skeleton seam project. In your Seam 2
+ directory run:
+ </para>
+
+ <programlisting>~/seam_2_0$ ./seam setup</programlisting>
+
+ <para>
+ Customize the defaults as needed. You'll want to set the location of
+ JBoss EAP, name your project and select an EAR or WAR as needed; you
+ can accept the defaults for Java package names (as we aren't going to
+ use the reverse engineering features of seam-gen); you'll want to set
+ your JDBC driver, URL, username and password correctly, and configure
+ Hibernate to drop and recreate tables if so desired.
+ </para>
+
+ <para>
+ Now, we are ready to import your existing code and views into the new
+ structure. The simplest way to do this is to import both projects
+ into your favorite IDE, and copy your code and views across.
+ </para>
+
+ </section>
+
+ <section id="migrating.insitu">
+ <title>In situ migration</title>
+
+ <para>
+ This requires more work, but is suitable for more complex projects. The
+ steps below may not be an exhaustive list, so if you have to any extra
+ steps please report them through the Customer Support Portal.
+ </para>
+
+ <section>
+ <title>Migrating to JSF 1.2</title>
+
+ <warning>
+ <para>
+ You only need to do this if you are migrating from the comunity
+ edition of Seam, JBoss EAP 4.2 and 4.3 shipped a version of Seam
+ 1.2 which used JSF 1.2.
+ </para>
+ </warning>
+
+ <para>
+ Seam 2.0 requires JSF 1.2, and JBoss EAP supports Sun's JSF RI. To
+ switch to JSF 1.2, you need to remove the MyFaces listener:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<!--Remove for Seam 2-->
+<!--<listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+</listener>-->]]></programlisting>
+
+ <para>
+ from your <literal>web.xml</literal>.
+ </para>
+
+ <para>The JSF RI doesn't require you to specify a listener.</para>
+
+ <tip>
+ <para>
+ Due to an incompatibility between Seam and MyFaces, you had to
+ use client side state saving in Seam 1.2. Switching to the JSF RI
+ 1.2 lifts this restriction.
+ </para>
+ </tip>
+
+ </section>
+
+ <section>
+ <title>Migrating <literal>web.xml</literal> and <literal>faces-config.xml</literal> to Seam 2</title>
+
+ <para>
+ In your Seam 1.2 app you may have specified some Seam specific
+ configuration in <literal>web.xml</literal>. In Seam 2, you need
+ specify a listener (as you did in Seam 1.2):
+ </para>
+
+ <programlisting role="XML"><![CDATA[<listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+</listener>]]></programlisting>
+
+ <para>
+ the Seam master filter (note the package of the class changed):
+ </para>
+
+ <programlisting role="XML"><![CDATA[<filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+</filter>
+
+<filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+</filter-mapping>]]></programlisting>
+
+ <para>
+ If any other Seam Filters (for example the
+ <literal>SeamExceptionFilter</literal>) are enumerated, they should
+ be removed.
+ </para>
+
+ <para>
+ Finally, you should have the Seam resouce servlet (as in Seam 1.2):
+ </para>
+
+ <programlisting role="XML"><![CDATA[<servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+</servlet>
+
+<servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+</servlet-mapping>]]></programlisting>
+
+ <para>
+ Seam 2 will automatically install RichFaces' Ajax4JSF if it present
+ in your project so you should, if it is present, remove the Ajax4JSF
+ filter:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<!--Remove for Seam 2-->
+<!--<filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+</filter>-->
+
+<!--Remove for Seam 2-->
+<!--<filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <url-pattern>*.seam</url-pattern>
+</filter-mapping>-->]]></programlisting>
+
+
+ <para>
+ If you are using Facelets, then you'll need to check that the
+ default <literal>FaceletViewHandler</literal> is in use. Seam 1.2
+ required you to use a special Facelet's
+ <literal>ViewHandler</literal> to install it's EL enhancement whilst
+ the EL enhancement in Seam 2 is built in. Also, the version of
+ Ajax4JSF distributed with Seam 1.2 required you to specify which
+ <literal>ViewHandler</literal> to use when it was in use. Make sure
+ that the Ajax4JSF configuration is removed from your
+ <literal>web.xml:</literal>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<!--Remove for Seam 2-->
+<!--<context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
+</context-param>-->]]></programlisting>
+
+ <para>
+ And that <literal>FaceletViewHandler</literal> is set in
+ <literal>faces-config.xml</literal>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+</application>]]></programlisting>
+
+ <para>
+ Seam 1.2 required you to specify either the
+ <literal>SeamPhaseListener</literal> (Seam Managed Transaction were
+ are disabled) or <literal>SeamTransactionalPhaseListener</literal>
+ (Seam Managed Transactions are enabled) in
+ <literal>faces-config.xml</literal>. Seam 2 lets you enable or
+ disable Seam Managed Transactions in
+ <literal>components.xml</literal>, and installs the phase listener
+ for you. Therefore, you should remove any reference to
+ <literal>SeamPhaseListener</literal> or
+ <literal>SeamTransactionalPhaseListener</literal> from
+ <literal>faces-config.xml</literal>.
+ </para>
+
+ <para>
+ To disable Seam Managed Transactions, set
+ <literal>transaction-management-enabled</literal> to false:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<core:init transaction-management-enabled="false"/>]]></programlisting>
+
+ <para>
+ To workaround a bug, you may have specified
+ <literal>SeamELResolver</literal> in
+ <literal>faces-config.xml</literal>. This is no longer required.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Deployment structure changes</title>
+
+ <para>
+ You should place all the dependencies which you previously declared
+ as modules in <literal>application.xml</literal> in the
+ <literal>lib/</literal> directory of your EAR
+ <emphasis>except</emphasis> <literal>jboss-seam.jar</literal> which
+ should be declared as an ejb module in
+ <literal>application.xml</literal>.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Migration to JBoss Embedded</title>
+
+ <para>
+ Support for deployment to JBoss Embeddable EJB3 and JBoss
+ Microcontainer has been removed. Instead, the new JBoss Embedded
+ distribution gives you a full set of EE-compatible APIs with
+ simplified deployment.
+ </para>
+
+ <para>
+ For testing, you the jars in Seam's <literal>lib/test</literal>, the
+ jars in Seam's <literal>lib/</literal> directory, your test classes
+ and application classes together with the
+ <literal>bootstrap/</literal> directory in your classpath.
+ <literal>SeamTest</literal> will automatically start the container.
+ </para>
+
+ <tip>
+ <para>
+ You must order the classpath correctly when using Embedded with
+ <literal>SeamTest</literal>. Make sure the jars in
+ <literal>lib/test</literal> come first in any classpath order.
+ For example, when using Ant, they should be declared above any
+ other libraries in the test classpath.
+ </para>
+ </tip>
+
+ <para>
+ If you want to run tests using the Eclipse TestNG plugin, you'll
+ need to add these jars to the top of your TestNG classpath. Using
+ the Run Dialog, select the xml suite to run, and add
+ <literal>/lib/test/jboss-embedded-all.jar</literal>,
+ <literal>/lib/test/hibernate-all.jar</literal>,
+ <literal>/lib/test/thirdparty-all.jar</literal>,
+ <literal>/lib/jboss-embedded-api.jar</literal>,
+ <literal>/lib/jboss-deployers-client-spi.jar</literal>,
+ <literal>/lib/jboss-deployers-core-spi.jar</literal>, and
+ <literal>/bootstrap</literal> as the first entries in the
+ <emphasis>User classpath</emphasis>.
+ </para>
+
+ <para>
+ Note that JBoss Embedded is able to bootstrap a datasource from a
+ <literal>-ds.xml</literal> file, so there is no longer a need for
+ <literal>jboss-beans.xml</literal>.
+ </para>
+
+ </section>
+
+ </section>
+
+ <section id="migrating.general">
+ <title>Component changes</title>
+
+ <section>
+ <title>Built-in Component changes</title>
+
+ <para>
+ Seam's built-in components have undergone a major reorganization
+ designed to organize them for easier learning, and to isolate
+ dependencies upon particular technologies like JSF into specific
+ packages.
+ </para>
+
+ <para>
+ You'll need to update both your <literal>components.xml</literal>
+ and any references in Java code.
+ </para>
+
+ <para>
+ In general:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Persistence-related components are located in
+ <literal>org.jboss.seam.persistence</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ jBPM related components are located in
+ <literal>org.jboss.seam.bpm</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JSF-related components are located in
+ <literal>org.jboss.seam.faces</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Servlet-related components are located in
+ <literal>org.jboss.seam.web</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Components related to asynchronicity are located in
+ <literal>org.jboss.seam.async</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ i18n-related components are located in
+ <literal>org.jboss.seam.international</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The Pageflow component are located in
+ <literal>org.jboss.seam.pageflow</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The Pages component are located in
+ <literal>org.jboss.seam.navigation</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ The following table presents a non-exhaustive list of
+ changed components:
+ </para>
+
+ <table>
+ <title>Component's in Seam 2</title>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="2*" />
+ <colspec colnum="2" colwidth="2*" />
+ <colspec colnum="3" colwidth="2*" />
+ <colspec colnum="4" colwidth="2*" />
+ <colspec colnum="5" colwidth="2*" />
+ <colspec colnum="6" colwidth="2*" />
+
+ <thead>
+ <row>
+ <entry>
+ <para>Component name</para>
+ </entry>
+ <entry>
+ <para>Seam 1.2 Old class</para>
+ </entry>
+ <entry>
+ <para>Seam 2 class</para>
+ </entry>
+ <entry>
+ <para>XML Element</para>
+ </entry>
+ <entry>
+ <para>XML namespace</para>
+ </entry>
+ <entry>
+ <para>XSD</para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para><literal>actor</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Actor</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.Actor</literal></para>
+ </entry>
+ <entry>
+ <para><literal><bpm:actor /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/bpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/bpm-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>businessProcess</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.BusinessProcess</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.BusinessProcess</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>dispatcher</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Dispatcher</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.async.Dispatcher</literal> (now an interface)</para>
+ </entry>
+ <entry>
+ <para><literal><async:timer-service-dispatcher /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/async</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/async-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Specified by user</para>
+ </entry>
+ <entry>
+ <para><literal>javax.persistence.EntityManagerFactory</literal></para>
+ </entry>
+ <entry>
+ <para><literal>javax.persistence.EntityManagerFactory</literal></para>
+ </entry>
+ <entry>
+ <para><literal><persistence:entity-manager-factory /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>exceptions</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Exceptions</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.exception.Exceptions</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>facesMessages</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.FacesMessages</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.FacesMessages</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>facesPage</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.FacesPage</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.FacesPage</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>Specified by user</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Filter</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.persistence.Filter</literal></para>
+ </entry>
+ <entry>
+ <para><literal><persistence:filter /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Specified by user</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.HibernateSessionFactory</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.persistence.HibernateSessionFactory</literal></para>
+ </entry>
+ <entry>
+ <para><literal><persistence:hibernate-session-factory /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>httpError</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.HttpError</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.HttpError</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>image</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Image</literal></para>
+ </entry>
+ <entry>
+ <para>removed</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>isUserInRole</literal></para>
+ </entry>
+ <entry>
+ <para><literal>Map<String, Boolean></literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.IsUserInRole</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>jbpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Jbpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.Jbpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>bpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/bpm</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/bpm-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.LocalDispatcher</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.async.LocalDispatcher</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>localeSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.LocaleSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.international.LocaleSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal><international:locale-selector /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/international</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/international-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.LocalTransactionListener</literal></para>
+ </entry>
+ <entry>
+ <para>removed</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Specified by user</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.ManagedHibernateSession</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.persistence.ManagedHibernateSession</literal></para>
+ </entry>
+ <entry>
+ <para><literal><persistence:managed-hibernate-session /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>jbpmContext</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.ManagedJbpmContext</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.ManagedJbpmContext</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Specified by user</para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.ManagedEntityManager</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.persistence.ManagedEntityManager</literal></para>
+ </entry>
+ <entry>
+ <para><literal><persistence:managed-entity-manager /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/persistence-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>microcontainer</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Microcontainer</literal></para>
+ </entry>
+ <entry>
+ <para>removed</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>pageflow</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Pageflow</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.Pageflow</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>pages</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Pages</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.navigation.Pages</literal></para>
+ </entry>
+ <entry>
+ <para><literal><navigation:pages/></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/navigation</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/navigation-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>persistenceContexts</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.PersistenceContexts</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.persistence.PersistenceContexts</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>pooledTask</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.PooledTask</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.PooledTask</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>processInstanceFinder</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.ProcessInstanceFinder</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.ProcessInstanceFinder</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>redirect</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Redirect</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.Redirect</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>switcher</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Switcher</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.faces.Switcher</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>timeZoneSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.TimeZoneSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.international.TimeZoneSelector</literal></para>
+ </entry>
+ <entry>
+ <para><literal><international:time-zone-selector /></literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/international</literal></para>
+ </entry>
+ <entry>
+ <para><literal>http://jboss.com/products/seam/international-2.0.xsd</literal></para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para><literal>transition</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.core.Transistion</literal></para>
+ </entry>
+ <entry>
+ <para><literal>org.jboss.seam.bpm.Transition</literal></para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ <entry>
+ <para>N/A</para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </section>
+
+ <section>
+ <title>Annotation changes in Seam 2</title>
+
+ <para>
+ Annotations have also moved to reflect their purpose. In
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ BPM-related annotations are located in
+ <literal>org.jboss.seam.annotations.bpm</literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@BeginTask</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@CreateProcess</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@EndTask</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@ResumeProcess</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@StartTask</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Transition</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ JSF-related annotations are located in
+ <literal>org.jboss.seam.annotations.faces</literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@Converter</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Validator</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ Interceptor annotations are located in
+ <literal>org.jboss.seam.annotations.intercept</literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@AroundInvoke</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@BypassIntercetors</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Interceptor</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Interceptors</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ Annotations related to asynchronicity are located in
+ <literal>org.jboss.seam.annotations.async</literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@Asynchronous</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Duration</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Expiration</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@FinalExpiration</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@IntervalCron</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@IntervalDuration</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ @RequestParameter is located in
+ <literal>org.jboss.seam.annotations.web</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ @WebRemote are located in
+ <literal>org.jboss.seam.annotations.remoting</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ @Restrict are located in
+ <literal>org.jboss.seam.annotations.security</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Exception handling annotations moved to
+ <literal>org.jboss.seam.annotations.exception</literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@HttpError</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>@Redirect</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>
+ You also need to replace <literal>@Intercept(NEVER)</literal>
+ with <literal>@BypassInterceptors</literal>.
+ </para>
+ </note>
+
+
+ </section>
+
+ <section>
+ <title>Other changes needed to <literal>components.xml</literal></title>
+
+ <para>
+ The <literal>conversation-is-long-running-parameter</literal>
+ attribute has been removed from Seam (and doesn't have a
+ replacement), remove it from <literal><core:init /></literal>.
+ </para>
+
+ <para>
+ As described in <xref linkend="migration.embedded"/>, Embeddable EJB3
+ and Microcontainer support has been removed, so you need to remove
+ <literal><core:ejb/></literal> and
+ <literal><core:microcontainer/></literal> from
+ <literal>components.xml</literal>.
+ </para>
+
+ <para>
+ The EE transaction integration has been redesigned, so the
+ transaction listener component name has changed. Replace
+ <literal><core:transaction-listener/></literal> with
+ <literal><transaction:ejb-transaction/></literal>.
+ </para>
+
+ <para>
+ The resouce bundle loader has been split out of the resouce bundle,
+ so you should replace
+ <literal><core:resource-bundle/></literal> with
+ <literal><core:resource-loader/></literal>.
+ </para>
+
+ <para>
+ Finally, you should change any <literal>expression</literal>
+ attributes to <literal>execute</literal>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<event type="org.jboss.seam.notLoggedIn">
+ <action execute="#{redirect.captureCurrentView}"/>
+</event>]]></programlisting>
+
+ </section>
+
+ <section>
+ <title>Migration to jBPM 3.2</title>
+
+ <para>
+ If you are using jBPM for business processes,
+ you need to add the tx service to <literal>jbpm.cfg.xml</literal>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />]]></programlisting>
+
+ <tip>
+ <para>
+ You don't need to do this if you are just using jBPM for
+ pageflows.
+ </para>
+ </tip>
+
+ </section>
+
+ <section>
+ <title>Migration to RichFaces 3.1</title>
+
+ <para>
+ If you are using RichFaces or Ajax4jsf, a major reorganization of
+ the project has occurred. <literal>ajax4jsf.jar</literal> and
+ <literal>richfaces.jar</literal> have been replaced by
+ <literal>richfaces-api.jar</literal> (which should go in your ear
+ <literal>lib/</literal> directory),
+ <literal>richfaces-impl.jar</literal> and
+ <literal>richfaces-ui.jar</literal> (both of which go in
+ <literal>WEB-INF/lib</literal>).
+ </para>
+
+ <para>
+ You should check the RichFaces documentation for more information on
+ parameter name changes and namespace changes.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Changes to Seam UI</title>
+
+ <para>
+ As most JSF component sets provide a date selector, the Seam date
+ selector (<literal>s:selectDate</literal> has been deprecated. You
+ should replace it with the date selector from the component set you
+ use.
+ </para>
+
+ <para>
+ <literal><s:decorate/></literal> has become a naming container.
+ Therefore client ids have changed from
+ <literal>fooForm:fooInput</literal> to
+ <literal>fooForm:foo:fooInput</literal> (assuming your
+ <literal><s:decorate></literal> has foo as an id).
+ </para>
+
+ </section>
+ </section>
+
+</chapter>
Property changes on: branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/master.xml
===================================================================
--- branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/master.xml 2008-08-19 15:03:37 UTC (rev 8737)
+++ branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/master.xml 2008-08-19 20:20:09 UTC (rev 8738)
@@ -7,6 +7,7 @@
<xi:include href="Tutorial.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href= "Gettingstarted.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href= "Getting_Started_With_JBoss_Tools.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href= "Migration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href= "Concepts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href= "Xml.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href= "Events.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
15 years, 8 months
Seam SVN: r8737 - trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-08-19 11:03:37 -0400 (Tue, 19 Aug 2008)
New Revision: 8737
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
Log:
JBSEAM-3283
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2008-08-19 15:03:27 UTC (rev 8736)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2008-08-19 15:03:37 UTC (rev 8737)
@@ -420,6 +420,10 @@
}
Graphics2D graphics2D = image.createGraphics();
graphics2D.setBackground(new Color(255, 255, 255));
+ if (Type.IMAGE_PNG.equals(getContentType()))
+ {
+ graphics2D.setComposite(java.awt.AlphaComposite.Src);
+ }
graphics2D.clearRect(0, 0, image.getWidth(), image.getHeight());
graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
15 years, 8 months
Seam SVN: r8736 - branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/graphicImage.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-08-19 11:03:27 -0400 (Tue, 19 Aug 2008)
New Revision: 8736
Modified:
branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
Log:
JBSEAM-3283
Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2008-08-19 11:39:08 UTC (rev 8735)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/Image.java 2008-08-19 15:03:27 UTC (rev 8736)
@@ -420,6 +420,10 @@
}
Graphics2D graphics2D = image.createGraphics();
graphics2D.setBackground(new Color(255, 255, 255));
+ if (Type.IMAGE_PNG.equals(getContentType()))
+ {
+ graphics2D.setComposite(java.awt.AlphaComposite.Src);
+ }
graphics2D.clearRect(0, 0, image.getWidth(), image.getHeight());
graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
15 years, 8 months
Seam SVN: r8735 - branches/Seam_2_0_FP/examples/spring/view.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-19 07:39:08 -0400 (Tue, 19 Aug 2008)
New Revision: 8735
Modified:
branches/Seam_2_0_FP/examples/spring/view/book.xhtml
Log:
JBPAPP-1087 backport of JBSEAM-3229
Modified: branches/Seam_2_0_FP/examples/spring/view/book.xhtml
===================================================================
--- branches/Seam_2_0_FP/examples/spring/view/book.xhtml 2008-08-19 11:33:45 UTC (rev 8734)
+++ branches/Seam_2_0_FP/examples/spring/view/book.xhtml 2008-08-19 11:39:08 UTC (rev 8735)
@@ -66,7 +66,9 @@
<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
<div class="input">
<s:decorate>
+ <rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
<br/>
+ <s:message/>
</s:decorate>
</div>
</div>
15 years, 8 months
Seam SVN: r8734 - trunk/examples/spring/view.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-19 07:33:45 -0400 (Tue, 19 Aug 2008)
New Revision: 8734
Modified:
trunk/examples/spring/view/book.xhtml
Log:
JBSEAM-3229
Modified: trunk/examples/spring/view/book.xhtml
===================================================================
--- trunk/examples/spring/view/book.xhtml 2008-08-18 21:38:07 UTC (rev 8733)
+++ trunk/examples/spring/view/book.xhtml 2008-08-19 11:33:45 UTC (rev 8734)
@@ -66,7 +66,9 @@
<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
<div class="input">
<s:decorate>
+ <rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
<br/>
+ <s:message/>
</s:decorate>
</div>
</div>
15 years, 8 months
Seam SVN: r8733 - trunk/src/main/org/jboss/seam/navigation.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-18 17:38:07 -0400 (Mon, 18 Aug 2008)
New Revision: 8733
Modified:
trunk/src/main/org/jboss/seam/navigation/Pages.java
Log:
Merge page scanning into main scanner
Modified: trunk/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-08-18 21:37:45 UTC (rev 8732)
+++ trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-08-18 21:38:07 UTC (rev 8733)
@@ -26,7 +26,6 @@
import javax.faces.convert.ConverterException;
import javax.faces.model.DataModel;
import javax.faces.validator.ValidatorException;
-import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.dom4j.DocumentException;
@@ -41,7 +40,6 @@
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Init;
@@ -50,8 +48,7 @@
import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.core.Expressions.MethodExpression;
import org.jboss.seam.core.Expressions.ValueExpression;
-import org.jboss.seam.deployment.DeploymentStrategy;
-import org.jboss.seam.deployment.URLScanner;
+import org.jboss.seam.deployment.DotPageDotXmlDeploymentHandler;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.faces.Validation;
import org.jboss.seam.international.StatusMessage;
@@ -89,6 +86,9 @@
private Map<String, List<Page>> pageStacksByViewId;
private Map<String, ConversationIdParameter> conversations;
+ private Set<String> dotPageDotXmlFileNames;
+ private Set<String> hotDotPageDotXmlFileNames;
+
private String[] resources = { "/WEB-INF/pages.xml" };
private SortedSet<String> wildcardViewIds = new TreeSet<String>(
@@ -104,6 +104,17 @@
);
@Create
+ public void create()
+ {
+ dotPageDotXmlFileNames = new HashSet<String>();
+ hotDotPageDotXmlFileNames = new HashSet<String>();
+ if (DotPageDotXmlDeploymentHandler.instance() != null)
+ {
+ dotPageDotXmlFileNames = DotPageDotXmlDeploymentHandler.instance().getFiles();
+ }
+ initialize();
+ }
+
public void initialize()
{
pagesByViewId = Collections.synchronizedMap(new HashMap<String, Page>());
@@ -120,22 +131,34 @@
}
}
- PagesDeploymentStrategy pagesDeployer = new PagesDeploymentStrategy();
- pagesDeployer.scan();
+ parsePages(hotDotPageDotXmlFileNames, dotPageDotXmlFileNames);
- for (String fileName: pagesDeployer.scannedFiles()) {
- String viewId = "/" + fileName.substring(0,fileName.length()-".page.xml".length()) + ".xhtml"; // needs more here
-
- InputStream stream = ResourceLoader.instance().getResourceAsStream(fileName);
- if (stream==null) {
- log.info("no pages.xml file found: " + fileName);
- } else {
- log.debug("reading pages.xml file: " + fileName);
- parse(stream,viewId);
- }
- }
}
+ private void parsePages(Set<String> ...fileNames)
+ {
+ Set<String> mergedFileNames = new HashSet<String>();
+ for (Set<String> f : fileNames)
+ {
+ mergedFileNames.addAll(f);
+ }
+ for (String fileName: mergedFileNames)
+ {
+ String viewId = "/" + fileName.substring(0,fileName.length()-".page.xml".length()) + ".xhtml"; // needs more here
+
+ InputStream stream = ResourceLoader.instance().getResourceAsStream(fileName);
+ if (stream==null)
+ {
+ log.info("no pages.xml file found: " + fileName);
+ }
+ else
+ {
+ log.debug("reading pages.xml file: " + fileName);
+ parse(stream,viewId);
+ }
+ }
+ }
+
/**
* Run any navigation rule defined in pages.xml
*
@@ -191,30 +214,13 @@
}
/**
- * Create a new Page object for a JSF view id,
- * by searching for a viewId.page.xml file.
+ * Create a new default Page object for a JSF view id
*/
private Page createPage(String viewId)
{
- String resourceName = replaceExtension(viewId, ".page.xml");
- InputStream stream = null;
-
- if (resourceName!=null) {
- stream = ResourceLoader.instance().getResourceAsStream(resourceName.substring(1));
-
- if (stream == null) {
- stream = ResourceLoader.instance().getResourceAsStream(resourceName);
- }
- }
-
- if (stream==null) {
- Page result = new Page(viewId);
- pagesByViewId.put(viewId, result);
- return result;
- } else {
- parse(stream, viewId);
- return getCachedPage(viewId);
- }
+ Page result = new Page(viewId);
+ pagesByViewId.put(viewId, result);
+ return result;
}
private Page getCachedPage(String viewId)
@@ -1653,66 +1659,14 @@
return pagesByViewId.keySet();
}
- public class PagesScanner
- extends URLScanner
+ public Set<String> getHotDotPageDotXmlFileNames()
{
-
- public PagesScanner(DeploymentStrategy strategy) {
- super(strategy);
- }
-
- public void scanForPages(ServletContext context) {
- if (context!=null) {
- String path = context.getRealPath("/");
- if (path != null) {
- HashSet<String> paths = new HashSet<String>();
- paths.add(context.getRealPath("/"));
- handle(paths);
- }
- }
- }
+ return hotDotPageDotXmlFileNames;
}
- public class PagesDeploymentStrategy
- extends DeploymentStrategy
+ public void setHotDotPageDotXmlFileNames(Set<String> hotDotPageDotXmlFileNames)
{
- PagesScanner scanner;
-
- List<String> files;
-
- public PagesDeploymentStrategy() {
- scanner = new PagesScanner(this);
- files = new ArrayList<String>();
- }
-
- public List<String> scannedFiles() {
- return files;
- }
-
- @Override
- public void handle(String name) {
- if (name.endsWith(".page.xml")) {
- files.add(name);
- }
- }
-
- @Override
- public ClassLoader getClassLoader() {
- return null;
- }
-
- @Override
- protected String getDeploymentHandlersKey() {
- return null;
- }
-
-
- @Override
- public void scan()
- {
- scanner.scanForPages(ServletLifecycle.getServletContext());
- }
-
-
+ this.hotDotPageDotXmlFileNames = hotDotPageDotXmlFileNames;
}
+
}
15 years, 8 months
Seam SVN: r8732 - in trunk/src/main/org/jboss/seam: init and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-18 17:37:45 -0400 (Mon, 18 Aug 2008)
New Revision: 8732
Added:
trunk/src/main/org/jboss/seam/deployment/DotPageDotXmlDeploymentHandler.java
Modified:
trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java
trunk/src/main/org/jboss/seam/deployment/StandardDeploymentStrategy.java
trunk/src/main/org/jboss/seam/init/Initialization.java
trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
Merge page scanning into main scanner
Modified: trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-08-18 20:58:19 UTC (rev 8731)
+++ trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -2,6 +2,7 @@
import static org.jboss.seam.util.Strings.split;
+import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -30,6 +31,8 @@
private Scanner scanner;
+ private List<File> files = new ArrayList<File>();
+
private Map<String, DeploymentHandler> deploymentHandlers;
/**
@@ -282,5 +285,15 @@
}
return null;
}
+
+ public List<File> getFiles()
+ {
+ return files;
+ }
+ public void setFiles(List<File> files)
+ {
+ this.files = files;
+ }
+
}
Added: trunk/src/main/org/jboss/seam/deployment/DotPageDotXmlDeploymentHandler.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/DotPageDotXmlDeploymentHandler.java (rev 0)
+++ trunk/src/main/org/jboss/seam/deployment/DotPageDotXmlDeploymentHandler.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -0,0 +1,95 @@
+package org.jboss.seam.deployment;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.seam.contexts.Contexts;
+
+/**
+ * The {@link DotPageDotXmlDeploymentHandler} process .page.xml files
+ *
+ * @author Pete Muir
+ *
+ */
+public class DotPageDotXmlDeploymentHandler extends AbstractDeploymentHandler
+{
+ /**
+ * Name under which this {@link DeploymentHandler} is registered
+ */
+ public static final String NAME = "org.jboss.seam.deployment.DotPageDotXmlDeploymentHandler";
+
+ private Set<String> files;
+
+ public DotPageDotXmlDeploymentHandler()
+ {
+ files = new HashSet<String>();
+ }
+
+ /**
+ * Get annotated Seam components
+ */
+ public Set<String> getFiles()
+ {
+ return Collections.unmodifiableSet(files);
+ }
+
+ /**
+ * @see DeploymentHandler#handle(String, ClassLoader)
+ */
+ public void handle(String name, ClassLoader classLoader)
+ {
+ if (name.endsWith(".page.xml"))
+ {
+ files.add(name);
+ }
+ }
+
+ public String getName()
+ {
+ return NAME;
+ }
+
+ public static DotPageDotXmlDeploymentHandler instance()
+ {
+ if (Contexts.isEventContextActive())
+ {
+ if (Contexts.getEventContext().isSet(HotDeploymentStrategy.NAME))
+ {
+ DeploymentStrategy deploymentStrategy = (DeploymentStrategy) Contexts.getEventContext().get(StandardDeploymentStrategy.NAME);
+ Object deploymentHandler = deploymentStrategy.getDeploymentHandlers().get(NAME);
+ if (deploymentHandler != null)
+ {
+ return (DotPageDotXmlDeploymentHandler) deploymentHandler;
+ }
+ }
+ return null;
+ }
+ else
+ {
+ throw new IllegalStateException("Event context not active");
+ }
+ }
+
+ public static DotPageDotXmlDeploymentHandler hotInstance()
+ {
+ if (Contexts.isEventContextActive())
+ {
+ DeploymentStrategy deploymentStrategy = (DeploymentStrategy) Contexts.getEventContext().get(HotDeploymentStrategy.NAME);
+ if (deploymentStrategy != null)
+ {
+ Object deploymentHandler = deploymentStrategy.getDeploymentHandlers().get(NAME);
+ if (deploymentHandler != null)
+ {
+ return (DotPageDotXmlDeploymentHandler) deploymentHandler;
+ }
+ }
+ return null;
+ }
+ else
+ {
+ throw new IllegalStateException("Event context not active");
+ }
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/deployment/DotPageDotXmlDeploymentHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java 2008-08-18 20:58:19 UTC (rev 8731)
+++ trunk/src/main/org/jboss/seam/deployment/HotDeploymentStrategy.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -48,8 +48,6 @@
private ClassLoader hotDeployClassLoader;
- private File[] hotDeploymentPaths;
-
private ComponentDeploymentHandler componentDeploymentHandler;
private AnnotationDeploymentHandler annotationDeploymentHandler;
@@ -65,6 +63,7 @@
getDeploymentHandlers().put(ComponentDeploymentHandler.NAME, componentDeploymentHandler);
annotationDeploymentHandler = new AnnotationDeploymentHandler(getPropertyValues(AnnotationDeploymentHandler.ANNOTATIONS_KEY), classLoader);
getDeploymentHandlers().put(AnnotationDeploymentHandler.NAME, annotationDeploymentHandler);
+ getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME, new DotPageDotXmlDeploymentHandler());
}
private void initHotDeployClassLoader(ClassLoader classLoader, File hotDeployDirectory)
@@ -76,7 +75,7 @@
URL url = hotDeployDirectory.toURL();
URL[] urls = { url };
hotDeployClassLoader = new URLClassLoader(urls, classLoader);
- hotDeploymentPaths = new File[] { hotDeployDirectory };
+ getFiles().add(hotDeployDirectory);
}
}
@@ -97,7 +96,7 @@
*/
public File[] getHotDeploymentPaths()
{
- return hotDeploymentPaths;
+ return getFiles().toArray(new File[0]);
}
/**
@@ -153,7 +152,7 @@
@Override
public void scan()
{
- getScanner().scanDirectories(getHotDeploymentPaths());
+ getScanner().scanDirectories(getFiles().toArray(new File[0]));
}
Modified: trunk/src/main/org/jboss/seam/deployment/StandardDeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/StandardDeploymentStrategy.java 2008-08-18 20:58:19 UTC (rev 8731)
+++ trunk/src/main/org/jboss/seam/deployment/StandardDeploymentStrategy.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -1,5 +1,6 @@
package org.jboss.seam.deployment;
+import java.io.File;
import java.util.Map;
import java.util.Set;
@@ -55,6 +56,7 @@
getDeploymentHandlers().put(NamespaceDeploymentHandler.NAME, namespaceDeploymentHandler);
annotationDeploymentHandler = new AnnotationDeploymentHandler(getPropertyValues(AnnotationDeploymentHandler.ANNOTATIONS_KEY), classLoader);
getDeploymentHandlers().put(AnnotationDeploymentHandler.NAME, annotationDeploymentHandler);
+ getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME, new DotPageDotXmlDeploymentHandler());
}
@Override
@@ -102,6 +104,7 @@
public void scan()
{
getScanner().scanResources(RESOURCE_NAMES);
+ getScanner().scanDirectories(getFiles().toArray(new File[0]));
}
public static StandardDeploymentStrategy instance()
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-08-18 20:58:19 UTC (rev 8731)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -43,10 +43,12 @@
import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Init;
import org.jboss.seam.core.PojoCache;
+import org.jboss.seam.deployment.DotPageDotXmlDeploymentHandler;
import org.jboss.seam.deployment.HotDeploymentStrategy;
import org.jboss.seam.deployment.StandardDeploymentStrategy;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
+import org.jboss.seam.navigation.Pages;
import org.jboss.seam.util.Conversions;
import org.jboss.seam.util.Naming;
import org.jboss.seam.util.Reflections;
@@ -81,6 +83,9 @@
private StandardDeploymentStrategy standardDeploymentStrategy;
private HotDeploymentStrategy hotDeploymentStrategy;
+ private File warRootDirectory;
+ private File hotDeployDirectory;
+
private Set<String> nonPropertyAttributes = new HashSet<String>();
{
@@ -98,11 +103,14 @@
public Initialization(ServletContext servletContext)
{
this.servletContext = servletContext;
+ this.warRootDirectory = getRealFile(servletContext, "/");
+ this.hotDeployDirectory = getRealFile(servletContext, HotDeploymentStrategy.DEFAULT_HOT_DEPLOYMENT_DIRECTORY_PATH);
}
public Initialization create()
{
standardDeploymentStrategy = new StandardDeploymentStrategy(Thread.currentThread().getContextClassLoader());
+ standardDeploymentStrategy.getFiles().add(warRootDirectory);
standardDeploymentStrategy.scan();
addNamespaces();
initComponentsFromXmlDocument("/WEB-INF/components.xml");
@@ -597,7 +605,7 @@
}
ServletLifecycle.beginInitialization();
Contexts.getApplicationContext().set(Component.PROPERTIES, properties);
- scanForHotDeployableComponents();
+ createHotDeployment(Thread.currentThread().getContextClassLoader());
scanForComponents();
addComponent( new ComponentDescriptor(Init.class), Contexts.getApplicationContext());
Init init = (Init) Component.getInstance(Init.class, ScopeType.APPLICATION);
@@ -653,7 +661,11 @@
Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
}
//TODO open the ability to reuse the classloader by looking at the components class classloaders
- scanForHotDeployableComponents();
+ // Rescan
+ hotDeploymentStrategy.scan();
+ // And install
+ installHotDeployableComponents();
+ Pages.instance().setHotDotPageDotXmlFileNames(DotPageDotXmlDeploymentHandler.hotInstance().getFiles());
init.setTimestamp( System.currentTimeMillis() );
init.setHotDeployPaths(hotDeploymentStrategy.getHotDeploymentPaths());
installComponents(init);
@@ -662,22 +674,16 @@
return this;
}
- private void scanForHotDeployableComponents()
+ private void installHotDeployableComponents()
{
- createHotDeploymentStrategy(Thread.currentThread().getContextClassLoader());
- if (hotDeploymentStrategy != null)
+ for (Class<Object> scannedClass: hotDeploymentStrategy.getScannedComponentClasses() )
{
- hotDeploymentStrategy.scan();
- for (Class<Object> scannedClass: hotDeploymentStrategy.getScannedComponentClasses() )
- {
- installScannedComponentAndRoles(scannedClass);
- }
+ installScannedComponentAndRoles(scannedClass);
}
}
- private void createHotDeploymentStrategy(ClassLoader classLoader)
+ private void createHotDeployment(ClassLoader classLoader)
{
- File hotDeployDirectory = getHotDeployDirectory(servletContext);
if ( isDebugEnabled() && hotDeployDirectory != null )
{
if (isGroovyPresent())
@@ -690,22 +696,28 @@
log.debug("Using Java hot deploy");
hotDeploymentStrategy = new HotDeploymentStrategy(classLoader, hotDeployDirectory);
}
+ hotDeploymentStrategy.scan();
+ installHotDeployableComponents();
+
+ // Add the WAR root to the hot deploy path to pick up .page.xml
+ // We don't add it for the initial scan as StandardDeploymentStrategy deals with that
+ hotDeploymentStrategy.getFiles().add(warRootDirectory);
}
}
- private static File getHotDeployDirectory(ServletContext servletContext)
+ private static File getRealFile(ServletContext servletContext, String path)
{
- String path = servletContext.getRealPath(HotDeploymentStrategy.DEFAULT_HOT_DEPLOYMENT_DIRECTORY_PATH);
- if (path==null) //WebLogic!
+ String realPath = servletContext.getRealPath(path);
+ if (realPath==null) //WebLogic!
{
- log.debug("Could not find path for " + HotDeploymentStrategy.DEFAULT_HOT_DEPLOYMENT_DIRECTORY_PATH);
+ log.debug("Could not find path for " + path);
}
else
{
- File hotDeployDir = new File(path);
- if (hotDeployDir.exists())
+ File file = new File(realPath);
+ if (file.exists())
{
- return hotDeployDir;
+ return file;
}
}
return null;
Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-08-18 20:58:19 UTC (rev 8731)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-08-18 21:37:45 UTC (rev 8732)
@@ -50,6 +50,10 @@
// call processing of context parameters
processContextParameters(webxml);
}
+ else
+ {
+ webappRoot = new File(getClass().getResource("/").toURI());
+ }
}
catch (URISyntaxException e)
{
@@ -253,8 +257,7 @@
public String getRealPath(String relativePath)
{
- // spec says to return null if we can't figure it out
- return null;
+ return webappRoot.getAbsolutePath() + relativePath;
}
public String getServerInfo()
15 years, 8 months