JBoss Cache SVN: r5936 - core/trunk/src/main/docbook/userguide/en/modules.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 06:48:44 -0400 (Tue, 03 Jun 2008)
New Revision: 5936
Modified:
core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
Log:
Updated docs on cache listeners
Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-06-03 10:37:56 UTC (rev 5935)
+++ core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-06-03 10:48:44 UTC (rev 5936)
@@ -388,23 +388,31 @@
<section id="api.listener">
<title>
- Adding a CacheListener
+ Adding a Cache Listener - registering for cache events
</title>
<para>
- The
- <literal>@org.jboss.cache.notifications.annotation.CacheListener</literal>
- annotation is a convenient
- mechanism for receiving notifications from a cache about events that happen in the cache. Classes annotated
- with
+ JBoss Cache provides a convenient mechanism for registering notifications on cache events.
+ </para>
+ <programlisting role="JAVA"><![CDATA[
+ Object myListener = new MyCacheListener();
+ cache.addCacheListener(myListener);
+ ]]></programlisting>
+ <para>
+ Similar methods exist for removing or querying registered listeners. See the javadocs on the
+ <literal>Cache</literal>
+ interface for more details.
+ </para>
+ <para>
+ Basically any public class can be used as a listener, provided it is annotated with the
<literal>@CacheListener</literal>
- need to be public classes. In addition, the class needs to have one or
+ annotation. In addition, the class needs to have one or
more methods annotated with one of the method-level annotations (in the
<literal>org.jboss.cache.notifications.annotation</literal>
package). Methods annotated as such need to be public, have a void return type, and accept a single parameter
of
type
<literal>org.jboss.cache.notifications.event.Event</literal>
- or one of it's subtypes.
+ or one of its subtypes.
<itemizedlist>
<listitem>
@@ -412,7 +420,7 @@
<literal>@CacheStarted</literal>
- methods annotated such receive a notification when the cache is
started. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.CacheStartedEvent</literal>
+ <literal>CacheStartedEvent</literal>
.
</para>
</listitem>
@@ -422,7 +430,7 @@
<literal>@CacheStopped</literal>
- methods annotated such receive a notification when the cache is
stopped. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.CacheStoppedEvent</literal>
+ <literal>CacheStoppedEvent</literal>
.
</para>
</listitem>
@@ -432,7 +440,7 @@
<literal>@NodeCreated</literal>
- methods annotated such receive a notification when a node is
created. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeCreatedEvent</literal>
+ <literal>NodeCreatedEvent</literal>
.
</para>
</listitem>
@@ -442,7 +450,7 @@
<literal>@NodeRemoved</literal>
- methods annotated such receive a notification when a node is
removed. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeRemovedEvent</literal>
+ <literal>NodeRemovedEvent</literal>
.
</para>
</listitem>
@@ -452,7 +460,7 @@
<literal>@NodeModified</literal>
- methods annotated such receive a notification when a node is
modified. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeModifiedEvent</literal>
+ <literal>NodeModifiedEvent</literal>
.
</para>
</listitem>
@@ -462,7 +470,7 @@
<literal>@NodeMoved</literal>
- methods annotated such receive a notification when a node is
moved. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeMovedEvent</literal>
+ <literal>NodeMovedEvent</literal>
.
</para>
</listitem>
@@ -472,7 +480,7 @@
<literal>@NodeVisited</literal>
- methods annotated such receive a notification when a node is
started. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeVisitedEvent</literal>
+ <literal>NodeVisitedEvent</literal>
.
</para>
</listitem>
@@ -484,7 +492,7 @@
loaded from a
<literal>CacheLoader</literal>
. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeLoadedEvent</literal>
+ <literal>NodeLoadedEvent</literal>
.
</para>
</listitem>
@@ -494,7 +502,7 @@
<literal>@NodeEvicted</literal>
- methods annotated such receive a notification when a node is
evicted from memory. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeEvictedEvent</literal>
+ <literal>NodeEvictedEvent</literal>
.
</para>
</listitem>
@@ -504,7 +512,7 @@
<literal>@NodeActivated</literal>
- methods annotated such receive a notification when a node is
activated. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodeActivatedEvent</literal>
+ <literal>NodeActivatedEvent</literal>
.
</para>
</listitem>
@@ -514,7 +522,7 @@
<literal>@NodePassivated</literal>
- methods annotated such receive a notification when a node is
passivated. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.NodePassivatedEvent</literal>
+ <literal>NodePassivatedEvent</literal>
.
</para>
</listitem>
@@ -527,7 +535,7 @@
<literal>javax.transaction.Synchronization</literal>
with a registered transaction manager.
Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.TransactionRegisteredEvent</literal>
+ <literal>TransactionRegisteredEvent</literal>
.
</para>
</listitem>
@@ -538,7 +546,7 @@
- methods annotated such receive a notification when the cache
receives a commit or rollback call from a registered transaction manager.
Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.TransactionCompletedEvent</literal>
+ <literal>TransactionCompletedEvent</literal>
.
</para>
</listitem>
@@ -548,7 +556,7 @@
<literal>@ViewChanged</literal>
- methods annotated such receive a notification when the group structure
of the cluster changes. Methods need to accept a parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.ViewChangedEvent</literal>
+ <literal>ViewChangedEvent</literal>
.
</para>
</listitem>
@@ -559,7 +567,7 @@
- methods annotated such receive a notification when the cluster
requests that cache operations are blocked for a state transfer event. Methods need to accept a
parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.CacheBlockedEvent</literal>
+ <literal>CacheBlockedEvent</literal>
.
</para>
</listitem>
@@ -570,7 +578,7 @@
- methods annotated such receive a notification when the cluster
requests that cache operations are unblocked after a state transfer event. Methods need to accept a
parameter type which is assignable from
- <literal>org.jboss.cache.notifications.event.CacheUnblockedEvent</literal>
+ <literal>CacheUnblockedEvent</literal>
.
</para>
</listitem>
15 years, 10 months
JBoss Cache SVN: r5935 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 06:37:56 -0400 (Tue, 03 Jun 2008)
New Revision: 5935
Modified:
core/trunk/pom.xml
Log:
Removed duplicate dep
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2008-06-03 09:22:58 UTC (rev 5934)
+++ core/trunk/pom.xml 2008-06-03 10:37:56 UTC (rev 5935)
@@ -61,11 +61,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
<!-- optional dependencies -->
<dependency>
15 years, 10 months
JBoss Cache SVN: r5934 - in searchable/trunk/src/test: resources and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 05:22:58 -0400 (Tue, 03 Jun 2008)
New Revision: 5934
Added:
searchable/trunk/src/test/resources/
searchable/trunk/src/test/resources/log4j.xml
Log:
Structure
Added: searchable/trunk/src/test/resources/log4j.xml
===================================================================
--- searchable/trunk/src/test/resources/log4j.xml (rev 0)
+++ searchable/trunk/src/test/resources/log4j.xml 2008-06-03 09:22:58 UTC (rev 5934)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 5726 2008-04-28 15:41:51Z mircea.markus $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="../jbosscache-searchable.log"/>
+ <param name="Append" value="true"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+ <param name="Threshold" value="TRACE"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Threshold" value="TRACE"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c{1}] (%t) %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss.cache.search">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jboss.cache">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jboss.cache.factories">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jboss.tm">
+ <priority value="WARN"/>
+ </category>
+
+ <category name="org.jgroups">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--<appender-ref ref="CONSOLE"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
15 years, 10 months
JBoss Cache SVN: r5933 - in searchable/trunk: assembly and 3 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 05:21:39 -0400 (Tue, 03 Jun 2008)
New Revision: 5933
Added:
searchable/trunk/assembly/
searchable/trunk/assembly/all.xml
searchable/trunk/assembly/bin.xml
searchable/trunk/assembly/doc.xml
searchable/trunk/pom.xml
searchable/trunk/src/
searchable/trunk/src/main/
searchable/trunk/src/main/java/
searchable/trunk/src/test/
searchable/trunk/src/test/java/
Log:
Structure
Added: searchable/trunk/assembly/all.xml
===================================================================
--- searchable/trunk/assembly/all.xml (rev 0)
+++ searchable/trunk/assembly/all.xml 2008-06-03 09:21:39 UTC (rev 5933)
@@ -0,0 +1,84 @@
+<assembly>
+ <id>all</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>true</includeBaseDirectory>
+
+ <fileSets>
+
+ <!-- code -->
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory/>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>*test*.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- resources -->
+ <fileSet>
+ <directory>src/main/etc</directory>
+ <outputDirectory>etc</outputDirectory>
+ </fileSet>
+
+ <!-- srcs -->
+ <fileSet>
+ <directory>src/main/java</directory>
+ <outputDirectory>src</outputDirectory>
+ </fileSet>
+
+ <!-- tests -->
+ <fileSet>
+ <directory>src/test/java</directory>
+ <outputDirectory>test</outputDirectory>
+ </fileSet>
+
+ <!-- test resources -->
+ <fileSet>
+ <directory>src/test/resources</directory>
+ <outputDirectory>test</outputDirectory>
+ </fileSet>
+
+ <!-- EULAs and license files -->
+ <fileSet>
+ <directory>src/main/release</directory>
+ <outputDirectory/>
+ <includes>
+ <include>**/*.txt</include>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+
+ <!-- docs -->
+ <fileSet>
+ <directory>target/site/apidocs</directory>
+ <outputDirectory>doc/apidocs</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/docbook</directory>
+ <outputDirectory>doc/</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+ <!-- Make sure we filter out the junk that jboss-common-core pulls in -->
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <outputFileNameMapping>${scope}/${artifactId}.${extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ <scope>test</scope>
+ <excludes>
+ <exclude>apache-xerces:xml-apis</exclude>
+ <exclude>apache-httpclient:commons-httpclient</exclude>
+ <exclude>apache-slide:webdavlib</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Added: searchable/trunk/assembly/bin.xml
===================================================================
--- searchable/trunk/assembly/bin.xml (rev 0)
+++ searchable/trunk/assembly/bin.xml 2008-06-03 09:21:39 UTC (rev 5933)
@@ -0,0 +1,55 @@
+<assembly>
+ <id>bin</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>true</includeBaseDirectory>
+
+ <fileSets>
+ <!-- code -->
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory/>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>*test*.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- resources -->
+ <fileSet>
+ <directory>src/main/etc</directory>
+ <outputDirectory>etc</outputDirectory>
+ </fileSet>
+
+ <!-- EULAs and license files -->
+ <fileSet>
+ <directory>src/main/release</directory>
+ <outputDirectory/>
+ <includes>
+ <include>**/*.txt</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+ <!-- Make sure we filter out the junk that jboss-common-core pulls in -->
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ <scope>runtime</scope>
+ <excludes>
+ <exclude>apache-xerces:xml-apis</exclude>
+ <exclude>apache-httpclient:commons-httpclient</exclude>
+ <exclude>apache-slide:webdavlib</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
Added: searchable/trunk/assembly/doc.xml
===================================================================
--- searchable/trunk/assembly/doc.xml (rev 0)
+++ searchable/trunk/assembly/doc.xml 2008-06-03 09:21:39 UTC (rev 5933)
@@ -0,0 +1,36 @@
+<assembly>
+ <id>doc</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>true</includeBaseDirectory>
+
+ <fileSets>
+ <!-- EULAs and license files -->
+ <fileSet>
+ <directory>src/main/release</directory>
+ <outputDirectory/>
+ <includes>
+ <include>*.txt</include>
+ </includes>
+ <excludes>
+ <exclude>**lib**</exclude>
+ <exclude>license/*</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- docs -->
+ <fileSet>
+ <directory>target/site/apidocs</directory>
+ <outputDirectory>doc/apidocs</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/docbook</directory>
+ <outputDirectory>doc/</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
Added: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml (rev 0)
+++ searchable/trunk/pom.xml 2008-06-03 09:21:39 UTC (rev 5933)
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <properties>
+ <jbosscache-searchable-version>0.1-SNAPSHOT</jbosscache-searchable-version>
+ <!-- By default only run tests in the "unit" group -->
+ <defaultTestGroup>unit</defaultTestGroup>
+ <!-- By default only generate Javadocs when we install the module. -->
+ <javadocPhase>install</javadocPhase>
+ </properties>
+
+ <parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-common-parent</artifactId>
+ <version>1.3</version>
+ </parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-searchable</artifactId>
+ <version>${jbosscache-searchable-version}</version>
+ <name>JBoss Cache - Searchable Edition</name>
+ <description>JBoss Cache - Searchable Edition</description>
+ <url>http://www.jbosscache.org</url>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>2.2.0.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>3.0.1.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-1</version>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>install</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>assembly/bin.xml</descriptor>
+ <descriptor>assembly/doc.xml</descriptor>
+ <descriptor>assembly/all.xml</descriptor>
+ </descriptors>
+ <finalName>${artifactId}-${jbosscache-searchable-version}</finalName>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <mainClass>org.jboss.cache.Version</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-test-jar</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ <!-- For Amazon S3 artifacts -->
+ <repository>
+ <id>e-xml.sourceforge.net</id>
+ <url>http://e-xml.sourceforge.net/maven2/repository</url>
+ </repository>
+ </repositories>
+</project>
15 years, 10 months
JBoss Cache SVN: r5932 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 05:07:23 -0400 (Tue, 03 Jun 2008)
New Revision: 5932
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
Log:
Changed preload prio
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-06-03 09:04:06 UTC (rev 5931)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-06-03 09:07:23 UTC (rev 5932)
@@ -290,28 +290,32 @@
*
* @throws Exception
*/
+ @Start(priority = 50)
public void preloadCache() throws CacheException
{
- if (config.getPreload() == null || config.getPreload().equals("")) return;
- if (log.isDebugEnabled()) log.debug("preloading transient state from cache loader " + loader);
- StringTokenizer st = new StringTokenizer(config.getPreload(), ",");
- String tok;
- Fqn fqn;
- long start, stop, total;
- start = System.currentTimeMillis();
- while (st.hasMoreTokens())
+ if (loader != null)
{
- tok = st.nextToken();
- fqn = Fqn.fromString(tok.trim());
- if (log.isTraceEnabled()) log.trace("preloading " + fqn);
- preload(fqn, true, true);
- }
+ if (config.getPreload() == null || config.getPreload().equals("")) return;
+ if (log.isDebugEnabled()) log.debug("preloading transient state from cache loader " + loader);
+ StringTokenizer st = new StringTokenizer(config.getPreload(), ",");
+ String tok;
+ Fqn fqn;
+ long start, stop, total;
+ start = System.currentTimeMillis();
+ while (st.hasMoreTokens())
+ {
+ tok = st.nextToken();
+ fqn = Fqn.fromString(tok.trim());
+ if (log.isTraceEnabled()) log.trace("preloading " + fqn);
+ preload(fqn, true, true);
+ }
- stop = System.currentTimeMillis();
- total = stop - start;
- if (log.isDebugEnabled())
- {
- log.debug("preloading transient state from cache loader was successful (in " + total + " milliseconds)");
+ stop = System.currentTimeMillis();
+ total = stop - start;
+ if (log.isDebugEnabled())
+ {
+ log.debug("preloading transient state from cache loader was successful (in " + total + " milliseconds)");
+ }
}
}
@@ -442,8 +446,6 @@
loader.start();
purgeLoaders(false);
-
- preloadCache();
}
catch (Exception e)
{
15 years, 10 months
JBoss Cache SVN: r5931 - searchable.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 05:04:06 -0400 (Tue, 03 Jun 2008)
New Revision: 5931
Added:
searchable/trunk/
Log:
15 years, 10 months
JBoss Cache SVN: r5930 - /.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-03 05:02:51 -0400 (Tue, 03 Jun 2008)
New Revision: 5930
Added:
searchable/
Log:
15 years, 10 months
JBoss Cache SVN: r5929 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-02 19:39:36 -0400 (Mon, 02 Jun 2008)
New Revision: 5929
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/ConcurrentPutRemoveEvictTest.java
Log:
Disable hanging test
Modified: core/trunk/src/test/java/org/jboss/cache/loader/ConcurrentPutRemoveEvictTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/ConcurrentPutRemoveEvictTest.java 2008-06-02 16:27:50 UTC (rev 5928)
+++ core/trunk/src/test/java/org/jboss/cache/loader/ConcurrentPutRemoveEvictTest.java 2008-06-02 23:39:36 UTC (rev 5929)
@@ -21,7 +21,8 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
-@Test(groups = "functional")
+@Test(groups = "functional", enabled = false)
+// TODO: 2.2.0: Figure out why this occasionally hangs!!
public class ConcurrentPutRemoveEvictTest extends AbstractCacheLoaderTestBase
{
Cache<String, String> cache;
15 years, 10 months
JBoss Cache SVN: r5928 - core/trunk/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-02 12:27:50 -0400 (Mon, 02 Jun 2008)
New Revision: 5928
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java
Log:
increased the chance of implicit tx failures
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-06-02 16:12:44 UTC (rev 5927)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-06-02 16:27:50 UTC (rev 5928)
@@ -98,7 +98,10 @@
try
{
latch.await();
- c.put("/a", "k", "v");
+ for (int i=0;i<5; i++)
+ {
+ c.put("/a", "k", "v");
+ }
}
catch (Exception e)
{
15 years, 10 months
JBoss Cache SVN: r5927 - in core/trunk/src/test/java/org/jboss/cache: util/internals and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-02 12:12:44 -0400 (Mon, 02 Jun 2008)
New Revision: 5927
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncCacheTest.java
core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java
Log:
rolledback thread sleeps removals - new view propagation does not necesarily mean that state transfer is finished
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncCacheTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncCacheTest.java 2008-06-02 15:20:57 UTC (rev 5926)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/AsyncCacheTest.java 2008-06-02 16:12:44 UTC (rev 5927)
@@ -9,7 +9,6 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.util.TestingUtil;
-import org.jboss.cache.util.internals.ReplicationListener;
import org.jboss.cache.transaction.TransactionSetup;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -23,14 +22,12 @@
public class AsyncCacheTest extends AbstractOptimisticTestCase
{
private CacheSPI<Object, Object> cache, cache2;
- ReplicationListener replListener2;
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
cache = createReplicatedCache(Configuration.CacheMode.REPL_ASYNC);
cache2 = createReplicatedCache(Configuration.CacheMode.REPL_ASYNC);
- replListener2 = new ReplicationListener(cache2);
}
@AfterMethod(alwaysRun = true)
@@ -66,13 +63,11 @@
SamplePojo pojo = new SamplePojo(21, "test");
- replListener2.expectAny();
cache.put("/one/two", "key1", pojo);
//GlobalTransaction globalTransaction = cache.getCurrentTransaction(tx);
assertNotNull(mgr.getTransaction());
mgr.commit();
- replListener2.waitForReplicationToOccur(1000);
assertNull(mgr.getTransaction());
@@ -84,6 +79,8 @@
assertTrue(cache.exists(Fqn.fromString("/one")));
assertEquals(pojo, cache.get(Fqn.fromString("/one/two"), "key1"));
+ // allow changes to replicate since this is async
+ TestingUtil.sleepThread((long) 1000);
assertEquals(0, cache2.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache2.getTransactionTable().getNumLocalTransactions());
@@ -109,12 +106,10 @@
SamplePojo pojo = new SamplePojo(21, "test");
- replListener2.expectAny();
cache.put("/one/two", "key1", pojo);
assertNotNull(mgr.getTransaction());
mgr.commit();
- replListener2.waitForReplicationToOccur(1000);
assertNull(mgr.getTransaction());
@@ -126,7 +121,9 @@
assertTrue(cache.exists(Fqn.fromString("/one")));
assertEquals(pojo, cache.get(Fqn.fromString("/one/two"), "key1"));
-
+ // let the async calls complete
+ TestingUtil.sleepThread((long) 1000);
+
assertEquals(0, cache2.getTransactionTable().getNumGlobalTransactions());
assertEquals(0, cache2.getTransactionTable().getNumLocalTransactions());
Modified: core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java 2008-06-02 15:20:57 UTC (rev 5926)
+++ core/trunk/src/test/java/org/jboss/cache/util/internals/ReplicationListener.java 2008-06-02 16:12:44 UTC (rev 5927)
@@ -119,6 +119,7 @@
}
finally
{
+ System.out.println("Processed command: " + realOne);
Iterator<Class<? extends ReplicableCommand>> it = expectedCommands.iterator();
while (it.hasNext())
{
@@ -209,7 +210,9 @@
*/
public void waitForReplicationToOccur(long timeoutMillis)
{
+ System.out.println("enter... ReplicationListener.waitForReplicationToOccur");
waitForReplicationToOccur(timeoutMillis, TimeUnit.MILLISECONDS);
+ System.out.println("exit... ReplicationListener.waitForReplicationToOccur");
}
/**
15 years, 10 months