Seam SVN: r8761 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-21 09:50:33 -0400 (Thu, 21 Aug 2008)
New Revision: 8761
Modified:
trunk/build/gen.pom.xml
trunk/build/root.pom.xml
trunk/build/ui.pom.xml
trunk/build/wicket.pom.xml
Log:
JBSEAM-3289 and general tidy up of transitive dependencies
Modified: trunk/build/gen.pom.xml
===================================================================
--- trunk/build/gen.pom.xml 2008-08-21 12:13:57 UTC (rev 8760)
+++ trunk/build/gen.pom.xml 2008-08-21 13:50:33 UTC (rev 8761)
@@ -16,7 +16,7 @@
<dependencies>
<dependency>
- <groupId>ant</groupId>
+ <groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<scope>compile</scope>
</dependency>
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-08-21 12:13:57 UTC (rev 8760)
+++ trunk/build/root.pom.xml 2008-08-21 13:50:33 UTC (rev 8761)
@@ -139,9 +139,9 @@
<dependency>
- <groupId>ant</groupId>
+ <groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
- <version>1.6.5</version>
+ <version>1.7.0</version>
</dependency>
<dependency>
@@ -250,6 +250,10 @@
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -258,6 +262,16 @@
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>2.2.0.CR6</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -485,10 +499,14 @@
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.8-seam</version>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
-
- <!-- Should be 3.3.GA to be in sync with AS, but this doesn't seem to exist -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
@@ -822,6 +840,24 @@
<groupId>jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.0.4.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-slide</groupId>
+ <artifactId>webdavlib</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
Modified: trunk/build/ui.pom.xml
===================================================================
--- trunk/build/ui.pom.xml 2008-08-21 12:13:57 UTC (rev 8760)
+++ trunk/build/ui.pom.xml 2008-08-21 13:50:33 UTC (rev 8761)
@@ -178,6 +178,9 @@
<version>5.1</version>
<scope>test</scope>
<classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion></exclusion>
+ </exclusions>
</dependency>
</dependencies>
Modified: trunk/build/wicket.pom.xml
===================================================================
--- trunk/build/wicket.pom.xml 2008-08-21 12:13:57 UTC (rev 8760)
+++ trunk/build/wicket.pom.xml 2008-08-21 13:50:33 UTC (rev 8761)
@@ -47,6 +47,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
15 years, 8 months
Seam SVN: r8760 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-21 08:13:57 -0400 (Thu, 21 Aug 2008)
New Revision: 8760
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
Log:
Docs for new caching stuff
Modified: trunk/doc/Seam_Reference_Guide/en-US/Cache.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-08-21 11:34:46 UTC (rev 8759)
+++ trunk/doc/Seam_Reference_Guide/en-US/Cache.xml 2008-08-21 12:13:57 UTC (rev 8760)
@@ -83,9 +83,10 @@
<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.
+ <literal>cacheProvider</literal> component, which integrates
+ JBossCache, JBoss POJO Cache or EHCache into the Seam environment.
+ This state will be visible to other nodes if your cache supports
+ running in a clustered mode.
</para>
</listitem>
<listitem>
@@ -102,72 +103,228 @@
<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,
+ topic. In this section we'll discuss the use of caching directly, via
+ the <literal>cacheProvider</literal> component, or as the page fragment cache,
via the <literal><s:cache></literal> control.
</para>
<section>
- <title>Using JBossCache in Seam</title>
+ <title>Using Caching 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.
+ The built-in <literal>cacheProvider</literal> component manages an instance
+ of:
</para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ JBoss Cache 1.x (suitable for use in JBoss 4.2.x and other
+ containers)
+ </term>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.TreeCache</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ JBoss Cache 2.x (suitable for use in JBoss 5.x and other
+ containers)
+ </term>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.Cache</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ JBoss POJO Cache 1.x (suitable for use in JBoss 4.2.x and other
+ containers)
+ </term>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.aop.PojoCache</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ EHCache (suitable for use in any container)
+ </term>
+ <listitem>
+ <para>
+ <literal>net.sf.ehcache.CacheManager</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <para>
+ You can safely put any immutable Java object in the cache, and it will
+ be stored in the cache and replicated across the cluster (assuming that
+ replication is supported and enabled). If you want to keep mutable
+ objects in the cache read the documentation of the underling caching
+ project documentation to discover how to notify the cache of changes to
+ the cache.
+ </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
+ To use <literal>cacheProvider</literal>, you need to include the jars
+ of the cache implementation in your project:
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ JBoss Cache 1.x
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>jboss-cache.jar</literal> - JBoss Cache 1.4.1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jgroups.jar</literal> - JGroups 2.4.1
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ JBoss Cache 2.x
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>jboss-cache.jar</literal> - JBoss Cache 2.2.0
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jgroups.jar</literal> - JGroups 2.6.2
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ JBoss POJO Cache 1.x
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>jboss-cache.jar</literal> - JBoss Cache 1.4.1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jgroups.jar</literal> - JGroups 2.4.1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-aop.jar</literal> - JBoss AOP 1.5.0
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ EHCache
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>ehcache.jar</literal> - EHCache 1.2.3
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <tip>
+ <para>
+ If you are using JBoss Cache in containers other than JBoss
+ Application Server, look at the JBoss Cache
+ <ulink url="http://wiki.jboss.org/wiki/JBossCache">wiki</ulink> page
+ for more dependencies.
+ </para>
+ </tip>
+
+ <para>
+ For an EAR depoyment of Seam, we recommend that the cache jars and
+ configuration go directly into the EAR.
+ </para>
+
+ <para>
+ You'll also need to provide a configuration file for JBossCache. Place
<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.
+ configuration into the classpath (e.g. the ejb jar or
+ <literal>WEB-INF/classes</literal>). 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.
+ EHCache will run in it's default configuration without a configuration
+ file
</para>
+
+ <para>
+ To alter the configuration file in use, configure your cache in
+ <literal>components.xml</literal>:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:cache="http://jboss.com/products/seam/cache">
+ <cache:jboss-cache-provider configuration="META-INF/cache/treecache.xml" />
+</components>]]></programlisting>
<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 CacheProvider cacheProvider;
public void join(String username) {
- try {
- Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
- if (userList==null) {
- userList = new HashSet<String>();
- pojoCache.put("chatroom", "userList", userList);
- }
- userList.put(username);
- } catch (CacheException ce) {
- throw new RuntimeException(ce);
+ Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
+ if (userList==null) {
+ userList = new HashSet<String>();
+ cacheProvider.put("chatroom", "userList", userList);
}
+ userList.put(username);
}
}]]></programlisting>
<para>
- If you want to have multiple JBossCache configurations in your
- application, use <literal>components.xml</literal>:
+ If you want to have multiple cache configurations in your
+ application, use <literal>components.xml</literal> to configure
+ multiple cache providers:
</para>
- <programlisting role="JAVA"><![CDATA[<core:pojo-cache name="myCache" cfg-resource-name="myown/cache.xml"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:cache="http://jboss.com/products/seam/cache">
+ <cache:jboss-cache-provider name="myCache" configuration="myown/cache.xml"/>
+ <cache:jboss-cache-provider name="myOtherCache" configuration="myother/cache.xml"/>
+</components>]]></programlisting>
</section>
@@ -175,7 +332,7 @@
<title>Page fragment caching</title>
<para>
- The most interesting user of JBossCache is the
+ The most interesting use of caching in Seam 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
@@ -203,10 +360,10 @@
<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.)
+ The <literal>region</literal> determines the cache or region 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>
@@ -219,13 +376,13 @@
<programlisting role="JAVA"><![CDATA[public void post() {
...
entityManager.persist(blogEntry);
- pojoCache.remove("welcomePageFragments", "recentEntries-" + blog.getId() );
+ cacheProvider.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.
+ cache node.
</para>
</section>
15 years, 8 months
Seam SVN: r8759 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-21 07:34:46 -0400 (Thu, 21 Aug 2008)
New Revision: 8759
Removed:
tags/Seam_FP_CR2/
Log:
15 years, 8 months
Seam SVN: r8758 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-21 04:25:33 -0400 (Thu, 21 Aug 2008)
New Revision: 8758
Added:
tags/Seam_FP_CR2/
Log:
Copied: tags/Seam_FP_CR2 (from rev 8757, branches/Seam_2_0_FP)
15 years, 8 months
Seam SVN: r8757 - branches/Seam_2_0_FP.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-21 04:21:11 -0400 (Thu, 21 Aug 2008)
New Revision: 8757
Modified:
branches/Seam_2_0_FP/changelog.txt
Log:
JBPAPP-1106
Modified: branches/Seam_2_0_FP/changelog.txt
===================================================================
--- branches/Seam_2_0_FP/changelog.txt 2008-08-21 08:19:09 UTC (rev 8756)
+++ branches/Seam_2_0_FP/changelog.txt 2008-08-21 08:21:11 UTC (rev 8757)
@@ -19,6 +19,13 @@
* [JBPAPP-1058] - Upgrade featured libraries to latest patch version in minor series
* [JBPAPP-1066] - Mark the Hibernate Search integration as Technology Preview
+Release Notes - JBoss Seam - Version 2.0.2.SP1
+
+** Bug
+ * [ JBSEAM-2917 ] Bad cache in getEjbDescriptor
+ * [ JBSEAM-3017 ] Seam-gen downloading from maven
+ * [ JBSEAM-3024 ] Performance issues in 2.0.2 release
+
Release Notes - JBoss Seam - Version 2.0.2.GA
** Bug
15 years, 8 months
Seam SVN: r8756 - branches/Seam_2_0_FP/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-21 04:19:09 -0400 (Thu, 21 Aug 2008)
New Revision: 8756
Modified:
branches/Seam_2_0_FP/build/root.pom.xml
Log:
upgrade jboss-jmx and jboss-system to EAP 4.3.0.GA_CP02
Modified: branches/Seam_2_0_FP/build/root.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/root.pom.xml 2008-08-21 07:06:34 UTC (rev 8755)
+++ branches/Seam_2_0_FP/build/root.pom.xml 2008-08-21 08:19:09 UTC (rev 8756)
@@ -380,7 +380,7 @@
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-system</artifactId>
- <version>4.2.2.GA</version>
+ <version>4.3.0.GA_CP02</version>
</dependency>
<dependency>
@@ -434,7 +434,7 @@
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-jmx</artifactId>
- <version>4.2.2.GA</version>
+ <version>4.3.0.GA_CP02</version>
</dependency>
<!-- Should be 3.3.GA to be in sync with AS, but this doesn't seem to exist -->
15 years, 8 months
Seam SVN: r8755 - branches/Seam_2_0_FP/seam-gen.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-21 03:06:34 -0400 (Thu, 21 Aug 2008)
New Revision: 8755
Modified:
branches/Seam_2_0_FP/seam-gen/build.xml
Log:
JBPAPP-1109
Modified: branches/Seam_2_0_FP/seam-gen/build.xml
===================================================================
--- branches/Seam_2_0_FP/seam-gen/build.xml 2008-08-20 18:50:48 UTC (rev 8754)
+++ branches/Seam_2_0_FP/seam-gen/build.xml 2008-08-21 07:06:34 UTC (rev 8755)
@@ -90,29 +90,7 @@
<condition property="base.dir" value="icefaces-staging" else=".">
<equals arg1="${icefaces}" arg2="y"/>
</condition>
-
- <condition property="icefaces.lib" value="${icefaces.home}/lib" else="../lib">
- <and>
- <equals arg1="${icefaces}" arg2="y"/>
- <not>
- <equals arg1="${icefaces.home}" arg2=""/>
- </not>
- </and>
- </condition>
-
- <condition property="icefaces.property">
- <equals arg1="${icefaces}" arg2="y"/>
- </condition>
-
- <condition property="icefaces.lib.property">
- <and>
- <equals arg1="${icefaces}" arg2="y"/>
- <not>
- <equals arg1="${icefaces.home}" arg2=""/>
- </not>
- </and>
- </condition>
-
+
<filterset id="jdbc">
<filter token="jdbcUrl" value="${hibernate.connection.url}"/>
<filter token="driverClass" value="${hibernate.connection.driver_class}"/>
@@ -128,7 +106,6 @@
<filterset id="project">
<filter token="projectName" value="${project.name}" />
<filter token="jbossHome" value="${jboss.home}" />
- <filter token="iceHome" value="${icefaces.home}" />
<filter token="hbm2ddl" value="${hibernate.hbm2ddl.auto}"/>
<filter token="driverJar" value="${driver.file}"/>
<filter token="skin" value="${richfaces.skin}" />
@@ -181,27 +158,8 @@
message="Enter the project name [${old.project.name}]"
defaultvalue="${old.project.name}"/>
<normalizeProjectName property="project.name.new" />
- <echo message="Accepted project name as: ${project.name.new}" />
-
- <property name="old.icefaces" value="n"/>
- <input addproperty="icefaces.new"
- message="Do you want to use ICEFaces instead of RichFaces [${old.icefaces}]"
- validargs="y,n"
- defaultvalue="${old.icefaces}" />
-
- <condition property="icefaces.home.new" value="">
- <equals arg1="${icefaces.new}" arg2="n"/>
- </condition>
-
- <property name="old.icefaces.home" value="" />
- <input addproperty="icefaces.home.new"
- message="By default, seam-gen will download the recommended ICEFaces. If you want to use a specific version of ICEFaces, enter the path to icefaces here [${old.icefaces.home}]"
- defaultvalue="${old.icefaces.home}" />
-
- <condition property="richfaces.skin.new" value="">
- <equals arg1="${icefaces.new}" arg2="y"/>
- </condition>
-
+ <echo message="Accepted project name as: ${project.name.new}" />
+
<property name="old.richfaces.skin" value="blueSky"/>
<input addproperty="richfaces.skin.new"
message="Select a RichFaces skin [${old.richfaces.skin}]"
@@ -444,8 +402,6 @@
<entry key="richfaces.skin" value="${richfaces.skin.new}"/>
<entry key="project.type" value="${project.type.new}"/>
<entry key="jboss.home" value="${jboss.home.new}"/>
- <entry key="icefaces" value="${icefaces.new}"/>
- <entry key="icefaces.home" value="${icefaces.home.new}"/>
<entry key="action.package" value="${action.package.new}"/>
<entry key="model.package" value="${model.package.new}"/>
<entry key="test.package" value="${test.package.new}"/>
@@ -470,32 +426,6 @@
<echo message="Type 'seam create-project' to create the new project"/>
</target>
-
- <target name="icefaces-staging-copy" if="icefaces.property">
- <echo message="Set up the icefaces directory"/>
- <copy todir="icefaces-staging">
- <fileset dir=".">
- <include name="build-scripts/**"/>
- <include name="hibernatetools/**"/>
- <include name="lib/**"/>
- <include name="resources/**"/>
- <include name="pojo/**"/>
- <include name="src/**"/>
- <include name="test/**"/>
- <include name="view/**"/>
- <include name="nbproject/**"/>
- <include name="util/**"/>
- </fileset>
- </copy>
- <copy todir="icefaces-staging" overwrite="true">
- <fileset dir="icefaces">
- <include name="build-scripts/**"/>
- <include name="resources/**"/>
- <include name="src/**"/>
- <include name="view/**"/>
- </fileset>
- </copy>
- </target>
<target name="action-input" depends="init">
@@ -601,14 +531,11 @@
- <target name="copy-lib" depends="copyseam, copyseamdependencies, copyjbossembedded, copy-icefaces-home, copy-icefaces-maven">
+ <target name="copy-lib" depends="copyseam, copyseamdependencies, copyjbossembedded">
<echo message="Copying Seam and depdencies to the ${project.home}/lib directory..." />
<copy todir="${project.home}/lib" overwrite="true">
<fileset dir="../lib">
- <exclude name="jsf-facelets.jar" if="icefaces.property"/>
- <exclude name="ajax4jsf*.jar" if="icefaces.property"/>
- <exclude name="richfaces*.jar" if="icefaces.property"/>
<exclude name="jboss-container.jar" />
<exclude name="test/jboss-deplyers.jar" />
<exclude name="test/jboss-embedded-api.jar" />
@@ -623,38 +550,8 @@
<fileset dir="../bootstrap" />
</copy>
- </target>
+ </target>
- <target name="copy-icefaces-maven" if="icefaces.property" unless="icefaces.lib.property">
- <artifact:dependencies filesetId="icefaces.fileset" versionsId="icefaces.versions">
- <dependency groupId="org.icefaces" artifactId="icefaces" version="1.7.0">
- <exclusion groupId="javax.el" artifactId="el-api" />
- </dependency>
- <dependency groupId="org.icefaces" artifactId="icefaces-comps" version="1.7.0">
- <exclusion groupId="javax.el" artifactId="el-api" />
- </dependency>
- <dependency groupId="org.icefaces" artifactId="icefaces-facelets" version="1.7.0">
- <exclusion groupId="javax.el" artifactId="el-api" />
- </dependency>
- <remoteRepository refId="repository.jboss.org" />
- </artifact:dependencies>
- <copy todir="${project.home}/lib" overwrite="true">
- <fileset refid="icefaces.fileset" />
- <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${icefaces.versions}" to="flatten" />
- </copy>
- </target>
-
- <target name="copy-icefaces-home" if="icefaces.lib.property">
- <copy todir="${project.home}/lib" overwrite="true">
- <fileset dir="${icefaces.lib}" >
- <include name="icefaces*.jar"/>
- <include name="backport-util-concurrent.jar"/>
- <include name="commons-fileupload.jar"/>
- <include name="commons-digester.jar"/>
- </fileset>
- </copy>
- </target>
-
<target name="file-copy-war" if="project.war">
<echo message="Copying resources needed for WAR deployment to the ${project.home}/resources directory..." />
@@ -813,7 +710,6 @@
<copy todir="${project.home}/src/${action.dir}">
<fileset dir="${base.dir}/src/">
<include name="Authenticator.java"/>
- <include name="Timer*.java" if="icefaces.property"/>
</fileset>
<filterset refid="filters"/>
</copy>
@@ -881,7 +777,7 @@
<!-- Do not remove new-project, netbeans depends on it -->
<target name="new-project" depends="create-project" />
- <target name="create-project" depends="validate-project,icefaces-staging-copy,copy-lib,file-copy"
+ <target name="create-project" depends="validate-project,copy-lib,file-copy"
description="Create a new project">
<echo message="A new Seam project named '${project.name}' was created in the ${workspace.home} directory"/>
<echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}"/>
@@ -1246,7 +1142,6 @@
description="Print the settings">
<echo message="Java project workspace: ${workspace.home}"/>
<echo message="JBoss home: ${jboss.home}"/>
- <echo message="IceFaces: ${icefaces}"/>
<echo message="Project name: ${project.name}"/>
<echo message="Project type: ${project.type}"/>
<echo message="Hibernate dialect: ${hibernate.dialect}"/>
15 years, 8 months
Seam SVN: r8754 - 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-20 14:50:48 -0400 (Wed, 20 Aug 2008)
New Revision: 8754
Modified:
branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml
Log:
Jays changes to migration docs
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-20 18:26:02 UTC (rev 8753)
+++ branches/Seam_2_0_FP/doc/Seam_Reference_Guide/en-US/Migration.xml 2008-08-20 18:50:48 UTC (rev 8754)
@@ -22,15 +22,6 @@
details those 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>
@@ -56,10 +47,15 @@
into your favorite IDE, and copy your code and views across.
</para>
+ <para>
+ Continue on to <xref linkend="migrating.general"/> for details regarding
+ the changes needed to your code, and configuration files.
+ </para>
+
</section>
<section id="migrating.insitu">
- <title>In situ migration</title>
+ <title>In place migration</title>
<para>
This requires more work, but is suitable for more complex projects. The
@@ -72,7 +68,7 @@
<warning>
<para>
- You only need to do this if you are migrating from the comunity
+ You only need to do this if you are migrating from the community
edition of Seam, JBoss EAP 4.2 and 4.3 shipped a version of Seam
1.2 which used JSF 1.2.
</para>
@@ -109,16 +105,24 @@
<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):
+ configuration in <literal>web.xml</literal>. First, we'll discuss
+ all the Seam related elements you need in
+ <literal>web.xml</literal>, not just those that have changed, noting
+ any changes.
</para>
+ <para>
+ In Seam 2, you need specify a listener (just 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):
+ Modify the Seam master filter (note the package of the class
+ changed):
</para>
<programlisting role="XML"><![CDATA[<filter>
@@ -138,7 +142,8 @@
</para>
<para>
- Finally, you should have the Seam resouce servlet (as in Seam 1.2):
+ Finally, you should have the Seam resouce servlet (just as you did
+ in Seam 1.2):
</para>
<programlisting role="XML"><![CDATA[<servlet>
@@ -172,11 +177,17 @@
<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
+ Next, we'll describe the changes you need to make to your JSF
+ <literal>ViewHandler</literal> configuration. Previously the
+ configuration you used depended on whether you were using Seam's EL
+ enhancements or Ajax4JSF or both. In Seam 2 you should use the
+ default <literal>FaceletViewHandler</literal>.
+ </para>
+
+ <para>
+ Seam 1.2 required you to use a special JSF
+ <literal>ViewHandler</literal> to install it's EL enhancement
+ (whilst in Seam 2 the EL enhancement is built in). 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
@@ -213,7 +224,8 @@
</para>
<para>
- To disable Seam Managed Transactions, set
+ Seam Managed Transaction are enabled by default, to disable Seam
+ Managed Transactions, set
<literal>transaction-management-enabled</literal> to false:
</para>
@@ -231,17 +243,19 @@
<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
+ If you have an EAR application there are some deployment structure
+ changes needed. You should move 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>.
+ <literal>application.xml</literal>. Remove the unneeded module
+ declarations from <literal>application.xml</literal>.
</para>
</section>
- <section>
+ <section id="migration.embedded">
<title>Migration to JBoss Embedded</title>
<para>
@@ -294,8 +308,17 @@
</section>
<section id="migrating.general">
- <title>Component changes</title>
+ <title>Updating your code</title>
+ <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>
<title>Built-in Component changes</title>
@@ -1123,21 +1146,37 @@
</listitem>
<listitem>
<para>
- @RequestParameter is located in
+ The annotation to inject a request parameter is located in
<literal>org.jboss.seam.annotations.web</literal>
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@RequestParameter</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
<listitem>
<para>
- @WebRemote are located in
+ The annotation required to make a method accessible via
+ remoting is located in
<literal>org.jboss.seam.annotations.remoting</literal>
</para>
</listitem>
<listitem>
<para>
- @Restrict are located in
+ The annotation to apply a security restriction to the
+ component is located in
<literal>org.jboss.seam.annotations.security</literal>
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>@Restrict</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
<listitem>
<para>
@@ -1194,7 +1233,7 @@
</para>
<para>
- The resouce bundle loader has been split out of the resouce bundle,
+ The resource bundle loader has been split out of the resource bundle,
so you should replace
<literal><core:resource-bundle/></literal> with
<literal><core:resource-loader/></literal>.
15 years, 8 months
Seam SVN: r8753 - in trunk: build and 7 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-20 14:26:02 -0400 (Wed, 20 Aug 2008)
New Revision: 8753
Added:
trunk/src/main/org/jboss/seam/cache-2.1.xsd
trunk/src/main/org/jboss/seam/cache/
trunk/src/main/org/jboss/seam/cache/AbstractJBossCacheProvider.java
trunk/src/main/org/jboss/seam/cache/CacheProvider.java
trunk/src/main/org/jboss/seam/cache/EhCacheProvider.java
trunk/src/main/org/jboss/seam/cache/JbossCache2Provider.java
trunk/src/main/org/jboss/seam/cache/JbossCacheProvider.java
trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
trunk/src/main/org/jboss/seam/cache/package-info.java
Removed:
trunk/src/main/org/jboss/seam/core/PojoCache.java
Modified:
trunk/build.xml
trunk/build/core.pom.xml
trunk/build/root.pom.xml
trunk/build/ui.pom.xml
trunk/build/utilities.build.xml
trunk/src/main/org/jboss/seam/init/Initialization.java
trunk/ui/src/main/config/component/cache.xml
trunk/ui/src/main/java/org/jboss/seam/ui/component/UICache.java
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CacheRendererBase.java
Log:
JBSEAM-1891
Modified: trunk/build/core.pom.xml
===================================================================
--- trunk/build/core.pom.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/build/core.pom.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -175,12 +175,28 @@
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Order matters of jboss:jboss-cache and org.jboss.cache:jbosscache-core -->
+
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-cache</artifactId>
<optional>true</optional>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+
<!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
<dependency>
<groupId>jboss</groupId>
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/build/root.pom.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -240,6 +240,25 @@
<artifactId>jboss-cache</artifactId>
<version>1.4.1.SP9</version>
</dependency>
+
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ <version>1.2.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- You should adjust this in the initcore task in build.xml as well -->
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>2.2.0.CR6</version>
+ </dependency>
<dependency>
<groupId>jgroups</groupId>
Modified: trunk/build/ui.pom.xml
===================================================================
--- trunk/build/ui.pom.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/build/ui.pom.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -121,12 +121,6 @@
</exclusion>
</exclusions>
</dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-cache</artifactId>
- <optional>true</optional>
- </dependency>
<!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
<dependency>
Modified: trunk/build/utilities.build.xml
===================================================================
--- trunk/build/utilities.build.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/build/utilities.build.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -30,8 +30,10 @@
<attribute name="id" />
<attribute name="scope" />
<attribute name="pom" />
+ <element name="nested" implicit="true" optional="true" />
<sequential>
<artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" settingsFile="${maven.settings.xml}">
+ <nested />
<pom file="@{pom}" settingsFile="${maven.settings.xml}" />
</artifact:dependencies>
</sequential>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/build.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -173,6 +173,9 @@
<target name="initcore" depends="init">
<init classesdir="${classes.core.dir}" srcdir="${src.core.dir}" modulename="core" pom="${core.pom}" />
+ <inlineDependencies id="jbosscache2" scope="compile">
+ <dependency groupId="org.jboss.cache" artifactId="jbosscache-core" version="2.2.0.CR6" />
+ </inlineDependencies>
</target>
<target name="antlr" depends="initcore" description="Generate ANTLR parser">
@@ -192,7 +195,18 @@
</target>
<target name="compilecore" depends="initcore,select-compiler,antlr">
- <compile classesdir="${classes.core.dir}" srcdir="${src.core.dir}" classpath="compile.core.path" />
+ <compile classesdir="${classes.core.dir}" srcdir="${src.core.dir}" classpath="compile.core.path">
+ <exclude name="org/jboss/seam/cache/JbossCache2Provider*" />
+ </compile>
+ <!-- Fiddle to make sure we compile the JBossCache2 stuff with JBossCache2" -->
+ <path id="compile.core-jbosscache2.path">
+ <path refid="compile.jbosscache2.path" />
+ <path refid="compile.core.path" />
+ <fileset dir="${classes.core.dir}" />
+ </path>
+ <compile classesdir="${classes.core.dir}" srcdir="${src.core.dir}" classpath="compile.core-jbosscache2.path">
+ <include name="org/jboss/seam/cache/JbossCache2Provider*" />
+ </compile>
</target>
<target name="jarcore" depends="compilecore" description="Build the distribution .jar file using M2 dependency management">
@@ -874,7 +888,8 @@
<patternset refid="meta.files" />
</fileset>
</copy>
- <dependencies id="@{modulename}" scope="@{scope}" pom="@{pom}" />
+ <dependencies id="@{modulename}" scope="@{scope}" pom="@{pom}">
+ </dependencies>
</sequential>
</macrodef>
@@ -882,13 +897,10 @@
<attribute name="classesdir" />
<attribute name="srcdir" />
<attribute name="classpath" />
- <element name="compile.classpath" optional="true" implicit="true" />
+ <element name="javac.nested" optional="true" implicit="true"/>
<sequential>
- <javac source="1.5" target="1.5" destdir="@{classesdir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on" srcdir="@{srcdir}">
- <classpath>
- <path refid="@{classpath}" />
- <compile.classpath />
- </classpath>
+ <javac source="1.5" target="1.5" destdir="@{classesdir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on" srcdir="@{srcdir}" classpathref="@{classpath}" >
+ <javac.nested />
</javac>
</sequential>
</macrodef>
Added: trunk/src/main/org/jboss/seam/cache/AbstractJBossCacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/AbstractJBossCacheProvider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/AbstractJBossCacheProvider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,34 @@
+package org.jboss.seam.cache;
+
+import org.jboss.cache.Fqn;
+
+public abstract class AbstractJBossCacheProvider<T> extends CacheProvider<T>
+{
+
+ public AbstractJBossCacheProvider()
+ {
+ super.setConfiguration("treecache.xml");
+ }
+
+ private Fqn defaultFqn = Fqn.fromString(defaultRegion);
+
+ protected Fqn getFqn(String region)
+ {
+ if (region != null)
+ {
+ return Fqn.fromString(region);
+ }
+ else
+ {
+ return defaultFqn;
+ }
+ }
+
+ @Override
+ public void setDefaultRegion(String defaultRegion)
+ {
+ super.setDefaultRegion(defaultRegion);
+ this.defaultFqn = Fqn.fromString(defaultRegion);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/org/jboss/seam/cache/AbstractJBossCacheProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/CacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/CacheProvider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/CacheProvider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,147 @@
+package org.jboss.seam.cache;
+
+import java.io.InputStream;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.ResourceLoader;
+
+/**
+ * CacheProvider provides methods to control and manipulate the configured cache
+ *
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+
+public abstract class CacheProvider<T>
+{
+
+ /**
+ * the region name to be used if no region is specified
+ */
+ public static final String DEFAULT_REGION = "org.jboss.seam.cache.DefaultRegion";
+ private String configuration;
+ protected String defaultRegion = DEFAULT_REGION;
+
+ /**
+ * @return - the cache the cache provider delegates to
+ */
+ public abstract T getDelegate();
+
+ /**
+ * Get the configuration file used by the cache
+ *
+ */
+ public String getConfiguration()
+ {
+ return this.configuration;
+ }
+
+ protected InputStream getConfigurationAsStream()
+ {
+ return ResourceLoader.instance().getResourceAsStream(getConfiguration());
+ }
+
+ /**
+ * Set the configuration file to be used by the cache
+ */
+ public void setConfiguration(String cfgResourceName)
+ {
+ this.configuration = cfgResourceName;
+ }
+
+ /**
+ * Fetches an object for the given key from the cache and returns it if
+ * found. Only the default cache region will be searched.
+ *
+ * @param key - a key to identify the object.
+ * @return - the object if found or null if not
+ */
+ public Object get(String key)
+ {
+ return get(null, key);
+ }
+
+ /**
+ * Fetches an object for the given key from the cache and returns it if
+ * found. Only the specified cache region will be searched.
+ *
+ * @param region - the name of a cache region
+ * @param key - a key to identify the object.
+ * @return - the object if found or null if not
+ */
+ public abstract Object get(String key, String region);
+
+ /**
+ * Put an object into the cache. The object is placed in the default cache
+ * region under the given key.
+ *
+ * @param key - a key to identify the object
+ * @param object - the object to be stored in the cache
+ */
+ public void put(String key, Object object)
+ {
+ put(null, key, object);
+ }
+
+ /**
+ * Puts an object into the cache. The object is placed in the specified cache
+ * region under the given key.
+ *
+ * @param region - the name of a cache region
+ * @param key - a key to identify the object
+ * @param object - the object to be stored in the cache
+ */
+ public abstract void put(String region, String key, Object object);
+
+ /**
+ * Removes an object from the cache. The object is removed from the default
+ * cache region under the given key.
+ *
+ * @param key - a key to identify the object
+ */
+ public void remove(String key)
+ {
+ remove(null, key);
+ }
+
+ /**
+ * Removes an object from the cache. The object is removed from the specified
+ * cache region under the given key.
+ *
+ * @param region - the name of a cache region
+ * @param key - a key to identify the object
+ */
+ public abstract void remove(String region, String key);
+
+ /**
+ * Removes all objects from all cache regions
+ */
+ public abstract void clear();
+
+ public String getDefaultRegion()
+ {
+ return defaultRegion;
+ }
+
+ public void setDefaultRegion(String defaultRegion)
+ {
+ this.defaultRegion = defaultRegion;
+ }
+
+ public static CacheProvider instance()
+ {
+ if (!Contexts.isApplicationContextActive())
+ {
+ throw new IllegalStateException("No active application scope");
+ }
+ return (CacheProvider) Component.getInstance("org.jboss.seam.cache.cacheProvider", ScopeType.APPLICATION);
+ }
+
+ public static <T> CacheProvider<T> instance(Class<? extends T> type)
+ {
+ return instance();
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/cache/CacheProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/EhCacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/EhCacheProvider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/EhCacheProvider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,135 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+import static org.jboss.seam.ScopeType.STATELESS;
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+/**
+ * Implementation of CacheProvider backed by EhCache. The default cache region
+ * issues <i>org.jboss.seam.cache.DefaultCache</> as the default cache region.
+ *
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+@Name("org.jboss.seam.cache.cacheProvider")
+@Scope(STATELESS)
+@BypassInterceptors
+@Install(value = false, precedence = BUILT_IN, classDependencies="net.sf.ehcache.Cache")
+public class EhCacheProvider extends CacheProvider<CacheManager>
+{
+
+ private CacheManager cacheManager;
+
+ private static final LogProvider log = Logging.getLogProvider(EhCacheProvider.class);
+
+ @Override
+ public CacheManager getDelegate()
+ {
+ return cacheManager;
+ }
+
+ @Override
+ public void put(String region, String key, Object object)
+ {
+ Cache cache = getCacheRegion(region);
+ Element element = new Element(key, object);
+ cache.put(element);
+ }
+
+ @Override
+ public void clear()
+ {
+ String[] strings = cacheManager.getCacheNames();
+ for (String cacheName : strings)
+ {
+ Cache cache = getCacheRegion(cacheName);
+ cache.removeAll();
+ }
+ }
+
+ @Override
+ public Object get(String region, String key)
+ {
+ Cache cache = getCacheRegion(region);
+ Element element = cache.get(key);
+ if (element != null)
+ {
+ return element.getObjectValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private net.sf.ehcache.Cache getCacheRegion(String regionName)
+ {
+ if (regionName == null)
+ {
+ regionName = getDefaultRegion();
+ }
+ Cache result = cacheManager.getCache(regionName);
+ if (result == null)
+ {
+ throw new IllegalArgumentException("Cache region not found");
+ }
+ return result;
+ }
+
+ @Override
+ public void remove(String region, String key)
+ {
+ Cache cache = getCacheRegion(region);
+ cache.remove(key);
+ }
+
+ @Create
+ public void create()
+ {
+ log.debug("Starting EhCacheProvider cache");
+ // TODO validate if there is any common approach to load resources in Seam
+ try
+ {
+ if (getConfiguration() != null)
+ {
+ cacheManager = new CacheManager(getConfigurationAsStream());
+ }
+ else
+ {
+ cacheManager = new CacheManager();
+ }
+ }
+ catch (net.sf.ehcache.CacheException e)
+ {
+ throw new IllegalStateException("Error starting EHCache Cache", e);
+ }
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ log.debug("Stopping EhCacheProvider cache");
+
+ try
+ {
+ cacheManager.shutdown();
+ cacheManager = null;
+ }
+ catch (RuntimeException e)
+ {
+ throw new IllegalStateException("Error stopping EHCache Cache", e);
+ }
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/cache/EhCacheProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/JbossCache2Provider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/JbossCache2Provider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/JbossCache2Provider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,103 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+/**
+ * Implementation of CacheProvider backed by JBoss Cache 2.x.
+ * for simple objects.
+ *
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+
+@Name("org.jboss.seam.cache.cacheProvider")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(precedence = BUILT_IN, classDependencies="org.jboss.cache.Cache")
+public class JbossCache2Provider extends AbstractJBossCacheProvider<Cache>
+{
+
+ private org.jboss.cache.Cache cache;
+
+ private static final LogProvider log = Logging.getLogProvider(JbossCache2Provider.class);
+
+ @Create
+ public void create()
+ {
+ log.debug("Starting JBoss Cache");
+
+ try
+ {
+ CacheFactory factory = new DefaultCacheFactory();
+ cache = factory.createCache(getConfigurationAsStream());
+
+ cache.create();
+ cache.start();
+ }
+ catch (Exception e)
+ {
+ log.error(e, e);
+ throw new IllegalStateException("Error starting JBoss Cache", e);
+ }
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ log.debug("Stopping JBoss Cache");
+ try
+ {
+ cache.stop();
+ cache.destroy();
+ cache = null;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error stopping JBoss Cache", e);
+ }
+ }
+
+ @Override
+ public Object get(String region, String key)
+ {
+ return cache.get(getFqn(region), key);
+ }
+
+ @Override
+ public void put(String region, String key, Object object)
+ {
+ cache.put(getFqn(region), key, object);
+ }
+
+ @Override
+ public void remove(String region, String key)
+ {
+ cache.remove(getFqn(region), key);
+ }
+
+ @Override
+ public void clear()
+ {
+ cache.removeNode(getFqn(null));
+ }
+
+ @Override
+ public Cache getDelegate()
+ {
+ return cache;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/org/jboss/seam/cache/JbossCache2Provider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/JbossCacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/JbossCacheProvider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/JbossCacheProvider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,140 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.FRAMEWORK;
+
+import org.jboss.cache.CacheException;
+import org.jboss.cache.Node;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+/**
+ * Implementation of CacheProvider backed by JBoss Cache 1.x
+ *
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+
+@Name("org.jboss.seam.cache.cacheProvider")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(precedence = FRAMEWORK, classDependencies="org.jboss.cache.TreeCache")
+public class JbossCacheProvider extends AbstractJBossCacheProvider<TreeCache>
+{
+
+ private TreeCache cache;
+
+ private static final LogProvider log = Logging.getLogProvider(JbossCacheProvider.class);
+
+ @Create
+ public void create()
+ {
+ log.info("Starting JBoss Treecache 1.x");
+
+ try
+ {
+ cache = new TreeCache();
+ new PropertyConfigurator().configure(cache, getConfigurationAsStream());
+ cache.createService();
+ cache.startService();
+
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error starting JBoss Treecache 1.x", e);
+ }
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ log.info("Stopping JBoss Treecache 1.x");
+
+ try
+ {
+ cache.stopService();
+ cache.destroyService();
+ }
+ catch (RuntimeException e)
+ {
+ throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
+ }
+ cache = null;
+ }
+
+ @Override
+ public Object get(String region, String key)
+ {
+ try
+ {
+ Node node = cache.get(getFqn(region));
+ if (node != null)
+ {
+ return node.get(key);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
+ }
+ }
+
+ @Override
+ public void put(String region, String key, Object object)
+ {
+ try
+ {
+ cache.put(getFqn(region), key, object);
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
+ }
+ }
+
+ @Override
+ public void remove(String region, String key)
+ {
+ try
+ {
+ cache.remove(getFqn(region), key);
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
+ }
+
+ }
+
+ @Override
+ public TreeCache getDelegate()
+ {
+ return cache;
+ }
+
+ @Override
+ public void clear()
+ {
+ try
+ {
+ cache.remove(getFqn(null));
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/org/jboss/seam/cache/JbossCacheProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,130 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import org.jboss.cache.CacheException;
+import org.jboss.cache.aop.PojoCache;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+/**
+ * Implementation of CacheProvider backed by JBoss POJO Cache 1.x
+ *
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+
+@Name("org.jboss.seam.cache.cacheProvider")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(value = false, precedence = BUILT_IN, classDependencies="org.jboss.cache.aop.PojoCache")
+public class JbossPojoCacheProvider extends AbstractJBossCacheProvider<PojoCache>
+{
+
+ private PojoCache cache;
+
+ private static final LogProvider log = Logging.getLogProvider(JbossPojoCacheProvider.class);
+
+ @Create
+ public void create()
+ {
+ log.debug("Starting JBoss POJO Cache 1.x");
+
+ try
+ {
+ cache = new PojoCache();
+ new org.jboss.cache.PropertyConfigurator().configure(cache, getConfigurationAsStream());
+ cache.createService();
+ cache.startService();
+
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error starting JBoss POJO Cache 1.x", e);
+ }
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ log.debug("Stopping JBoss Treecache 1.x");
+
+ try
+ {
+ cache.stopService();
+ cache.destroyService();
+ }
+ catch (RuntimeException e)
+ {
+ throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
+ }
+ cache = null;
+ }
+
+ @Override
+ public Object get(String region, String key)
+ {
+ try
+ {
+ return cache.get(getFqn(key));
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
+ }
+ }
+
+ @Override
+ public void put(String region, String key, Object object)
+ {
+ try
+ {
+ cache.put(getFqn(region), key, object);
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
+ }
+ }
+
+ @Override
+ public void remove(String region, String key)
+ {
+ try
+ {
+ cache.remove(getFqn(region), key);
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
+ }
+
+ }
+
+ @Override
+ public PojoCache getDelegate()
+ {
+ return cache;
+ }
+
+ @Override
+ public void clear()
+ {
+ try
+ {
+ cache.remove(getFqn(null));
+ }
+ catch (CacheException e)
+ {
+ throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache/package-info.java
===================================================================
--- trunk/src/main/org/jboss/seam/cache/package-info.java (rev 0)
+++ trunk/src/main/org/jboss/seam/cache/package-info.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,9 @@
+/**
+ * A set of Seam components that provide caching
+ */
+@Namespace(value="http://jboss.com/products/seam/cache", prefix="org.jboss.seam.cache")
+@AutoCreate
+package org.jboss.seam.cache;
+
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Namespace;
Property changes on: trunk/src/main/org/jboss/seam/cache/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/org/jboss/seam/cache-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/cache-2.1.xsd (rev 0)
+++ trunk/src/main/org/jboss/seam/cache-2.1.xsd 2008-08-20 18:26:02 UTC (rev 8753)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/cache"
+ xmlns:cache="http://jboss.com/products/seam/cache"
+ xmlns:components="http://jboss.com/products/seam/components"
+ attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components"
+ schemaLocation="components-2.1.xsd" />
+
+ <xs:element name="eh-cache-provider">
+ <xs:annotation>
+ <xs:documentation>The EHCache provider</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="cache:attlist.cacheProvider" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="jboss-cache-provider">
+ <xs:annotation>
+ <xs:documentation>The JBoss 1.x Cache provider</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="cache:attlist.cacheProvider" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="jboss-cache2-provider">
+ <xs:annotation>
+ <xs:documentation>The JBoss 2.x cache provider</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="cache:attlist.cacheProvider" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="jboss-pojo-cache-provider">
+ <xs:annotation>
+ <xs:documentation>The JBoss 1.x POJOCache provider</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="cache:attlist.cacheProvider" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:attributeGroup name="attlist.cacheProvider">
+ <xs:attribute name="default-region" type="components:string" />
+ <xs:attribute name="configuration" type="components:string" />
+ </xs:attributeGroup>
+
+</xs:schema>
Property changes on: trunk/src/main/org/jboss/seam/cache-2.1.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/org/jboss/seam/core/PojoCache.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/PojoCache.java 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/src/main/org/jboss/seam/core/PojoCache.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -1,82 +0,0 @@
-//$Id$
-package org.jboss.seam.core;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Integration with JBoss Cache
- *
- * @author Gavin King
- *
- */
-@Name("org.jboss.seam.core.pojoCache")
-(a)Scope(ScopeType.APPLICATION)
-@BypassInterceptors
-@Install(value=false, precedence=BUILT_IN)
-public class PojoCache
-{
-
- private static final LogProvider log = Logging.getLogProvider(PojoCache.class);
-
- private org.jboss.cache.aop.PojoCache cache;
- private String cfgResourceName = "treecache.xml";
-
- @Create
- public void start() throws Exception
- {
- log.debug("starting JBoss Cache");
- cache = new org.jboss.cache.aop.PojoCache();
- new PropertyConfigurator().configure(cache, cfgResourceName);
- cache.createService();
- cache.startService();
- }
-
- @Destroy
- public void stop()
- {
- log.debug("stopping JBoss Cache");
- cache.stopService();
- cache.destroyService();
- cache = null;
- }
-
- @Unwrap
- public org.jboss.cache.aop.PojoCache getCache()
- {
- return cache;
- }
-
- public String getCfgResourceName()
- {
- return cfgResourceName;
- }
-
- public void setCfgResourceName(String cfgResourceName)
- {
- this.cfgResourceName = cfgResourceName;
- }
-
- public static org.jboss.cache.aop.PojoCache instance()
- {
- if ( !Contexts.isApplicationContextActive() )
- {
- throw new IllegalStateException("No active application scope");
- }
- return (org.jboss.cache.aop.PojoCache) Component.getInstance(PojoCache.class, ScopeType.APPLICATION);
- }
-
-}
Modified: trunk/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- trunk/src/main/org/jboss/seam/init/Initialization.java 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/src/main/org/jboss/seam/init/Initialization.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -42,7 +42,6 @@
import org.jboss.seam.contexts.ServletLifecycle;
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;
@@ -931,18 +930,7 @@
}
private void addSpecialComponents(Init init)
- {
- try
- {
- Reflections.classForName("org.jboss.cache.aop.PojoCache");
- addComponentDescriptor( new ComponentDescriptor(PojoCache.class, true) );
- }
- catch (ClassNotFoundException e) {}
- catch (NoClassDefFoundError e) {
- //temp solution due to broken JEMS installer portal profile!
- log.warn("Did not install PojoCache due to NoClassDefFoundError: " + e.getMessage());
- }
- }
+ {}
private void installComponents(Init init)
{
Modified: trunk/ui/src/main/config/component/cache.xml
===================================================================
--- trunk/ui/src/main/config/component/cache.xml 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/ui/src/main/config/component/cache.xml 2008-08-20 18:26:02 UTC (rev 8753)
@@ -7,7 +7,7 @@
<classname>org.jboss.seam.ui.component.html.HtmlCache</classname>
<superclass>org.jboss.seam.ui.component.UICache</superclass>
<description>
- <![CDATA[Cache the rendered page fragment using JBoss Cache. Note that <s:cache> actually uses the instance of JBoss Cache managed by the built-in pojoCache component.]]>
+ <![CDATA[Cache the rendered page fragment using the installed cache provider.]]>
</description>
<renderer generate="false" override="false">
<name>org.jboss.seam.ui.CacheRenderer</name>
@@ -36,8 +36,14 @@
<property>
<name>region</name>
<classname>java.lang.String</classname>
- <description>a JBoss Cache node to use (different nodes can have different expiry policies).</description>
+ <description>a cache node to use (different nodes can have different expiry policies).</description>
</property>
+ <property elonly="true">
+ <name>cacheProvider</name>
+ <classname>org.jboss.seam.cache.CacheProvider</classname>
+ <description>The cache provider to use, only needed if you install alter the default cache provider in an application where multiple cache providers are in use</description>
+ <defaultvalue>org.jboss.seam.cache.CacheProvider.instance()</defaultvalue>
+ </property>
<property elonly="true">
<name>enabled</name>
<classname>boolean</classname>
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/component/UICache.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/component/UICache.java 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/component/UICache.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -23,7 +23,9 @@
import javax.faces.component.UIComponentBase;
+import org.jboss.seam.cache.CacheProvider;
+
/**
* JSF component class
*
@@ -42,5 +44,9 @@
public abstract String getRegion();
public abstract void setRegion(String region);
+
+ public abstract CacheProvider getCacheProvider();
+
+ public abstract void setCacheProvider(CacheProvider cacheProvider);
}
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CacheRendererBase.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CacheRendererBase.java 2008-08-20 15:28:21 UTC (rev 8752)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CacheRendererBase.java 2008-08-20 18:26:02 UTC (rev 8753)
@@ -1,29 +1,34 @@
package org.jboss.seam.ui.renderkit;
-import java.io.IOException;
-import java.io.StringWriter;
+import org.jboss.seam.cache.CacheProvider;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.ui.component.UICache;
+import org.jboss.seam.ui.util.cdk.RendererBase;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
-import org.jboss.seam.core.PojoCache;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.ui.component.UICache;
-import org.jboss.seam.ui.util.cdk.RendererBase;
+public class CacheRendererBase extends RendererBase {
-public class CacheRendererBase extends RendererBase
-{
-
private static final LogProvider log = Logging.getLogProvider(UICache.class);
-
+
+ /**
+ * last time we logged the failure of the cache
+ */
+ private static Calendar lastLog = null;
+
@Override
protected Class getComponentClass()
{
return UICache.class;
}
-
+
@Override
protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException
{
@@ -31,7 +36,7 @@
if (cache.isEnabled())
{
String key = cache.getKey();
- String cachedContent = getFromCache(key, cache.getRegion());
+ String cachedContent = (String) cache.getCacheProvider().get(key, cache.getRegion());
if (cachedContent == null)
{
log.debug("rendering from scratch: " + key);
@@ -42,7 +47,7 @@
context.setResponseWriter(writer);
String output = stringWriter.getBuffer().toString();
writer.write(output);
- putInCache(key, cache.getRegion(), output);
+ cache.getCacheProvider().put(key, cache.getRegion(), output);
}
else
{
@@ -55,33 +60,7 @@
renderChildren(context, component);
}
}
-
- private static void putInCache(String key, String region, String content)
- {
- try
- {
- PojoCache.instance().put(region, key, content);
- }
- catch (Exception ce)
- {
- log.error("error accessing cache", ce);
- }
- }
-
- private static String getFromCache(String key, String region)
- {
- try
- {
- return (String) PojoCache.instance().get(region, key);
- }
- catch (Exception ce)
- {
- log.error("error accessing cache", ce);
- return null;
- }
- }
-
@Override
public boolean getRendersChildren()
{
15 years, 8 months
Seam SVN: r8752 - in branches/Seam_2_0_FP/examples: groovybooking/src/action/org/jboss/seam/example/groovy and 5 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-20 11:28:21 -0400 (Wed, 20 Aug 2008)
New Revision: 8752
Modified:
branches/Seam_2_0_FP/examples/booking/src/org/jboss/seam/example/booking/BookingListAction.java
branches/Seam_2_0_FP/examples/groovybooking/src/action/org/jboss/seam/example/groovy/BookingListAction.groovy
branches/Seam_2_0_FP/examples/hibernate/src/org/jboss/seam/example/hibernate/BookingListAction.java
branches/Seam_2_0_FP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
branches/Seam_2_0_FP/examples/jpa/src/org/jboss/seam/example/jpa/BookingListAction.java
branches/Seam_2_0_FP/examples/nestedbooking/src/org/jboss/seam/example/booking/BookingListAction.java
branches/Seam_2_0_FP/examples/spring/src/org/jboss/seam/example/spring/BookingListAction.java
Log:
JBPAPP-1094
Modified: branches/Seam_2_0_FP/examples/booking/src/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/booking/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/booking/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -63,7 +63,7 @@
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
Modified: branches/Seam_2_0_FP/examples/groovybooking/src/action/org/jboss/seam/example/groovy/BookingListAction.groovy
===================================================================
--- branches/Seam_2_0_FP/examples/groovybooking/src/action/org/jboss/seam/example/groovy/BookingListAction.groovy 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/groovybooking/src/action/org/jboss/seam/example/groovy/BookingListAction.groovy 2008-08-20 15:28:21 UTC (rev 8752)
@@ -51,7 +51,7 @@
Booking cancelled = em.find(Booking.class, booking.id)
if (cancelled != null) em.remove( cancelled )
getBookings()
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}", new Object[0])
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId())
}
}
Modified: branches/Seam_2_0_FP/examples/hibernate/src/org/jboss/seam/example/hibernate/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/hibernate/src/org/jboss/seam/example/hibernate/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/hibernate/src/org/jboss/seam/example/hibernate/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -56,7 +56,7 @@
Booking cancelled = (Booking) bookingDatabase.get(Booking.class, booking.getId());
if (cancelled!=null) bookingDatabase.delete( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
Modified: branches/Seam_2_0_FP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -63,7 +63,7 @@
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
Modified: branches/Seam_2_0_FP/examples/jpa/src/org/jboss/seam/example/jpa/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/jpa/src/org/jboss/seam/example/jpa/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/jpa/src/org/jboss/seam/example/jpa/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -57,7 +57,7 @@
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
Modified: branches/Seam_2_0_FP/examples/nestedbooking/src/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/nestedbooking/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/nestedbooking/src/org/jboss/seam/example/booking/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -59,7 +59,7 @@
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
Modified: branches/Seam_2_0_FP/examples/spring/src/org/jboss/seam/example/spring/BookingListAction.java
===================================================================
--- branches/Seam_2_0_FP/examples/spring/src/org/jboss/seam/example/spring/BookingListAction.java 2008-08-20 14:49:55 UTC (rev 8751)
+++ branches/Seam_2_0_FP/examples/spring/src/org/jboss/seam/example/spring/BookingListAction.java 2008-08-20 15:28:21 UTC (rev 8752)
@@ -50,7 +50,7 @@
log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
bookingService.cancelBooking(booking.getId());
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
}
public Booking getBooking()
15 years, 8 months