JBoss Cache SVN: r6633 - in core/trunk/src: test/java/org/jboss/cache/lock and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-28 12:27:09 -0400 (Thu, 28 Aug 2008)
New Revision: 6633
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/trunk/src/test/java/org/jboss/cache/lock/UpgradeLockTest.java
Log:
this scenario is only acceptable in a pessimistic locking scheme
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-08-28 16:25:14 UTC (rev 6632)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-08-28 16:27:09 UTC (rev 6633)
@@ -666,10 +666,6 @@
/**
* Creates a gtx (if one doesnt exist), a sync handler, and registers the tx.
- *
- * @param tx
- * @return
- * @throws Exception
*/
private GlobalTransaction registerTransaction(Transaction tx, InvocationContext ctx) throws Exception
{
@@ -716,10 +712,6 @@
/**
* Registers a sync hander against a tx.
- *
- * @param tx
- * @param handler
- * @throws Exception
*/
private void registerHandler(Transaction tx, Synchronization handler, InvocationContext ctx) throws Exception
{
Modified: core/trunk/src/test/java/org/jboss/cache/lock/UpgradeLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/UpgradeLockTest.java 2008-08-28 16:25:14 UTC (rev 6632)
+++ core/trunk/src/test/java/org/jboss/cache/lock/UpgradeLockTest.java 2008-08-28 16:27:09 UTC (rev 6633)
@@ -10,6 +10,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.transaction.DummyTransactionManager;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.AfterMethod;
@@ -87,6 +88,7 @@
private CacheSPI<Object, Object> createCache(IsolationLevel level)
{
CacheSPI<Object, Object> c = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
+ c.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
c.getConfiguration().setClusterName("test");
c.getConfiguration().setStateRetrievalTimeout(10000);
c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.JBossTransactionManagerLookup");
16 years, 3 months
JBoss Cache SVN: r6632 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-28 12:25:14 -0400 (Thu, 28 Aug 2008)
New Revision: 6632
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java
Log:
this scenario is only acceptable in a pessimistic locking scheme
Modified: core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java 2008-08-28 16:24:02 UTC (rev 6631)
+++ core/trunk/src/test/java/org/jboss/cache/lock/PessimisticLockTest.java 2008-08-28 16:25:14 UTC (rev 6632)
@@ -5,6 +5,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
+import org.jboss.cache.config.Configuration;
import static org.jboss.cache.lock.LockType.READ;
import static org.jboss.cache.lock.LockType.WRITE;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
@@ -36,6 +37,7 @@
{
cache = new DefaultCacheFactory<Object, Object>().createCache(false);
cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
cache.start();
tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
lockManager = TestingUtil.extractLockManager(cache);
16 years, 3 months
JBoss Cache SVN: r6631 - in core/trunk/src/test: resources and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-28 12:24:02 -0400 (Thu, 28 Aug 2008)
New Revision: 6631
Added:
core/trunk/src/test/java/org/jboss/cache/lock/PessimisticAcquireAllTest.java
Removed:
core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java
Modified:
core/trunk/src/test/resources/log4j.xml
Log:
this scenario is only acceptable in a pessimistic locking scheme
Deleted: core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java 2008-08-28 16:21:28 UTC (rev 6630)
+++ core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java 2008-08-28 16:24:02 UTC (rev 6631)
@@ -1,92 +0,0 @@
-package org.jboss.cache.lock;
-
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.util.TestingUtil;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
-import static org.testng.AssertJUnit.assertEquals;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.Test;
-
-/**
- * @author Bela Ban
- * @version $Id$
- */
-@Test(groups = {"functional"})
-public class AcquireAllTest
-{
- CacheSPI<Object, Object> cache = null, cache2;
- final Fqn FQN = Fqn.fromString("/myNode");
- final String KEY = "key";
- final String VALUE = "value";
-
- @AfterMethod(alwaysRun = true)
- public void tearDown() throws Exception
- {
- TestingUtil.killCaches(cache, cache2);
- }
-
-
- public void testAcquireAll() throws Exception
- {
- NodeSPI root;
- Object owner = Thread.currentThread();
-
- cache = createCache(Configuration.CacheMode.LOCAL, IsolationLevel.SERIALIZABLE);
- cache.put("/a/b/c", null);
- cache.put("/1/2/3", null);
-
- root = cache.getRoot();
- NodeLock lock = root.getLock();
-
- lock.acquireAll(owner, 2000, LockType.READ);
- lock.releaseAll(owner);
-
- assertEquals(0, cache.getNumberOfLocksHeld());
-
- lock.acquireAll(owner, 2000, LockType.WRITE);
- lock.releaseAll(owner);
-
- assertEquals(0, cache.getNumberOfLocksHeld());
- }
-
-
- public void testAcquireAllReplicated() throws Exception
- {
- NodeSPI root;
- Object owner = Thread.currentThread();
-
- cache2 = createCache(Configuration.CacheMode.REPL_ASYNC, IsolationLevel.SERIALIZABLE);
- cache2.put("/a/b/c", null);
- cache2.put("/1/2/3", null);
-
- cache = createCache(Configuration.CacheMode.REPL_ASYNC, IsolationLevel.SERIALIZABLE);
- root = cache.getRoot();
- NodeLock lock = root.getLock();
-
- lock.acquireAll(owner, 2000, LockType.READ);
- lock.releaseAll(owner);
-
- assertEquals(0, cache.getNumberOfLocksHeld());
-
- lock.acquireAll(owner, 2000, LockType.WRITE);
- lock.releaseAll(owner);
-
- assertEquals(0, cache.getNumberOfLocksHeld());
- }
-
-
- private CacheSPI<Object, Object> createCache(Configuration.CacheMode mode, IsolationLevel level)
- {
- CacheSPI<Object, Object> c = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
- c.getConfiguration().setCacheMode(mode);
- c.getConfiguration().setIsolationLevel(level);
- c.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
- c.create();
- c.start();
- return c;
- }
-}
Copied: core/trunk/src/test/java/org/jboss/cache/lock/PessimisticAcquireAllTest.java (from rev 6621, core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/PessimisticAcquireAllTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/lock/PessimisticAcquireAllTest.java 2008-08-28 16:24:02 UTC (rev 6631)
@@ -0,0 +1,93 @@
+package org.jboss.cache.lock;
+
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.util.TestingUtil;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author Bela Ban
+ * @version $Id$
+ */
+@Test(groups = {"functional"})
+public class PessimisticAcquireAllTest
+{
+ CacheSPI<Object, Object> cache = null, cache2;
+ final Fqn FQN = Fqn.fromString("/myNode");
+ final String KEY = "key";
+ final String VALUE = "value";
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown() throws Exception
+ {
+ TestingUtil.killCaches(cache, cache2);
+ }
+
+
+ public void testAcquireAll() throws Exception
+ {
+ NodeSPI root;
+ Object owner = Thread.currentThread();
+
+ cache = createCache(Configuration.CacheMode.LOCAL, IsolationLevel.SERIALIZABLE);
+ cache.put("/a/b/c", null);
+ cache.put("/1/2/3", null);
+
+ root = cache.getRoot();
+ NodeLock lock = root.getLock();
+
+ lock.acquireAll(owner, 2000, LockType.READ);
+ lock.releaseAll(owner);
+
+ assertEquals(0, cache.getNumberOfLocksHeld());
+
+ lock.acquireAll(owner, 2000, LockType.WRITE);
+ lock.releaseAll(owner);
+
+ assertEquals(0, cache.getNumberOfLocksHeld());
+ }
+
+
+ public void testAcquireAllReplicated() throws Exception
+ {
+ NodeSPI root;
+ Object owner = Thread.currentThread();
+
+ cache2 = createCache(Configuration.CacheMode.REPL_ASYNC, IsolationLevel.SERIALIZABLE);
+ cache2.put("/a/b/c", null);
+ cache2.put("/1/2/3", null);
+
+ cache = createCache(Configuration.CacheMode.REPL_ASYNC, IsolationLevel.SERIALIZABLE);
+ root = cache.getRoot();
+ NodeLock lock = root.getLock();
+
+ lock.acquireAll(owner, 2000, LockType.READ);
+ lock.releaseAll(owner);
+
+ assertEquals(0, cache.getNumberOfLocksHeld());
+
+ lock.acquireAll(owner, 2000, LockType.WRITE);
+ lock.releaseAll(owner);
+
+ assertEquals(0, cache.getNumberOfLocksHeld());
+ }
+
+
+ private CacheSPI<Object, Object> createCache(Configuration.CacheMode mode, IsolationLevel level)
+ {
+ CacheSPI<Object, Object> c = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
+ c.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ c.getConfiguration().setCacheMode(mode);
+ c.getConfiguration().setIsolationLevel(level);
+ c.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ c.create();
+ c.start();
+ return c;
+ }
+}
Property changes on: core/trunk/src/test/java/org/jboss/cache/lock/PessimisticAcquireAllTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: core/trunk/src/test/resources/log4j.xml
===================================================================
--- core/trunk/src/test/resources/log4j.xml 2008-08-28 16:21:28 UTC (rev 6630)
+++ core/trunk/src/test/resources/log4j.xml 2008-08-28 16:24:02 UTC (rev 6631)
@@ -10,7 +10,7 @@
<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../jbosscache.log"/>
- <param name="Append" value="true"/>
+ <param name="Append" value="false"/>
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
@@ -46,9 +46,13 @@
<!-- ================ -->
<category name="org.jboss.cache">
- <priority value="WARN"/>
+ <priority value="TRACE"/>
</category>
+ <category name="org.jboss.cache.lock.BreakDeadMemberLocksTest">
+ <priority value="TRACE"/>
+ </category>
+
<category name="org.jboss.cache.factories">
<priority value="WARN"/>
</category>
@@ -66,7 +70,7 @@
<!-- ======================= -->
<root>
- <!--<appender-ref ref="CONSOLE"/>-->
+ <appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
16 years, 3 months
JBoss Cache SVN: r6630 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-28 12:21:28 -0400 (Thu, 28 Aug 2008)
New Revision: 6630
Modified:
core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java
Log:
this scenario is only acceptable in a pessimistic locking scheme
Modified: core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java 2008-08-28 10:55:54 UTC (rev 6629)
+++ core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java 2008-08-28 16:21:28 UTC (rev 6630)
@@ -26,6 +26,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.assertEquals;
@@ -154,6 +155,7 @@
}
CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
cache.create();
cache.start();
16 years, 3 months
JBoss Cache SVN: r6629 - core/trunk/src/main/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-28 06:55:54 -0400 (Thu, 28 Aug 2008)
New Revision: 6629
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java
Log:
removed redundant field - status
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java 2008-08-28 07:08:02 UTC (rev 6628)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java 2008-08-28 10:55:54 UTC (rev 6629)
@@ -22,7 +22,6 @@
*/
public class DummyUserTransaction implements UserTransaction, java.io.Serializable
{
- int status = Status.STATUS_UNKNOWN;
static final Log logger_ = LogFactory.getLog(DummyUserTransaction.class);
DummyTransactionManager tm_;
private static final long serialVersionUID = -6568400755677046127L;
@@ -50,7 +49,6 @@
public void begin() throws NotSupportedException, SystemException
{
tm_.begin();
- status = Status.STATUS_ACTIVE;
}
/**
@@ -75,7 +73,6 @@
{
tm_.commit();
- status = Status.STATUS_COMMITTED;
}
/**
@@ -91,7 +88,6 @@
public void rollback() throws IllegalStateException, SystemException
{
tm_.rollback();
- status = Status.STATUS_ROLLEDBACK;
}
/**
16 years, 3 months
JBoss Cache SVN: r6628 - searchable/trunk/src/main/java/org/jboss/cache/search.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-08-28 03:08:02 -0400 (Thu, 28 Aug 2008)
New Revision: 6628
Modified:
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/IndexSearcherCloser.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java
searchable/trunk/src/main/java/org/jboss/cache/search/LazyQueryResultIterator.java
searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterator.java
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java
Log:
Cleaned up javadocs and LGPL licenese put in all classes.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.Fqn;
@@ -5,6 +27,7 @@
/**
*
* This class is used to get fqns, keys and documentId's by calling methods on {@link org.jboss.cache.search.Transformer}
+ * <p/>
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class CacheEntityId
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.Cache;
@@ -9,6 +31,7 @@
/**
* Class that is used to load objects from a list of CacheEntityId ids.
+ * <p/>
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class CacheEntityLoader
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.apache.lucene.search.Sort;
@@ -10,7 +32,9 @@
* A cache-query is what will be returned when the createQuery() method is run. This object can have methods such
* as list, setFirstResult,setMaxResults, setFetchSize, getResultSize and setSort.
*
+ * <p/>
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* @see org.jboss.cache.search.SearchableCache#createQuery(org.apache.lucene.search.Query)
*/
public interface CacheQuery extends Iterable
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.apache.commons.logging.Log;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/IndexSearcherCloser.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/IndexSearcherCloser.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/IndexSearcherCloser.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.hibernate.search.engine.SearchFactoryImplementor;
@@ -9,9 +31,11 @@
import java.util.Set;
/**
+ * Class with static method that is called by {@link CacheQueryImpl} and {@link org.jboss.cache.search.QueryResultIteratorImpl}
+ * <p />
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
-public class IndexSearcherCloser
+ class IndexSearcherCloser
{
static void closeSearcher(Searcher searcher, ReaderProvider readerProvider)
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.CacheException;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
/**
- * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ * * Thrown when an invalid Key is passed into {@link org.jboss.cache.search.Transformer#generateId(org.jboss.cache.Fqn, String)}
+ * <p />
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class InvalidKeyException extends Exception
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/LazyQueryResultIterator.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/LazyQueryResultIterator.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/LazyQueryResultIterator.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.search.CacheEntityLoader;
@@ -10,6 +32,10 @@
import java.io.IOException;
/**
+ * Implementation for {@link org.jboss.cache.search.QueryResultIterator}. This is what is returned when
+ * the {@link CacheQuery#lazyIterator()} method is called. This loads the results only when required and hence differs from
+ * {@link org.jboss.cache.search.QueryResultIteratorImpl} which is the other implementation of QueryResultIterator.
+ *
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class LazyQueryResultIterator implements QueryResultIterator
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.hibernate.search.backend.TransactionContext;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+///*
+// * JBoss, Home of Professional Open Source
+// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+// * by the @authors tag. See the copyright.txt in the distribution for a
+// * full listing of individual contributors.
+// *
+// * This is free software; you can redistribute it and/or modify it
+// * under the terms of the GNU Lesser General Public License as
+// * published by the Free Software Foundation; either version 2.1 of
+// * the License, or (at your option) any later version.
+// *
+// * This software is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// * Lesser General Public License for more details.
+// *
+// * You should have received a copy of the GNU Lesser General Public
+// * License along with this software; if not, write to the Free
+// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+// * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+// */
+//
//package org.jboss.cache.search;
//
//import org.hibernate.search.transaction.TransactionContext;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterator.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterator.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterator.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import java.util.ListIterator;
@@ -4,8 +26,9 @@
/**
* Iterates over query results
- *
+ * <p/>
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">manik(a)jboss.org</a>)
*/
public interface QueryResultIterator extends ListIterator
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.Cache;
@@ -9,6 +31,8 @@
* This is the implementation class for the interface QueryResultIterator which extends ListIterator. It is what is
* returned when the iterator() method is run on a CacheQuery instance.
*
+ * <p/>
+ *
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class QueryResultIteratorImpl implements QueryResultIterator
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.apache.lucene.search.Query;
@@ -4,12 +26,12 @@
import org.jboss.cache.Cache;
/**
- * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
- * <p/>
* This will be the most used interface in JBossCache searchable. It extends Cache and therefore will have
* the standard get(), put() and remove() methods. The additional method is the createQuery method which people
* will use to build their Hibernate Search queries from a luceneQuery - Hibernate Search users will be very familiar
* with this.
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ * <p/>
*/
public interface SearchableCache<K, V> extends Cache<K, V>
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.hibernate.search.cfg.SearchConfiguration;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.hibernate.search.impl.SearchFactoryImpl;
@@ -12,6 +34,12 @@
import java.lang.reflect.Field;
/**
+ * Factory class used to create the searchable-cache like so: -
+ *
+ * <p/>
+ * SearchableCache searchableCache = SearchableCacheFactory.createSearchableCache(coreCache, class[]);
+ *
+ * <p/>
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class SearchableCacheFactory
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.apache.lucene.search.Query;
@@ -19,9 +41,10 @@
import java.util.Set;
/**
+ * Implementation class for the SearchableCache interface.
+ * <p/>
+ *
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
- * <p/>
- * Implementation class for the SearchableCache interface.
*/
public class SearchableCacheImpl<K, V> implements SearchableCache<K, V>
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.hibernate.search.impl.SearchFactoryImpl;
@@ -16,7 +38,7 @@
/**
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*
- * Listener class for changes made to the cache. This listener makes changes if it is a org.jboss.cache being used.
+ * Listener class for changes made to the cache. This listener makes changes if it is a {@link org.jboss.cache.Cache} being used.
*/
@CacheListener
public class SearchableCoreListener
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+///*
+// * JBoss, Home of Professional Open Source
+// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+// * by the @authors tag. See the copyright.txt in the distribution for a
+// * full listing of individual contributors.
+// *
+// * This is free software; you can redistribute it and/or modify it
+// * under the terms of the GNU Lesser General Public License as
+// * published by the Free Software Foundation; either version 2.1 of
+// * the License, or (at your option) any later version.
+// *
+// * This software is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// * Lesser General Public License for more details.
+// *
+// * You should have received a copy of the GNU Lesser General Public
+// * License along with this software; if not, write to the Free
+// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+// * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+// */
+//
//package org.jboss.cache.search;
//
//import org.hibernate.search.impl.SearchFactoryImpl;
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java 2008-08-27 13:56:58 UTC (rev 6627)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java 2008-08-28 07:08:02 UTC (rev 6628)
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.cache.search;
import org.jboss.cache.Fqn;
@@ -3,5 +25,4 @@
/**
-* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*
* This class is one that does all the 'conversion' work between JBossCache and Hibernate Search. This is where
@@ -10,7 +31,8 @@
*
* If the Fqn is in the form /a/b/c and the key - which has to be a String - is keystring; the documentId - which is also
* a String - will be "Fqn=[/a/b/c]Key=[keystring]"
-*
+*
+* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class Transformer
{
16 years, 3 months
JBoss Cache SVN: r6627 - in core/trunk/src: test/java/org/jboss/cache/factories and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-27 09:56:58 -0400 (Wed, 27 Aug 2008)
New Revision: 6627
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/test/java/org/jboss/cache/factories/LifeCycleTest.java
Log:
fixed test
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08-27 13:21:43 UTC (rev 6626)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08-27 13:56:58 UTC (rev 6627)
@@ -400,9 +400,24 @@
public int getNumberOfNodes()
{
- return numNodes(root) - 1;
+ if (!usingMvcc) return numNodes(root) - 1;
+ return numNodesMvcc(rootInternal) - 1;
}
+ private int numNodesMvcc(InternalNode node)
+ {
+ int count = 1; //for 'node'
+ if (node != null)
+ {
+ Set<InternalNode> children = node.getChildren();
+ for (InternalNode child : children)
+ {
+ count += numNodesMvcc((InternalNode) child);
+ }
+ }
+ return count;
+ }
+
private int numNodes(NodeSPI n)
{
int count = 1;// for n
Modified: core/trunk/src/test/java/org/jboss/cache/factories/LifeCycleTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/LifeCycleTest.java 2008-08-27 13:21:43 UTC (rev 6626)
+++ core/trunk/src/test/java/org/jboss/cache/factories/LifeCycleTest.java 2008-08-27 13:56:58 UTC (rev 6627)
@@ -74,9 +74,11 @@
assertEquals(0, c[0].getNumberOfLocksHeld());
}
- public void testLocalRestartWithTransactions() throws Exception
+ public void testLocalRestartWithTransactionsPessimistic() throws Exception
{
- createAndRegisterCache(Configuration.CacheMode.LOCAL, true);
+ createAndRegisterCache(Configuration.CacheMode.LOCAL, false);
+ c[0].getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ c[0].start();
TransactionManager tm = beginTransaction();
16 years, 4 months
JBoss Cache SVN: r6626 - core/trunk/src/test/java/org/jboss/cache/factories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-27 09:21:43 -0400 (Wed, 27 Aug 2008)
New Revision: 6626
Modified:
core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
Log:
fixed test
Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-08-27 12:34:27 UTC (rev 6625)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-08-27 13:21:43 UTC (rev 6626)
@@ -10,6 +10,7 @@
import static org.jboss.cache.config.Configuration.NodeLockingScheme.MVCC;
import static org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.DummyInMemoryCacheLoader;
@@ -32,9 +33,11 @@
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
- cache = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(false);
- cache.getConfiguration().setCacheMode(LOCAL);
- cache.getConfiguration().setUseLazyDeserialization(false);
+ Configuration configuration = new Configuration();
+ configuration.setCacheMode(LOCAL);
+ configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ configuration.setUseLazyDeserialization(false);
+ cache = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(configuration,false);
}
@AfterMethod(alwaysRun = true)
@@ -484,7 +487,8 @@
}
}
);
- InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+ InterceptorChainFactory factory = getInterceptorChainFactory(cache);
+ InterceptorChain chain = factory.buildInterceptorChain();
List<CommandInterceptor> list = chain.asList();
Iterator<CommandInterceptor> interceptors = list.iterator();
16 years, 4 months
JBoss Cache SVN: r6625 - in core/trunk/src: test/java/org/jboss/cache/commands and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-27 08:34:27 -0400 (Wed, 27 Aug 2008)
New Revision: 6625
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
core/trunk/src/test/java/org/jboss/cache/commands/StructuralNodesOnRollbackTest.java
Log:
exist command should also look into the InvocationContext, as the node might be only in the transaction context
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-08-27 12:32:37 UTC (rev 6624)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-08-27 12:34:27 UTC (rev 6625)
@@ -2,6 +2,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
/**
@@ -40,8 +41,8 @@
*/
public Object perform(InvocationContext ctx)
{
- // this command will use the data container directly since it does not require any form of locking.
- return dataContainer.exists(fqn);
+ NodeSPI node = ctx.lookUpNode(fqn);
+ return node != null && !node.isDeleted();
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Modified: core/trunk/src/test/java/org/jboss/cache/commands/StructuralNodesOnRollbackTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/StructuralNodesOnRollbackTest.java 2008-08-27 12:32:37 UTC (rev 6624)
+++ core/trunk/src/test/java/org/jboss/cache/commands/StructuralNodesOnRollbackTest.java 2008-08-27 12:34:27 UTC (rev 6625)
@@ -2,6 +2,8 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.util.TestingUtil;
@@ -28,8 +30,7 @@
public void setUp()
{
Configuration cacheConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, false);
- cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(cacheConfig, false);
- cache.start();
+ cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(cacheConfig);
txMgr = cache.getTransactionManager();
}
@@ -39,6 +40,17 @@
TestingUtil.killCaches(cache);
}
+ public void testNoTx() throws Exception
+ {
+ txMgr.begin();
+ cache.put("/a/b/c", "k","v");
+ NodeSPI<Object,Object> root = cache.getRoot();
+ assert root.getChild("a") != null;
+ assert root.getChild(Fqn.fromString("/a/b/c")) != null;
+ assert cache.exists("/a/b");
+ txMgr.rollback();
+ }
+
public void testPutDataMap() throws Exception
{
HashMap map = new HashMap();
16 years, 4 months