[jboss-svn-commits] JBL Code SVN: r14186 - in labs/shotoku/trunk/shotoku-cache: lib and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Aug 13 14:02:52 EDT 2007
Author: adamw
Date: 2007-08-13 14:02:52 -0400 (Mon, 13 Aug 2007)
New Revision: 14186
Added:
labs/shotoku/trunk/shotoku-cache/lib/javax.servlet.jar
labs/shotoku/trunk/shotoku-cache/test/
labs/shotoku/trunk/shotoku-cache/test/build.xml
labs/shotoku/trunk/shotoku-cache/test/src/
labs/shotoku/trunk/shotoku-cache/test/src/java/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestCacheItem.java
labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestServlet.java
labs/shotoku/trunk/shotoku-cache/test/src/web/
labs/shotoku/trunk/shotoku-cache/test/src/web/WEB-INF/
labs/shotoku/trunk/shotoku-cache/test/src/web/WEB-INF/web.xml
Modified:
labs/shotoku/trunk/shotoku-cache/build.xml
labs/shotoku/trunk/shotoku-cache/src/etc/META-INF/jboss-service.xml
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItem.java
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItemConfiguration.java
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceImpl.java
Log:
Test servlet
Modified: labs/shotoku/trunk/shotoku-cache/build.xml
===================================================================
--- labs/shotoku/trunk/shotoku-cache/build.xml 2007-08-13 17:40:31 UTC (rev 14185)
+++ labs/shotoku/trunk/shotoku-cache/build.xml 2007-08-13 18:02:52 UTC (rev 14186)
@@ -78,4 +78,8 @@
<!-- Deleting old deployment -->
<delete dir="${deploy.dir}/${sar.name}" />
</target>
+
+ <target name="test" depends="dist">
+ <ant dir="test" inheritrefs="true" target="all" />
+ </target>
</project>
Added: labs/shotoku/trunk/shotoku-cache/lib/javax.servlet.jar
===================================================================
(Binary files differ)
Property changes on: labs/shotoku/trunk/shotoku-cache/lib/javax.servlet.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: labs/shotoku/trunk/shotoku-cache/src/etc/META-INF/jboss-service.xml
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/etc/META-INF/jboss-service.xml 2007-08-13 17:40:31 UTC (rev 14185)
+++ labs/shotoku/trunk/shotoku-cache/src/etc/META-INF/jboss-service.xml 2007-08-13 18:02:52 UTC (rev 14186)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server
+ PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
+<server>
+ <mbean
+ code="org.jboss.shotoku.cache.service.RenewableCacheServiceImpl"
+ name="shotoku:service=RenewableCache" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean />
+ <attribute name="Interval">60000</attribute>
+ <depends optional-attribute-name="TreeCache"
+ proxy-type="attribute">
+ shotoku:service=TreeCache
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.cache.TreeCache" name="shotoku:service=TreeCache">
+ <!-- Configure the TransactionManager -->
+ <attribute name="TransactionManagerLookupClass">
+ org.jboss.cache.DummyTransactionManagerLookup
+ </attribute>
+
+ <!--
+ Node locking scheme :
+ PESSIMISTIC (default)
+ OPTIMISTIC
+ -->
+ <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
+
+ <!--
+ Node locking isolation level :
+ SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+
+ (ignored if NodeLockingScheme is OPTIMISTIC)
+ -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <!-- Lock parent before doing node additions/removes -->
+ <attribute name="LockParentForChildInsertRemove">
+ true
+ </attribute>
+
+ <!-- Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ INVALIDATION_ASYNC
+ INVALIDATION_SYNC
+ -->
+ <attribute name="CacheMode">LOCAL</attribute>
+
+ <!-- Whether each interceptor should have an mbean
+ registered to capture and display its statistics. -->
+ <attribute name="UseInterceptorMbeans">true</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+ cluster, in order to find each other -->
+ <attribute name="ClusterName">JBoss-Cache-Cluster</attribute>
+
+ <!-- Uncomment next three statements to enable JGroups multiplexer.
+ This configuration is dependent on the JGroups multiplexer being
+ registered in an MBean server such as JBossAS. -->
+ <!--
+ <depends>jgroups.mux:name=Multiplexer</depends>
+ <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+ <attribute name="MultiplexerStack">udp</attribute>
+ -->
+
+ <!-- JGroups protocol stack properties. ClusterConfig isn't used if the
+ multiplexer is enabled and successfully initialized. -->
+ <attribute name="ClusterConfig">
+ <config>
+ <!-- UDP: if you have a multihomed machine,
+ set the bind_addr attribute to the appropriate NIC IP address
+ -->
+ <!-- UDP: On Windows machines, because of the media sense feature
+ being broken with multicast (even after disabling media sense)
+ set the loopback attribute to true
+ -->
+ <UDP mcast_addr="228.1.2.3" mcast_port="45566"
+ ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000"
+ mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
+ ucast_recv_buf_size="80000" loopback="false" />
+ <PING timeout="2000" num_initial_members="3"
+ up_thread="false" down_thread="false" />
+ <MERGE2 min_interval="10000" max_interval="20000" />
+ <FD shun="true" up_thread="true" down_thread="true" />
+ <VERIFY_SUSPECT timeout="1500" up_thread="false"
+ down_thread="false" />
+ <pbcast.NAKACK gc_lag="50" max_xmit_size="8192"
+ retransmit_timeout="600,1200,2400,4800" up_thread="false"
+ down_thread="false" />
+ <UNICAST timeout="600,1200,2400" window_size="100"
+ min_threshold="10" down_thread="false" />
+ <pbcast.STABLE desired_avg_gossip="20000"
+ up_thread="false" down_thread="false" />
+ <FRAG frag_size="8192" down_thread="false"
+ up_thread="false" />
+ <pbcast.GMS join_timeout="5000"
+ join_retry_timeout="2000" shun="true" print_local_addr="true" />
+ <pbcast.STATE_TRANSFER up_thread="false"
+ down_thread="false" />
+ </config>
+ </attribute>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ initial state (ie. the contents of the cache) are retrieved from
+ existing members in a clustered environment
+ -->
+ <attribute name="InitialStateRetrievalTimeout">5000</attribute>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">10000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+ </mbean>
+</server>
\ No newline at end of file
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItem.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItem.java 2007-08-13 17:40:31 UTC (rev 14185)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItem.java 2007-08-13 18:02:52 UTC (rev 14186)
@@ -119,7 +119,23 @@
public String getMbeanName() {
return mbeanName;
}
+
+ public long getTimeout() {
+ return timeout;
+ }
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+ public ConcurrentSet<K> getKeysDuringUpdate() {
+ return keysDuringUpdate;
+ }
+
+ public ConcurrentMap<K, Long> getKeysUpdates() {
+ return keysUpdates;
+ }
+
/**
* Binds the given key with the given object in the cache. The real key to
* which the object will be bound is: keyBase/key.
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItemConfiguration.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItemConfiguration.java 2007-08-13 17:40:31 UTC (rev 14185)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItemConfiguration.java 2007-08-13 18:02:52 UTC (rev 14186)
@@ -44,6 +44,6 @@
public String getMbeanName();
- public Map<K, Long> getKeysLastUpdates();
+ public Map<K, Long> getKeysUpdates();
public Set<K> getKeysDuringUpdate();
}
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceImpl.java 2007-08-13 17:40:31 UTC (rev 14185)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceImpl.java 2007-08-13 18:02:52 UTC (rev 14186)
@@ -184,7 +184,7 @@
public void unregister(RenewableCacheItem cacheItem) throws CacheException {
cacheItems.remove(cacheItem);
- for (Object key : cacheItem.getKeysLastUpdates().keySet()) {
+ for (Object key : cacheItem.getKeysUpdates().keySet()) {
remove(cacheItem.getFqn(), key);
}
}
Property changes on: labs/shotoku/trunk/shotoku-cache/test
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
bin
target
build
dist
Added: labs/shotoku/trunk/shotoku-cache/test/build.xml
===================================================================
--- labs/shotoku/trunk/shotoku-cache/test/build.xml (rev 0)
+++ labs/shotoku/trunk/shotoku-cache/test/build.xml 2007-08-13 18:02:52 UTC (rev 14186)
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<project name="Shotoku Renewable Cache Test" default="all" basedir=".">
+ <path id="classpath.test.jars">
+ <fileset refid="classpath" />
+ <fileset dir="../dist"><include name="shotoku-cache.jar"/></fileset>
+ </path>
+
+ <target name="all">
+ <delete dir="dist" />
+ <delete dir="build" />
+
+ <!-- -->
+
+ <mkdir dir="build" />
+
+ <javac srcdir="src/java" destdir="build" target="1.5" source="1.5">
+ <classpath refid="classpath.test.jars" />
+ </javac>
+
+ <!-- -->
+
+ <copy todir="build">
+ <fileset dir="src/web"><include name="**/*" /></fileset>
+ </copy>
+
+ <!-- -->
+
+ <mkdir dir="dist" />
+
+ <jar destfile="dist/shotoku-cache-test.war" basedir="build" />
+ </target>
+</project>
Added: labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestCacheItem.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestCacheItem.java (rev 0)
+++ labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestCacheItem.java 2007-08-13 18:02:52 UTC (rev 14186)
@@ -0,0 +1,15 @@
+package org.jboss.shotoku.cache.test;
+
+import org.jboss.shotoku.cache.RenewableCacheItem;
+
+public class TestCacheItem extends RenewableCacheItem<String, String> {
+ @Override
+ public String init(String key) {
+ return null;
+ }
+
+ @Override
+ public void update(String key, String currentObject) {
+
+ }
+}
Added: labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestServlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestServlet.java (rev 0)
+++ labs/shotoku/trunk/shotoku-cache/test/src/java/org/jboss/shotoku/cache/test/TestServlet.java 2007-08-13 18:02:52 UTC (rev 14186)
@@ -0,0 +1,23 @@
+package org.jboss.shotoku.cache.test;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class TestServlet extends HttpServlet {
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ System.out.println("X");
+ }
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ }
+
+}
Added: labs/shotoku/trunk/shotoku-cache/test/src/web/WEB-INF/web.xml
===================================================================
--- labs/shotoku/trunk/shotoku-cache/test/src/web/WEB-INF/web.xml (rev 0)
+++ labs/shotoku/trunk/shotoku-cache/test/src/web/WEB-INF/web.xml 2007-08-13 18:02:52 UTC (rev 14186)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <servlet>
+ <servlet-name>CacheTestServlet</servlet-name>
+ <servlet-class>org.jboss.shotoku.cache.test.TestServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CacheTestServlet</servlet-name>
+ <url-pattern>*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list