Author: manik.surtani(a)jboss.com
Date: 2009-02-05 08:00:20 -0500 (Thu, 05 Feb 2009)
New Revision: 7654
Added:
core/trunk/src/test/java/org/jboss/cache/jmx/JmxManualTest.java
Modified:
core/trunk/pom.xml
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/Version.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
Log:
re-introduced fixes from rev 7641, 7639 and 7636
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-02-05 01:58:42 UTC (rev 7653)
+++ core/trunk/pom.xml 2009-02-05 13:00:20 UTC (rev 7654)
@@ -2,501 +2,504 @@
<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-core-version>3.0.3-SNAPSHOT</jbosscache-core-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>
+ <modelVersion>4.0.0</modelVersion>
+ <properties>
+ <jbosscache-core-version>3.1.0-SNAPSHOT</jbosscache-core-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.5</version>
- </parent>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>${jbosscache-core-version}</version>
- <name>JBoss Cache - Core Edition</name>
- <description>JBoss Cache - Core Edition</description>
- <url>http://www.jbosscache.org</url>
- <packaging>jar</packaging>
- <dependencies>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.6.7.GA</version>
- </dependency>
+ <parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-common-parent</artifactId>
+ <version>1.5</version>
+ </parent>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>${jbosscache-core-version}</version>
+ <name>JBoss Cache - Core Edition</name>
+ <description>JBoss Cache - Core Edition</description>
+ <url>http://www.jbosscache.org</url>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>2.6.7.GA</version>
+ </dependency>
- <!--
- For the JTA 1.1 API; consuming projects can safely
- exclude this and replace with any valid source of this API, such as a Java EE
app server.
- -->
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- </dependency>
+ <!--
+ For the JTA 1.1 API; consuming projects can safely
+ exclude this and replace with any valid source of this API, such as a Java
EE app server.
+ -->
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.10.GA</version>
- </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.10.GA</version>
+ </dependency>
- <!-- optional dependencies -->
- <dependency>
- <groupId>jdbm</groupId>
- <artifactId>jdbm</artifactId>
- <version>1.0</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>c3p0</groupId>
- <artifactId>c3p0</artifactId>
- <version>0.9.1.2</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>sleepycat</groupId>
- <artifactId>je</artifactId>
- <version>3.2.43</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>net.jcip</groupId>
- <artifactId>jcip-annotations</artifactId>
- <version>1.0</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>net.noderunner</groupId>
- <artifactId>amazon-s3</artifactId>
- <version>1.0.0.0</version>
- <optional>true</optional>
- </dependency>
+ <!-- optional dependencies -->
+ <dependency>
+ <groupId>jdbm</groupId>
+ <artifactId>jdbm</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>c3p0</groupId>
+ <artifactId>c3p0</artifactId>
+ <version>0.9.1.2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>sleepycat</groupId>
+ <artifactId>je</artifactId>
+ <version>3.2.43</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.noderunner</groupId>
+ <artifactId>amazon-s3</artifactId>
+ <version>1.0.0.0</version>
+ <optional>true</optional>
+ </dependency>
- <!-- test dependencies -->
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.7</version>
- <scope>test</scope>
- </dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossjta</artifactId>
- <version>4.4.0.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>beanshell</groupId>
- <artifactId>bsh</artifactId>
- <version>2.0b4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.noderunner</groupId>
- <artifactId>http</artifactId>
- <version>1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>test</scope>
- </dependency>
- <!-- 5.8 is needed for proper parallel test execution -->
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.8</version>
- <scope>test</scope>
- <classifier>jdk15</classifier>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjta</artifactId>
+ <version>4.4.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>beanshell</groupId>
+ <artifactId>bsh</artifactId>
+ <version>2.0b4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.noderunner</groupId>
+ <artifactId>http</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- 5.8 is needed for proper parallel test execution -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <!-- ensure parallel test execution -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3-JBOSS</version>
- <configuration>
- <parallel>tests</parallel>
- <threadCount>10</threadCount>
- <forkMode>none</forkMode>
- <systemProperties>
- <property>
- <name>jgroups.stack</name>
- <value>${protocol.stack}</value>
- </property>
- </systemProperties>
- <trimStackTrace>false</trimStackTrace>
- <properties>
- <property>
- <name>listener</name>
-
<value>org.jboss.cache.util.UnitTestTestNGListener</value>
- </property>
- </properties>
- </configuration>
- </plugin>
- <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>
- <descriptor>assembly/src.xml</descriptor>
- </descriptors>
-
<finalName>${artifactId}-${jbosscache-core-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>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4.3-JBOSS</version>
- </plugin>
- </plugins>
- </reporting>
-
- <!-- 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>
-
- <profiles>
- <profile>
- <!-- This testMoreState generates Javadocs and the UserGuide, FAQs and
Tutorial in the "package" phase. -->
- <id>Docs</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <!-- override to generate javadocs in the "package" phase
-->
- <javadocPhase>package</javadocPhase>
- </properties>
- <build>
- <plugins>
- <!-- the docbook generation plugin for the user guide -->
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.0.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <executions>
-
- <!-- The User Guide-->
- <execution>
- <id>userguide_en</id>
- <phase>package</phase>
+ <build>
+ <plugins>
+ <!-- ensure parallel test execution -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3-JBOSS</version>
+ <configuration>
+ <parallel>tests</parallel>
+ <threadCount>10</threadCount>
+ <forkMode>none</forkMode>
+ <systemProperties>
+ <property>
+ <name>jgroups.stack</name>
+ <value>${protocol.stack}</value>
+ </property>
+ </systemProperties>
+ <trimStackTrace>false</trimStackTrace>
+ <properties>
+ <property>
+ <name>listener</name>
+
<value>org.jboss.cache.util.UnitTestTestNGListener</value>
+ </property>
+ </properties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-1</version>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>install</phase>
<goals>
- <goal>resources</goal>
- <goal>generate</goal>
+ <goal>attached</goal>
</goals>
<configuration>
-
<sourceDocumentName>master.xml</sourceDocumentName>
-
<sourceDirectory>${basedir}/src/main/docbook/userguide/en</sourceDirectory>
- <imageResource>
-
<directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
-
<directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
-
<targetDirectory>${basedir}/target/docbook/userguide_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>userguide_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
+ <descriptors>
+ <descriptor>assembly/bin.xml</descriptor>
+ <descriptor>assembly/doc.xml</descriptor>
+ <descriptor>assembly/all.xml</descriptor>
+ <descriptor>assembly/src.xml</descriptor>
+ </descriptors>
+
<finalName>${artifactId}-${jbosscache-core-version}</finalName>
+
<outputDirectory>target/distribution</outputDirectory>
+
<workDirectory>target/assembly/work</workDirectory>
</configuration>
- </execution>
-
- <!-- The Tutorial -->
- <execution>
- <id>tutorial_en</id>
- <phase>package</phase>
+ </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>resources</goal>
- <goal>generate</goal>
+ <goal>test-jar</goal>
</goals>
<configuration>
-
<sourceDocumentName>master.xml</sourceDocumentName>
-
<sourceDirectory>${basedir}/src/main/docbook/tutorial/en</sourceDirectory>
- <imageResource>
-
<directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
-
<directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
-
<targetDirectory>${basedir}/target/docbook/tutorial_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>tutorial_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
+ <archive>
+ <manifest>
+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ </archive>
</configuration>
- </execution>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3-JBOSS</version>
+ </plugin>
+ </plugins>
+ </reporting>
- <!-- the FAQs -->
- <execution>
- <id>faq_en</id>
- <phase>package</phase>
- <goals>
- <goal>resources</goal>
- <goal>generate</goal>
- </goals>
- <configuration>
-
<sourceDocumentName>master.xml</sourceDocumentName>
-
<sourceDirectory>${basedir}/src/main/docbook/faq/en</sourceDirectory>
- <imageResource>
-
<directory>${basedir}/src/main/docbook/images</directory>
- </imageResource>
- <cssResource>
-
<directory>${basedir}/src/main/docbook/css</directory>
- </cssResource>
-
<targetDirectory>${basedir}/target/docbook/faq_en</targetDirectory>
- <formats>
- <format>
- <formatName>pdf</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>faq_en.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
-
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- 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>
- <profile>
- <id>test-hudson</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <defaultTestGroup>functional,unit</defaultTestGroup>
- <protocol.stack>tcp</protocol.stack>
- </properties>
- </profile>
+ <profiles>
+ <profile>
+ <!-- This testMoreState generates Javadocs and the UserGuide, FAQs and
Tutorial in the "package" phase. -->
+ <id>Docs</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <!-- override to generate javadocs in the "package" phase
-->
+ <javadocPhase>package</javadocPhase>
+ </properties>
+ <build>
+ <plugins>
+ <!-- the docbook generation plugin for the user guide -->
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.0.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+
<artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+
<artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <executions>
- <profile>
- <id>test-functional</id>
- <properties>
- <defaultTestGroup>functional</defaultTestGroup>
- <protocol.stack>tcp</protocol.stack>
- </properties>
- </profile>
+ <!-- The User Guide-->
+ <execution>
+ <id>userguide_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+
<sourceDocumentName>master.xml</sourceDocumentName>
+
<sourceDirectory>${basedir}/src/main/docbook/userguide/en</sourceDirectory>
+ <imageResource>
+
<directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+
<directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+
<targetDirectory>${basedir}/target/docbook/userguide_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+
<finalName>userguide_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ <format>
+
<formatName>html_single</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
+ </stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+
<xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
- <profile>
- <id>test-unit</id>
- <properties>
- <defaultTestGroup>unit</defaultTestGroup>
- </properties>
- </profile>
+ <!-- The Tutorial -->
+ <execution>
+ <id>tutorial_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+
<sourceDocumentName>master.xml</sourceDocumentName>
+
<sourceDirectory>${basedir}/src/main/docbook/tutorial/en</sourceDirectory>
+ <imageResource>
+
<directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+
<directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+
<targetDirectory>${basedir}/target/docbook/tutorial_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+
<finalName>tutorial_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ <format>
+
<formatName>html_single</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
+ </stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+
<xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
- <profile>
- <id>test-jgroups</id>
- <properties>
- <defaultTestGroup>jgroups</defaultTestGroup>
- </properties>
- </profile>
+ <!-- the FAQs -->
+ <execution>
+ <id>faq_en</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+
<sourceDocumentName>master.xml</sourceDocumentName>
+
<sourceDirectory>${basedir}/src/main/docbook/faq/en</sourceDirectory>
+ <imageResource>
+
<directory>${basedir}/src/main/docbook/images</directory>
+ </imageResource>
+ <cssResource>
+
<directory>${basedir}/src/main/docbook/css</directory>
+ </cssResource>
+
<targetDirectory>${basedir}/target/docbook/faq_en</targetDirectory>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+
<finalName>faq_en.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ <format>
+
<formatName>html_single</formatName>
+
<stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
+ </stylesheetResource>
+
<finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+
<xincludeSupported>false</xincludeSupported>
+ </options>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <profile>
- <id>test-transaction</id>
- <properties>
- <defaultTestGroup>transaction</defaultTestGroup>
- </properties>
- </profile>
+ <profile>
+ <id>test-hudson</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <defaultTestGroup>functional,unit</defaultTestGroup>
+ <protocol.stack>tcp</protocol.stack>
+ </properties>
+ </profile>
- <profile>
- <id>profiling</id>
- <properties>
- <defaultTestGroup>profiling</defaultTestGroup>
- </properties>
- </profile>
+ <profile>
+ <id>test-functional</id>
+ <properties>
+ <defaultTestGroup>functional</defaultTestGroup>
+ <protocol.stack>tcp</protocol.stack>
+ </properties>
+ </profile>
- <profile>
- <id>test-integration</id>
- <properties>
- <defaultTestGroup>integration</defaultTestGroup>
- <protocol.stack>udp</protocol.stack>
- </properties>
- </profile>
+ <profile>
+ <id>test-unit</id>
+ <properties>
+ <defaultTestGroup>unit</defaultTestGroup>
+ </properties>
+ </profile>
+ <profile>
+ <id>test-jgroups</id>
+ <properties>
+ <defaultTestGroup>jgroups</defaultTestGroup>
+ </properties>
+ </profile>
- <profile>
- <id>JBossAS</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
-
<jbosscache-core-version>3.0.3-SNAPSHOT-JBossAS</jbosscache-core-version>
- <defaultTestGroup>functional,unit</defaultTestGroup>
- <protocol.stack>tcp</protocol.stack>
- </properties>
- <dependencies>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.6.7.GA</version>
- </dependency>
- <!-- Replaces javax.transaction/jta -->
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-javaee</artifactId>
- <version>5.0.0.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.10.GA</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.0.jboss</version>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossjta</artifactId>
- <version>4.4.0.GA</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
+ <profile>
+ <id>test-transaction</id>
+ <properties>
+ <defaultTestGroup>transaction</defaultTestGroup>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>profiling</id>
+ <properties>
+ <defaultTestGroup>profiling</defaultTestGroup>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>test-integration</id>
+ <properties>
+ <defaultTestGroup>integration</defaultTestGroup>
+ <protocol.stack>udp</protocol.stack>
+ </properties>
+ </profile>
+
+
+ <profile>
+ <id>JBossAS</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+
<jbosscache-core-version>3.0.3-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <defaultTestGroup>functional,unit</defaultTestGroup>
+ <protocol.stack>tcp</protocol.stack>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>2.6.7.GA</version>
+ </dependency>
+ <!-- Replaces javax.transaction/jta -->
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <version>5.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.10.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.0.jboss</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjta</artifactId>
+ <version>4.4.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
</project>
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2009-02-05 01:58:42
UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2009-02-05 13:00:20
UTC (rev 7654)
@@ -30,9 +30,11 @@
import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
+import org.jboss.cache.jmx.annotations.MBean;
import org.jboss.cache.jmx.annotations.ManagedOperation;
import org.jboss.cache.lock.LockManager;
import org.jboss.cache.marshall.NodeData;
+import org.jboss.cache.util.CachePrinter;
import java.util.ArrayList;
import java.util.Collections;
@@ -48,6 +50,7 @@
* @since 2.2
*/
@NonVolatile
+@MBean(objectName = "DataContainer", description = "Core container for all
cached items")
public class DataContainerImpl implements DataContainer
{
private static final Log log = LogFactory.getLog(DataContainerImpl.class);
@@ -193,7 +196,10 @@
public NodeSPI peek(Fqn fqn, boolean includeDeletedNodes, boolean
includeInvalidNodes)
{
- if (trace) log.trace("peek " + fqn + ", includeDeletedNodes:"
+includeDeletedNodes + ", includeInvalidNodes:" + includeInvalidNodes);
+ if (trace)
+ {
+ log.trace("peek " + fqn + ", includeDeletedNodes:" +
includeDeletedNodes + ", includeInvalidNodes:" + includeInvalidNodes);
+ }
if (fqn == null || fqn.size() == 0) return getRoot();
NodeSPI n = getRoot();
int fqnSize = fqn.size();
@@ -483,7 +489,13 @@
return sb.toString();
}
+ @ManagedOperation(description = "Prints details of the data container, formatted
as an HTML String")
+ public String printDetailsAsHtml()
+ {
+ return CachePrinter.formatHtml(printDetails());
+ }
+
/**
* Returns lock information.
*
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-02-05 01:58:42 UTC
(rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-02-05 13:00:20 UTC
(rev 7654)
@@ -57,7 +57,6 @@
import org.jgroups.ChannelNotConnectedException;
import org.jgroups.ExtendedMembershipListener;
import org.jgroups.JChannel;
-import org.jgroups.StateTransferException;
import org.jgroups.View;
import org.jgroups.blocks.GroupRequest;
import org.jgroups.blocks.RspFilter;
@@ -83,7 +82,7 @@
*
* @author <a href="mailto:manik AT jboss DOT org">Manik Surtani (manik
AT jboss DOT org)</a>
*/
-@MBean(objectName = "RPCManager")
+@MBean(objectName = "RPCManager", description = "Manages RPC connections
to remote caches")
public class RPCManagerImpl implements RPCManager
{
private Channel channel;
@@ -176,7 +175,9 @@
isInLocalMode = false;
isUsingBuddyReplication = configuration.getBuddyReplicationConfig() != null
&& configuration.getBuddyReplicationConfig().isEnabled();
if (log.isDebugEnabled())
+ {
log.debug("Cache mode is " + configuration.getCacheMode());
+ }
boolean fetchState = shouldFetchStateOnStartup();
boolean nonBlocking = configuration.isNonBlockingStateTransfer();
@@ -188,10 +189,14 @@
{
// Allow commands to be ACKed during state transfer
if (nonBlocking)
+ {
componentRegistry.setBlockInStarting(false);
+ }
channel.connect(configuration.getClusterName());
if (log.isInfoEnabled())
+ {
log.info("Cache local address is " + getLocalAddress());
+ }
}
catch (ChannelException e)
{
@@ -199,7 +204,9 @@
}
if (!fetchState)
+ {
return;
+ }
}
@@ -216,10 +223,14 @@
{
channel.connect(configuration.getClusterName(), null, null,
configuration.getStateRetrievalTimeout());
if (log.isInfoEnabled())
+ {
log.info("Cache local address is " + getLocalAddress());
+ }
if (members.size() > 1)
+ {
messageListener.waitForState();
+ }
}
catch (ChannelException e)
{
@@ -235,7 +246,9 @@
}
if (log.isDebugEnabled())
+ {
log.debug("state was retrieved successfully (in " +
(System.currentTimeMillis() - start) + " milliseconds)");
+ }
}
}
@@ -244,7 +257,9 @@
{
if (members.size() < 2)
+ {
return;
+ }
boolean success = false;
@@ -254,12 +269,16 @@
for (Address member : members)
{
if (member.equals(getLocalAddress()))
+ {
continue;
+ }
try
{
if (log.isTraceEnabled())
+ {
log.trace("Trying to fetch state from: " + member);
+ }
if (getState(null, member))
{
messageListener.waitForState();
@@ -270,14 +289,18 @@
catch (Exception e)
{
if (log.isTraceEnabled())
+ {
log.trace("Error while fetching state", e);
+ }
}
}
if (!success)
{
if (trace)
+ {
log.trace("Could not find available peer for state, backing off and
retrying");
+ }
try
{
@@ -360,7 +383,9 @@
ReflectionUtil.setValue(configuration, "accessible", true);
configuration.setUsingMultiplexer(true);
if (log.isDebugEnabled())
+ {
log.debug("Created Multiplexer Channel for cache cluster " +
configuration.getClusterName() + " using stack " +
configuration.getMultiplexerStack());
+ }
}
else
{
@@ -536,9 +561,13 @@
int modeToUse = mode;
int preferredMode;
if ((preferredMode =
spi.getInvocationContext().getOptionOverrides().getGroupRequestMode()) > -1)
+ {
modeToUse = preferredMode;
+ }
if (trace)
+ {
log.trace("callRemoteMethods(): valid members are " + recipients +
" methods: " + command + " Using OOB? " + useOutOfBandMessage + "
modeToUse: " + modeToUse);
+ }
if (channel.flushSupported() &&
!flushBlockGate.await(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
{
throw new TimeoutException("State retrieval timed out waiting for flush
unblock. (timeout = " + configuration.getStateRetrievalTimeout() + " millis)
");
@@ -547,7 +576,9 @@
RspList rsps = rpcDispatcher.invokeRemoteCommands(recipients, command,
modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);
if (mode == GroupRequest.GET_NONE) return Collections.emptyList();// async case
if (trace)
+ {
log.trace("(" + getLocalAddress() + "): responses for method
" + command.getClass().getSimpleName() + ":\n" + rsps);
+ }
// short-circuit no-return-value calls.
if (rsps == null) return Collections.emptyList();
List<Object> retval = new ArrayList<Object>(rsps.size());
@@ -618,7 +649,9 @@
// Yes -- cache is configured LOCAL but app doesn't know it -- Brian
//throw new IllegalArgumentException("Cannot fetch partial state, targets
are " + sources + " and stateId is " + stateId);
if (log.isWarnEnabled())
+ {
log.warn("Cannot fetch partial state, targets are " + sources +
" and stateId is " + stateId);
+ }
return;
}
@@ -636,14 +669,18 @@
}
if (log.isDebugEnabled())
+ {
log.debug("Node " + getLocalAddress() + " fetching partial state
" + stateId + " from members " + targets);
+ }
boolean successfulTransfer = false;
for (Address target : targets)
{
try
{
if (log.isDebugEnabled())
+ {
log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target);
+ }
messageListener.setStateSet(false);
successfulTransfer = getState(stateId, target);
if (successfulTransfer)
@@ -659,14 +696,18 @@
}
}
if (log.isDebugEnabled())
+ {
log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target + (successfulTransfer ? "
successful" : " failed"));
+ }
if (successfulTransfer) break;
}
catch (IllegalStateException ise)
{
// thrown by the JGroups channel if state retrieval fails.
if (log.isInfoEnabled())
+ {
log.info("Channel problems fetching state. Continuing on to next
provider. ", ise);
+ }
}
}
@@ -680,18 +721,18 @@
private boolean getState(String stateId, Address target) throws
ChannelNotConnectedException, ChannelClosedException
{
lastStateTransferSource = target;
- return ((JChannel)channel).getState(target, stateId,
configuration.getStateRetrievalTimeout(), !configuration.isNonBlockingStateTransfer());
+ return ((JChannel) channel).getState(target, stateId,
configuration.getStateRetrievalTimeout(), !configuration.isNonBlockingStateTransfer());
}
public void waitForFlush(long timeout)
{
- for (;;)
+ for (; ;)
{
try
{
if (channel.flushSupported() && !flushWaitGate.await(timeout,
TimeUnit.MILLISECONDS))
{
- throw new TimeoutException("State retrieval timed out waiting for
flush to block. (timeout = " + timeout+ " millis) ");
+ throw new TimeoutException("State retrieval timed out waiting for
flush to block. (timeout = " + timeout + " millis) ");
}
return;
}
@@ -706,10 +747,10 @@
// ------------ START: Informational methods ------------
- @ManagedAttribute (description = "Local address")
+ @ManagedAttribute(description = "Local address")
public String getLocalAddressString()
{
- Address address = getLocalAddress();
+ Address address = getLocalAddress();
return address == null ? "null" : address.toString();
}
@@ -723,7 +764,7 @@
return channel != null ? channel.getLocalAddress() : null;
}
- @ManagedAttribute (description = "Cluster view")
+ @ManagedAttribute(description = "Cluster view")
public String getMembersString()
{
List l = getMembers();
@@ -734,9 +775,13 @@
{
if (isInLocalMode) return null;
if (members == null)
+ {
return Collections.emptyList();
+ }
else
+ {
return members;
+ }
}
public boolean isCoordinator()
@@ -834,7 +879,7 @@
catch (Throwable e)
{
//do not rethrow! jgroups might behave funny, resulting even in deadlock
- log.error("Error found while processing view accepted!!!", e);
+ log.error("Error found while processing view accepted!!!", e);
}
}
@@ -933,6 +978,12 @@
return statisticsEnabled;
}
+ @ManagedAttribute(description = "whether or not the RPCManager is used in this
cache instance")
+ public boolean isEnabled()
+ {
+ return !isInLocalMode;
+ }
+
@ManagedAttribute
public void setStatisticsEnabled(boolean statisticsEnabled)
{
@@ -958,7 +1009,9 @@
{
//if we use a shared transport do not log any warn message
if (configuration.getMultiplexerStack() != null)
+ {
return;
+ }
//bundling is not good for sync caches
Configuration.CacheMode cacheMode = configuration.getCacheMode();
if (!cacheMode.equals(Configuration.CacheMode.LOCAL) &&
configuration.getCacheMode().isSynchronous())
Modified: core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java 2009-02-05 01:58:42
UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java 2009-02-05 13:00:20
UTC (rev 7654)
@@ -24,7 +24,9 @@
import net.jcip.annotations.ThreadSafe;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.jboss.cache.Region.Type.*;
+import static org.jboss.cache.Region.Type.ANY;
+import static org.jboss.cache.Region.Type.EVICTION;
+import static org.jboss.cache.Region.Type.MARSHALLING;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.Configuration;
@@ -36,6 +38,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
+import org.jboss.cache.jmx.annotations.MBean;
import org.jboss.cache.jmx.annotations.ManagedAttribute;
import org.jboss.cache.jmx.annotations.ManagedOperation;
import org.jboss.cache.lock.LockManager;
@@ -55,6 +58,7 @@
* @since 3.0.0
*/
@ThreadSafe
+@MBean(objectName = "RegionManager", description = "Manages eviction and
marshalling regions")
public class RegionManagerImpl implements RegionManager
{
/**
@@ -141,7 +145,9 @@
setDefaultInactive(configuration.isInactiveOnStartup());
if (isUsingEvictions())
+ {
evictionTimerTask.init(evictionConfig.getWakeupInterval(),
configuration.getRuntimeConfig().getEvictionTimerThreadFactory(), regionsRegistry);
+ }
}
@Stop
@@ -420,7 +426,9 @@
// Don't bother trying to fetch state if we are in LOCAL mode
if (members != null && !members.isEmpty())
+ {
rpcManager.fetchPartialState(members, subtreeRoot.getFqn());
+ }
}
else if (!buddyFqnTransformer.isBackupFqn(fqn))
{
@@ -431,7 +439,9 @@
{
List<Address> sources = new ArrayList<Address>(1);
if (!cache.getMembers().contains(buddy))
+ {
continue;
+ }
sources.add(buddy);
Fqn buddyRoot = buddyFqnTransformer.getBackupFqn(buddy, fqn);
subtreeRoot = cache.peek(buddyRoot, false, false);
@@ -642,7 +652,9 @@
{
if ((type == EVICTION && r.getEvictionRegionConfig() != null) ||
(type == MARSHALLING && r.isActive() &&
r.getClassLoader() != null))
+ {
regions.add(r);
+ }
}
}
else
@@ -673,7 +685,9 @@
// needDefault = ercs.size() == 0;
if (evictionConfig.getDefaultEvictionRegionConfig().getEvictionAlgorithmConfig() !=
null &&
!ercs.contains(evictionConfig.getDefaultEvictionRegionConfig())) // then the
default is a real region too; not just a template for others
+ {
ercs.add(0, evictionConfig.getDefaultEvictionRegionConfig());
+ }
// create regions for the regions defined in the evictionConfig.
// scan to be sure the _default_ region isn't added twice
@@ -746,7 +760,7 @@
evictionTimerTask.stop();
}
- @ManagedAttribute(name="numRegions", description = "A count of all
regions")
+ @ManagedAttribute(name = "numRegions", description = "A count of all
regions")
public int getNumRegions()
{
return regionsRegistry.size();
Modified: core/trunk/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Version.java 2009-02-05 01:58:42 UTC (rev
7653)
+++ core/trunk/src/main/java/org/jboss/cache/Version.java 2009-02-05 13:00:20 UTC (rev
7654)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.3-SNAPSHOT";
- public static final String codename = "Naga";
+ public static final String version = "3.1.0-SNAPSHOT";
+ public static final String codename = "Cascabel";
//public static final String cvs = "$Id$";
- static final byte[] version_id = {'0', '3', '0', '3',
'S'};
+ static final byte[] version_id = {'0', '3', '1', '0',
'S'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
@@ -71,9 +71,13 @@
if (v != null)
{
if (len <= 0)
+ {
len = v.length;
+ }
for (int i = 0; i < len; i++)
+ {
sb.append((char) v[i]);
+ }
}
return sb.toString();
}
@@ -92,13 +96,19 @@
public static boolean compareTo(byte[] v)
{
if (v == null)
+ {
return false;
+ }
if (v.length < version_id.length)
+ {
return false;
+ }
for (int i = 0; i < version_id.length; i++)
{
if (version_id[i] != v[i])
+ {
return false;
+ }
}
return true;
}
@@ -116,31 +126,45 @@
public static short getVersionShort(String versionString)
{
if (versionString == null)
+ {
throw new IllegalArgumentException("versionString is null");
+ }
// Special cases for version prior to 1.2.4.SP2
if ("1.2.4".equals(versionString))
+ {
return 124;
+ }
else if ("1.2.4.SP1".equals(versionString))
+ {
return 1241;
+ }
String parts[] = versionString.split("[\\.\\-]");
int a = 0;
int b = 0;
int c = 0;
if (parts.length > 0)
+ {
a = Integer.parseInt(parts[0]);
+ }
if (parts.length > 1)
+ {
b = Integer.parseInt(parts[1]);
+ }
if (parts.length > 2)
+ {
c = Integer.parseInt(parts[2]);
+ }
return encodeVersion(a, b, c);
}
public static String getVersionString(short versionShort)
{
if (versionShort == SHORT_1_2_4_SP2)
+ {
return "1.2.4.SP2";
+ }
switch (versionShort)
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2009-02-05
01:58:42 UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -86,17 +86,13 @@
* See {@link
org.jboss.cache.interceptors.EvictionInterceptor#visitEvictFqnCommand(org.jboss.cache.InvocationContext
, EvictCommand)}
* which is where the return value is used
*
- * @return true if the node was removed from the tree or if it is resident. Returns
false if the node still exists; i.e. was only data removed because it still has children.
+ * @return true if the node is now absent from the cache. Returns false if the node
still exists; i.e. was only data removed because it still has children.
*/
public Object perform(InvocationContext ctx)
{
NodeSPI node = lookupForEviction(ctx, fqn);
- if (node == null || node.isDeleted())
+ if (node == null || node.isDeleted() || node.isResident())
{
- return false;
- }
- else if (node.isResident())
- {
return true;
}
else if (recursive)
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -152,7 +152,9 @@
{
double total = hits + misses;
if (total == 0)
+ {
return 0;
+ }
return (hits / total);
}
@@ -160,7 +162,9 @@
public double getReadWriteRatio()
{
if (stores == 0)
+ {
return 0;
+ }
return (((double) (hits + misses) / (double) stores));
}
@@ -169,7 +173,9 @@
{
long total = hits + misses;
if (total == 0)
+ {
return 0;
+ }
return (hitTimes + missTimes) / total;
}
@@ -177,17 +183,19 @@
public long getAverageWriteTime()
{
if (stores == 0)
+ {
return 0;
+ }
return (storeTimes) / stores;
}
- @ManagedAttribute(description = "number of cache eviction operations")
+ @ManagedAttribute(description = "number of cache attributes")
public int getNumberOfAttributes()
{
return dataContainer.getNumberOfAttributes();
}
- @ManagedAttribute
+ @ManagedAttribute(description = "number of nodes in the cache")
public int getNumberOfNodes()
{
return dataContainer.getNumberOfNodes();
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -81,8 +81,8 @@
// See if the node still exists; i.e. was only data removed
// because it still has children.
// If yes, put an ADD event in the queue so the node gets revisited
- boolean complete = (retVal != null && (Boolean) retVal);
- if (!complete)
+ boolean nodeIsNowAbsent = (retVal != null && (Boolean) retVal);
+ if (!nodeIsNowAbsent)
{
Region r;
if (fqn != null && (r = getRegion(fqn)) != null)
@@ -244,10 +244,10 @@
private void registerEvictionEventToRegionManager(Fqn fqn, EvictionEvent.Type type,
int elementDifference, Region region)
{
//we do not trigger eviction events for resident nodes
- if (dataContainer.isResident(fqn))
+ if (dataContainer.isResident(fqn))
{
- if (trace) log.trace("Ignoring Fqn " + fqn + " as it is marked as
resident");
- return;
+ if (trace) log.trace("Ignoring Fqn " + fqn + " as it is marked as
resident");
+ return;
}
region.registerEvictionEvent(fqn, type, elementDifference);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2009-02-05
01:58:42 UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -30,6 +30,8 @@
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.invocation.InvocationContextContainer;
+import org.jboss.cache.jmx.annotations.MBean;
+import org.jboss.cache.jmx.annotations.ManagedOperation;
import org.jboss.cache.util.CachePrinter;
import java.util.ArrayList;
@@ -45,6 +47,7 @@
* todo - if you add the same interceptor instance twice, things get really
dirty.
* -- this should be treated as an missuse and an exception should be thrown
*/
+@MBean(description = "InterceptorChain")
public class InterceptorChain
{
/**
@@ -151,6 +154,25 @@
}
+ @ManagedOperation(description = "Retrieves a list of the interceptors in the
chain")
+ public String getInterceptorDetails()
+ {
+ StringBuilder sb = new StringBuilder("Interceptor chain: \n");
+ int count = 0;
+ for (CommandInterceptor i : asList())
+ {
+ count++;
+ sb.append(" ").append(count).append(".
").append(i).append("\n");
+ }
+ return sb.toString();
+ }
+
+ @ManagedOperation(description = "Retrieves a list of the interceptors in the
chain, formatted as HTML")
+ public String getInterceptorDetailsAsHtml()
+ {
+ return CachePrinter.formatHtml(getInterceptorDetails());
+ }
+
/**
* Returns an unmofiable list with all the interceptors in sequence.
* If first in chain is null an empty list is returned.
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2009-02-05 01:58:42
UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2009-02-05 13:00:20
UTC (rev 7654)
@@ -48,16 +48,7 @@
import org.jgroups.jmx.JChannelFactoryMBean;
import org.w3c.dom.Element;
-import javax.management.AttributeChangeNotification;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
+import javax.management.*;
import javax.transaction.TransactionManager;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@@ -146,7 +137,7 @@
public String printConfigurationAsHtmlString()
{
Configuration cfg = getConfiguration();
- return cfg == null ? "Configuration is null" :
formatHtml(cfg.toString());
+ return cfg == null ? "Configuration is null" :
CachePrinter.formatHtml(cfg.toString());
}
public String printCacheDetails()
@@ -156,7 +147,7 @@
public String printCacheDetailsAsHtml()
{
- return cache == null ? "Cache is null" :
formatHtml(CachePrinter.printCacheDetails(cache));
+ return cache == null ? "Cache is null" :
CachePrinter.formatHtml(CachePrinter.printCacheDetails(cache));
}
public CacheStatus getCacheStatus()
@@ -217,7 +208,7 @@
public String printLockInfoAsHtml()
{
- return cache == null ? "Cache is null" :
formatHtml(CachePrinter.printCacheLockingInfo(cache));
+ return cache == null ? "Cache is null" :
CachePrinter.formatHtml(CachePrinter.printCacheLockingInfo(cache));
}
public boolean getRegisterJmxResource()
@@ -599,9 +590,13 @@
if (!cacheStatus.createAllowed())
{
if (cacheStatus.needToDestroyFailedCache())
+ {
destroy();
+ }
else
+ {
return;
+ }
}
try
@@ -633,12 +628,18 @@
if (!cacheStatus.startAllowed())
{
if (cacheStatus.needToDestroyFailedCache())
+ {
destroy(); // this will take us back to DESTROYED
+ }
if (cacheStatus.needCreateBeforeStart())
+ {
create();
+ }
else
+ {
return;
+ }
}
try
@@ -718,7 +719,9 @@
}
}
else
+ {
return;
+ }
}
try
@@ -730,7 +733,9 @@
unregisterJmxResources();
if (cache != null)
+ {
cache.destroy();
+ }
}
finally
{
@@ -901,22 +906,6 @@
return server;
}
- /**
- * Formats a given String for display as an HTML snippet.
- *
- * @param s string to format
- * @return formatted string
- */
- public static String formatHtml(String s)
- {
- s = s.replaceAll("\r\n", "<br/>");
- s = s.replaceAll("\r", "<br/>");
- s = s.replaceAll("\n", "<br/>");
- s = s.replaceAll("\t",
" ");
- s = s.replaceAll(" ", " ");
- return s;
- }
-
public String getNotificationServiceName()
{
return notificationServiceName;
@@ -1049,14 +1038,18 @@
{
listenerCount.incrementAndGet();
if (cache != null)
+ {
cache.addCacheListener(cacheNotificationListener);
+ }
}
else
{
if (listenerCount.decrementAndGet() <= 0)
{
if (cache != null)
+ {
cache.removeCacheListener(cacheNotificationListener);
+ }
listenerCount.set(0);
}
@@ -1082,13 +1075,21 @@
sendStateChangeNotification(oldState, getState(), getClass().getSimpleName() +
" failed", t);
if (t instanceof CacheException)
+ {
throw (CacheException) t;
+ }
else if (t instanceof RuntimeException)
+ {
throw (RuntimeException) t;
+ }
else if (t instanceof Error)
+ {
throw (Error) t;
+ }
else
+ {
throw new CacheException(t);
+ }
}
/**
@@ -1097,7 +1098,9 @@
private void sendStateChangeNotification(int oldState, int newState, String msg,
Throwable t)
{
if (isDisableStateChangeNotifications())
+ {
return;
+ }
long now = System.currentTimeMillis();
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -56,6 +56,7 @@
private static final int VERSION_210 = 21;
private static final int VERSION_220 = 22;
private static final int VERSION_300 = 30;
+ private static final int VERSION_310 = 31;
private static final int CUSTOM_MARSHALLER = 999;
private ComponentRegistry componentRegistry;
@@ -83,7 +84,9 @@
if (marshallerClass != null)
{
if (trace)
+ {
log.trace("Cache marshaller implementation specified as " +
marshallerClass + ". Overriding any version strings passed in. ");
+ }
try
{
defaultMarshaller = (Marshaller)
Util.loadClass(marshallerClass).newInstance();
@@ -308,11 +311,14 @@
marshallers.put(VERSION_210, marshaller);
}
break;
+ case VERSION_310:
case VERSION_300:
knownVersion = true;
default:
if (!knownVersion && log.isWarnEnabled())
+ {
log.warn("Unknown replication version [" + versionId + "].
Falling back to the default marshaller installed.");
+ }
marshaller = marshallers.get(VERSION_300);
if (marshaller == null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2009-02-05 01:58:42
UTC (rev 7653)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2009-02-05 13:00:20
UTC (rev 7654)
@@ -93,4 +93,20 @@
}
return sb.toString();
}
+
+ /**
+ * Formats a given String for display as an HTML snippet.
+ *
+ * @param s string to format
+ * @return formatted string
+ */
+ public static String formatHtml(String s)
+ {
+ s = s.replaceAll("\r\n", "<br/>");
+ s = s.replaceAll("\r", "<br/>");
+ s = s.replaceAll("\n", "<br/>");
+ s = s.replaceAll("\t",
" ");
+ s = s.replaceAll(" ", " ");
+ return s;
+ }
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -47,6 +47,14 @@
control.verify();
}
+ public void testShouldReturnTrueIndicatingNodeIsAbsentIfNodeDoesntExist()
+ {
+ expect(container.peek(testFqn, false, true)).andReturn(null);
+ control.replay();
+ assert Boolean.TRUE == command.perform(ctx);
+ control.verify();
+ }
+
public void testSimpleEviction()
{
expect(container.peek(testFqn, false, true)).andReturn(nodes.abNode);
Modified:
core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -21,14 +21,11 @@
*/
package org.jboss.cache.config.parsing;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.jboss.cache.Cache;
-import org.jboss.cache.UnitTestCacheFactory;
import org.jboss.cache.DefaultCacheFactory;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -54,7 +51,6 @@
private InMemoryAppender appender;
private Level oldLevel;
- private Log log = LogFactory.getLog(SampleConfigFilesCorrectnessTest.class);
@BeforeMethod
public void setUpTest()
Copied: core/trunk/src/test/java/org/jboss/cache/jmx/JmxManualTest.java (from rev 7636,
core/trunk/src/test/java/org/jboss/cache/jmx/JmxManualTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/JmxManualTest.java
(rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/JmxManualTest.java 2009-02-05 13:00:20
UTC (rev 7654)
@@ -0,0 +1,76 @@
+package org.jboss.cache.jmx;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.EvictionRegionConfig;
+import org.jboss.cache.eviction.FIFOAlgorithmConfig;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+// do NOT enable this test in SVN as it will cause Hudson (or any other continuous
integration test harness) to get
+
+// stuck.
+@Test(groups = "maual", enabled = false)
+public class JmxManualTest
+{
+ public void testLocal() throws IOException
+ {
+ Configuration c = new Configuration();
+ Cache cache = new DefaultCacheFactory().createCache(c);
+ cache.put("/a/b/c", "a", "b");
+ cache.put("/a/b/c", "c", "d");
+ cache.put("/a/b/d", "a", "b");
+ cache.put("/a/b/e", "c", "d");
+
+ System.in.read();
+ }
+
+ public void testLocalNoJMX() throws IOException
+ {
+ Configuration c = new Configuration();
+ c.setExposeManagementStatistics(false);
+ Cache cache = new DefaultCacheFactory().createCache(c);
+ cache.put("/a/b/c", "a", "b");
+ cache.put("/a/b/c", "c", "d");
+ cache.put("/a/b/d", "a", "b");
+ cache.put("/a/b/e", "c", "d");
+
+ System.in.read();
+ }
+
+ public void testLocalWithEviction() throws IOException
+ {
+ Configuration c = new Configuration();
+ EvictionConfig ec = new EvictionConfig();
+ ec.setWakeupInterval(250, TimeUnit.MILLISECONDS);
+ EvictionRegionConfig erc = new EvictionRegionConfig();
+ erc.setEvictionAlgorithmConfig(new FIFOAlgorithmConfig(2));
+ erc.setRegionFqn(Fqn.ROOT);
+ ec.setDefaultEvictionRegionConfig(erc);
+ c.setEvictionConfig(ec);
+ Cache cache = new DefaultCacheFactory().createCache(c);
+ cache.put("/a/b/c", "a", "b");
+ cache.put("/a/b/c", "c", "d");
+ cache.put("/a/b/d", "a", "b");
+ cache.put("/a/b/e", "c", "d");
+
+ System.in.read();
+ }
+
+ public void testLocalWithEvictionXML() throws IOException
+ {
+ Cache cache = new
DefaultCacheFactory().createCache("config-samples/eviction-enabled.xml");
+ cache.put("/a/b/c", "a", "b");
+ cache.put("/a/b/c", "c", "d");
+ cache.put("/a/b/d", "a", "b");
+ cache.put("/a/b/e", "c", "d");
+
+ System.in.read();
+ }
+
+}
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -16,7 +16,6 @@
import org.jboss.cache.notifications.event.Event;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.util.CachePrinter;
-import org.jboss.cache.util.TestingUtil;
import org.jgroups.Address;
import org.jgroups.stack.IpAddress;
import static org.testng.AssertJUnit.*;
@@ -71,7 +70,9 @@
finally
{
if (registered)
+ {
mBeanServer.unregisterMBean(on);
+ }
}
}
@@ -155,7 +156,7 @@
{
CacheJmxWrapperMBean<String, String> wrapper = registerWrapper();
String cfgFromJmx = wrapper.printConfigurationAsHtmlString();
- assertEquals(CacheJmxWrapper.formatHtml(cache.getConfiguration().toString()),
cfgFromJmx);
+ assertEquals(CachePrinter.formatHtml(cache.getConfiguration().toString()),
cfgFromJmx);
checkHtml(cfgFromJmx, false);
}
@@ -175,7 +176,7 @@
wrapper.create();
wrapper.start();
String cfgFromJmx = wrapper.printConfigurationAsHtmlString();
-
assertEquals(CacheJmxWrapper.formatHtml(wrapper.getCache().getConfiguration().toString()),
cfgFromJmx);
+
assertEquals(CachePrinter.formatHtml(wrapper.getCache().getConfiguration().toString()),
cfgFromJmx);
checkHtml(cfgFromJmx, false);
}
@@ -396,7 +397,9 @@
private void checkHtml(String html, boolean checkBR)
{
if (checkBR)
+ {
assertTrue("Has <br", html.contains("<br"));
+ }
assertTrue("No tabs", html.indexOf('\t') == -1);
Modified:
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java 2009-02-05
01:58:42 UTC (rev 7653)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/VersionAwareMarshallerTest.java 2009-02-05
13:00:20 UTC (rev 7654)
@@ -78,7 +78,7 @@
byte[] bytes = marshaller.objectToByteBuffer("Hello");
ObjectInputStream in = new MarshalledValueInputStream(new
ByteArrayInputStream(bytes));
- assertEquals("Version header short should be '30'", 30,
in.readShort());
+ assertEquals("Version header short should be '30'", 31,
in.readShort());
}
public void testVersionHeader210() throws Exception