[jboss-svn-commits] JBL Code SVN: r14240 - in labs/shotoku/trunk/shotoku-cache/src: java/org/jboss/shotoku and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Aug 15 05:18:05 EDT 2007
Author: adamw
Date: 2007-08-15 05:18:05 -0400 (Wed, 15 Aug 2007)
New Revision: 14240
Removed:
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/exceptions/
Modified:
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/service/DummyRenewableCacheService.java
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheService.java
labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceMBean.java
Log:
More work
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-15 06:37:00 UTC (rev 14239)
+++ labs/shotoku/trunk/shotoku-cache/src/etc/META-INF/jboss-service.xml 2007-08-15 09:18:05 UTC (rev 14240)
@@ -5,7 +5,7 @@
<server>
<mbean code="org.jboss.shotoku.cache.service.RenewableCacheService"
name="shotoku:service=RenewableCache">
- <attribute name="Interval">60000</attribute>
+ <attribute name="Interval">10000</attribute>
<attribute name="UpdateThreadCount">3</attribute>
<depends optional-attribute-name="TreeCache"
proxy-type="attribute">
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-15 06:37:00 UTC (rev 14239)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/RenewableCacheItem.java 2007-08-15 09:18:05 UTC (rev 14240)
@@ -30,7 +30,6 @@
import org.jboss.shotoku.tools.ConcurrentHashSet;
import org.jboss.shotoku.cache.service.DummyRenewableCacheService;
import org.jboss.shotoku.cache.service.RenewableCacheServiceMBean;
-import org.jboss.shotoku.exceptions.RenewableCacheException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -232,16 +231,13 @@
* Binds the given key with the given object in the associated TreeCache
* node. Should be only called
* from the {@link #update(Object, Object)} method to put new values in the
- * cache.
+ * cache (if not called during an update, this method has no effect).
* @param key Key of the object.
* @param object Object that should be bound.
- * @throws RenewableCacheException Thrown if this method is not called from within
- * the {@link #update(Object, Object)} method.
*/
- public synchronized final void put(K key, T object) throws RenewableCacheException {
+ public synchronized final void put(K key, T object) {
if (!keysDuringUpdate.contains(key)) {
- throw new RenewableCacheException("Key " + key + " is not handled by this " +
- "ShotokuCacheItem.");
+ return;
}
try {
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/DummyRenewableCacheService.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/DummyRenewableCacheService.java 2007-08-15 06:37:00 UTC (rev 14239)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/DummyRenewableCacheService.java 2007-08-15 09:18:05 UTC (rev 14240)
@@ -1,11 +1,13 @@
package org.jboss.shotoku.cache.service;
import java.util.Date;
+import java.util.Set;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCacheMBean;
import org.jboss.shotoku.cache.RenewableCacheItem;
+import org.jboss.shotoku.cache.RenewableCacheItemConfiguration;
import org.jboss.shotoku.cache.UpdateThreadData;
/**
@@ -85,4 +87,8 @@
public void update() {
}
+
+ public Set<? extends RenewableCacheItemConfiguration> getCacheItemsConfigurations() {
+ return null;
+ }
}
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheService.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheService.java 2007-08-15 06:37:00 UTC (rev 14239)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheService.java 2007-08-15 09:18:05 UTC (rev 14240)
@@ -26,6 +26,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCacheMBean;
import org.jboss.shotoku.cache.RenewableCacheItem;
+import org.jboss.shotoku.cache.RenewableCacheItemConfiguration;
import org.jboss.shotoku.cache.SignalExitUpdateThreadData;
import org.jboss.shotoku.cache.UpdateThread;
import org.jboss.shotoku.cache.UpdateThreadData;
@@ -36,6 +37,7 @@
import java.util.Calendar;
import java.util.Date;
+import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
/**
@@ -176,8 +178,12 @@
remove(cacheItem.getFqn(), key);
}
}
+
+ public Set<? extends RenewableCacheItemConfiguration> getCacheItemsConfigurations() {
+ return cacheItems;
+ }
- private int counter = 0;
+ private int counter = 0;
private final Object counterSync = new Object();
public Fqn generateNextFqn() {
Modified: labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceMBean.java
===================================================================
--- labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceMBean.java 2007-08-15 06:37:00 UTC (rev 14239)
+++ labs/shotoku/trunk/shotoku-cache/src/java/org/jboss/shotoku/cache/service/RenewableCacheServiceMBean.java 2007-08-15 09:18:05 UTC (rev 14240)
@@ -23,11 +23,13 @@
package org.jboss.shotoku.cache.service;
import java.util.Date;
+import java.util.Set;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCacheMBean;
import org.jboss.shotoku.cache.RenewableCacheItem;
+import org.jboss.shotoku.cache.RenewableCacheItemConfiguration;
import org.jboss.shotoku.cache.UpdateThreadData;
/**
@@ -61,6 +63,8 @@
public int getUpdateThreadCount();
public void setUpdateThreadCount(int n);
+ public Set<? extends RenewableCacheItemConfiguration> getCacheItemsConfigurations();
+
public void update();
public void start();
More information about the jboss-svn-commits
mailing list