[infinispan-commits] Infinispan SVN: r1069 - in trunk: core/src/main/java/org/infinispan/commands/control and 10 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu Oct 29 11:06:56 EDT 2009
Author: manik.surtani at jboss.com
Date: 2009-10-29 11:06:55 -0400 (Thu, 29 Oct 2009)
New Revision: 1069
Removed:
trunk/core/src/main/java/org/infinispan/distribution/RehashHandler.java
Modified:
trunk/cachestore/jdbm/src/main/java/org/infinispan/loaders/jdbm/JdbmCacheStore.java
trunk/core/src/main/java/org/infinispan/commands/control/LockControlCommand.java
trunk/core/src/main/java/org/infinispan/container/EntryFactory.java
trunk/core/src/main/java/org/infinispan/distribution/AbstractConsistentHash.java
trunk/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java
trunk/core/src/main/java/org/infinispan/distribution/RehashTask.java
trunk/core/src/main/java/org/infinispan/distribution/TransactionLoggerImpl.java
trunk/core/src/main/java/org/infinispan/factories/RpcManagerFactory.java
trunk/core/src/main/java/org/infinispan/interceptors/InterceptorChain.java
trunk/core/src/main/java/org/infinispan/transaction/tm/DummyXid.java
trunk/core/src/main/java/org/infinispan/transaction/xa/RemoteTransaction.java
trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java
trunk/jopr-plugin/pom.xml
trunk/parent/pom.xml
trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java
trunk/src/main/resources/assemblies/single_jar.xml
Log:
Cleaned up a whole bunch of TODOs
Modified: trunk/cachestore/jdbm/src/main/java/org/infinispan/loaders/jdbm/JdbmCacheStore.java
===================================================================
--- trunk/cachestore/jdbm/src/main/java/org/infinispan/loaders/jdbm/JdbmCacheStore.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/cachestore/jdbm/src/main/java/org/infinispan/loaders/jdbm/JdbmCacheStore.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -97,7 +97,7 @@
cacheDbName = locationStr.substring(offset + 1);
locationStr = locationStr.substring(0, offset);
} else {
- cacheDbName = cache.getName(); // TODO
+ cacheDbName = cache.getName();
if (cacheDbName == null)
cacheDbName = "jdbm";
}
Modified: trunk/core/src/main/java/org/infinispan/commands/control/LockControlCommand.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/commands/control/LockControlCommand.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/commands/control/LockControlCommand.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -23,7 +23,6 @@
import org.infinispan.commands.Visitor;
import org.infinispan.commands.tx.AbstractTransactionBoundaryCommand;
-import org.infinispan.commands.write.WriteCommand;
import org.infinispan.context.InvocationContext;
import org.infinispan.context.impl.RemoteTxInvocationContext;
import org.infinispan.context.impl.TxInvocationContext;
@@ -93,9 +92,8 @@
boolean remoteTxinitiated = transaction != null;
if (!remoteTxinitiated) {
- //create bogus modifications (we do not know modifications ahead of time)
- //todo - make a create method that does not require creation of a WriteCommand[]
- transaction = txTable.createRemoteTransaction(globalTx, new WriteCommand[]{});
+ //create a remote tx without any modifications (we do not know modifications ahead of time)
+ transaction = txTable.createRemoteTransaction(globalTx);
}
ctxt.setRemoteTransaction(transaction);
return invoker.invoke(ctxt, this);
Modified: trunk/core/src/main/java/org/infinispan/container/EntryFactory.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/container/EntryFactory.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/container/EntryFactory.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -28,7 +28,10 @@
import org.infinispan.util.concurrent.TimeoutException;
/**
- * // TODO: MANIK: Document this
+ * A factory for constructing {@link org.infinispan.container.entries.MVCCEntry} instances for use in the {@link org.infinispan.context.InvocationContext}.
+ * Implementations of this interface would typically wrap an internal {@link org.infinispan.container.entries.CacheEntry}
+ * with an {@link org.infinispan.container.entries.MVCCEntry}, optionally acquiring the necessary locks via the
+ * {@link org.infinispan.util.concurrent.locks.LockManager}.
*
* @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
* @author Galder Zamarreño
@@ -51,9 +54,45 @@
*/
boolean acquireLock(InvocationContext ctx, Object key) throws InterruptedException, TimeoutException;
+ /**
+ * Wraps an entry for writing. This would typically acquire write locks if necessary, and place the wrapped
+ * entry in the invocation context.
+ *
+ * @param ctx current invocation context
+ * @param key key to look up and wrap
+ * @param createIfAbsent if true, an entry is created if it does not exist in the data container.
+ * @param forceLockIfAbsent forces a lock even if the entry is absent
+ * @param alreadyLocked if true, this hint prevents the method from acquiring any locks and the existence and ownership of the lock is presumed.
+ * @param forRemoval if true, this hint informs this method that the lock is being acquired for removal.
+ * @return an MVCCEntry instance
+ * @throws InterruptedException when things go wrong, usually trying to acquire a lock
+ */
MVCCEntry wrapEntryForWriting(InvocationContext ctx, Object key, boolean createIfAbsent, boolean forceLockIfAbsent, boolean alreadyLocked, boolean forRemoval) throws InterruptedException;
-
+
+ /**
+ * Wraps an entry for writing. This would typically acquire write locks if necessary, and place the wrapped
+ * entry in the invocation context.
+ *
+ * @param ctx current invocation context
+ * @param entry an internal entry to wrap
+ * @param createIfAbsent if true, an entry is created if it does not exist in the data container.
+ * @param forceLockIfAbsent forces a lock even if the entry is absent
+ * @param alreadyLocked if true, this hint prevents the method from acquiring any locks and the existence and ownership of the lock is presumed.
+ * @param forRemoval if true, this hint informs this method that the lock is being acquired for removal.
+ * @return an MVCCEntry instance
+ * @throws InterruptedException when things go wrong, usually trying to acquire a lock
+ */
MVCCEntry wrapEntryForWriting(InvocationContext ctx, InternalCacheEntry entry, boolean createIfAbsent, boolean forceLockIfAbsent, boolean alreadyLocked, boolean forRemoval) throws InterruptedException;
+ /**
+ * Wraps an entry for reading. Usually this is just a raw {@link CacheEntry} but certain combinations of isolation
+ * levels and the presence of an ongoing JTA transaction may force this to be a proper, wrapped MVCCEntry. The entry
+ * is also typically placed in the invocation context.
+ *
+ * @param ctx current invocation context
+ * @param key key to look up and wrap
+ * @return an entry for reading
+ * @throws InterruptedException when things go wrong, usually trying to acquire a lock
+ */
CacheEntry wrapEntryForReading(InvocationContext ctx, Object key) throws InterruptedException;
}
Modified: trunk/core/src/main/java/org/infinispan/distribution/AbstractConsistentHash.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/distribution/AbstractConsistentHash.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/distribution/AbstractConsistentHash.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -8,7 +8,7 @@
import java.util.Map;
/**
- * // TODO: Manik: Document this
+ * An abstract consistent hash implementation that handles common implementations of certain methods.
*
* @author Manik Surtani
* @since 4.0
Modified: trunk/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -10,7 +10,7 @@
import java.util.List;
/**
- * // TODO: Manik: Document this
+ * A helper class that handles the construction of consistent hash instances based on configuration.
*
* @author Manik Surtani
* @since 4.0
@@ -24,6 +24,9 @@
* @param toRemove address to remove
* @param c configuration
* @return a new consistent hash instance of the same type
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
*/
public static ConsistentHash removeAddress(ConsistentHash ch, Address toRemove, Configuration c) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
if (ch instanceof UnionConsistentHash)
@@ -37,42 +40,124 @@
}
}
+ /**
+ * Creates a new UnionConsistentHash instance based on the old instance, removing the provided address from both
+ * target consistent hash instances in the union.
+ *
+ * @param uch union consistent hash instance
+ * @param toRemove address to remove
+ * @param c configuration
+ * @return a new UnionConsistentHash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static UnionConsistentHash removeAddressFromUnionConsistentHash(UnionConsistentHash uch, Address toRemove, Configuration c) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
ConsistentHash newFirstCH = removeAddress(uch.getOldConsistentHash(), toRemove, c);
ConsistentHash newSecondCH = removeAddress(uch.getNewConsistentHash(), toRemove, c);
return new UnionConsistentHash(newFirstCH, newSecondCH);
}
+ /**
+ * Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param c configuration
+ * @param addresses with which to populate the consistent hash
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Configuration c, List<Address> addresses) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
ConsistentHash ch = (ConsistentHash) Util.getInstance(c.getConsistentHashClass());
ch.setCaches(addresses);
return ch;
}
+ /**
+ * Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param c configuration
+ * @param addresses with which to populate the consistent hash
+ * @param moreAddresses to add to the list of addresses
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Configuration c, List<Address> addresses, Address... moreAddresses) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
List<Address> list = new LinkedList<Address>(addresses);
list.addAll(Arrays.asList(moreAddresses));
return createConsistentHash(c, list);
}
+ /**
+ * Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param c configuration
+ * @param addresses with which to populate the consistent hash
+ * @param moreAddresses to add to the list of addresses
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Configuration c, List<Address> addresses, Collection<Address> moreAddresses) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
List<Address> list = new LinkedList<Address>(addresses);
list.addAll(moreAddresses);
return createConsistentHash(c, list);
}
+ /**
+ * Creates a new consistent hash instance based on the type specified, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param clazz type of the consistent hash to create
+ * @param addresses with which to populate the consistent hash
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Class<? extends ConsistentHash> clazz, List<Address> addresses) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
ConsistentHash ch = Util.getInstance(clazz);
if (addresses != null && addresses.size() > 0) ch.setCaches(addresses);
return ch;
}
+ /**
+ * Creates a new consistent hash instance based on the type specified, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param clazz type of the consistent hash to create
+ * @param addresses with which to populate the consistent hash
+ * @param moreAddresses to add to the list of addresses
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Class<? extends ConsistentHash> clazz, List<Address> addresses, Address... moreAddresses) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
List<Address> list = new LinkedList<Address>(addresses);
list.addAll(Arrays.asList(moreAddresses));
return createConsistentHash(clazz, list);
}
+ /**
+ * Creates a new consistent hash instance based on the type specified, and populates the consistent hash
+ * with the collection of addresses passed in.
+ *
+ * @param clazz type of the consistent hash to create
+ * @param addresses with which to populate the consistent hash
+ * @param moreAddresses to add to the list of addresses
+ * @return a new consistent hash instance
+ * @throws ClassNotFoundException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws IllegalAccessException thrown if the consistent hash type cannot be constructed via reflection.
+ * @throws InstantiationException thrown if the consistent hash type cannot be constructed via reflection.
+ */
public static ConsistentHash createConsistentHash(Class<? extends ConsistentHash> clazz, List<Address> addresses, Collection<Address> moreAddresses) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
List<Address> list = new LinkedList<Address>(addresses);
list.addAll(moreAddresses);
Deleted: trunk/core/src/main/java/org/infinispan/distribution/RehashHandler.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/distribution/RehashHandler.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/distribution/RehashHandler.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -1,18 +0,0 @@
-package org.infinispan.distribution;
-
-import org.infinispan.commands.CommandsFactory;
-import org.infinispan.container.DataContainer;
-import org.infinispan.loaders.CacheStore;
-import org.infinispan.remoting.rpc.RpcManager;
-
-/**
- * // TODO: Manik: Document this
- *
- * @author Manik Surtani
- * @since 4.0
- */
-public interface RehashHandler {
-
- void rehash(DataContainer dc, CacheStore cacheStore, RpcManager rpc, CommandsFactory cf);
-
-}
Modified: trunk/core/src/main/java/org/infinispan/distribution/RehashTask.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/distribution/RehashTask.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/distribution/RehashTask.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -22,7 +22,8 @@
import java.util.concurrent.Future;
/**
- * // TODO: Manik: Document this
+ * A task that handles the rehashing of data in the cache system wheh nodes join or leave the cluster. This abstract
+ * class contains common functionality. Subclasses will specify different behavior for nodes joining and leaving.
*
* @author Manik Surtani
* @since 4.0
Modified: trunk/core/src/main/java/org/infinispan/distribution/TransactionLoggerImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/distribution/TransactionLoggerImpl.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/distribution/TransactionLoggerImpl.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -19,8 +19,10 @@
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
- * // TODO: Manik: Document this
+ * A transaction logger to log ongoing transactions in an efficient and thread-safe manner while a rehash is going on.
*
+ * Transaction logs can then be replayed after the state transferred during a rehash has been written.
+ *
* @author Manik Surtani
* @since 4.0
*/
Modified: trunk/core/src/main/java/org/infinispan/factories/RpcManagerFactory.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/RpcManagerFactory.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/factories/RpcManagerFactory.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -25,7 +25,7 @@
import org.infinispan.remoting.rpc.RpcManager;
/**
- * An extension of the EmptyConstructorFactory that places a component in the {@link RuntimeConfig} after creating it.
+ * A factory for the RpcManager
*
* @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
* @since 4.0
@@ -37,7 +37,6 @@
public <T> T construct(Class<T> componentType) {
// only do this if we have a transport configured!
if (globalConfiguration.getTransportClass() == null) return null;
- //todo - throw an excwption if transport is missing
return super.construct(componentType);
}
}
Modified: trunk/core/src/main/java/org/infinispan/interceptors/InterceptorChain.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/interceptors/InterceptorChain.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/interceptors/InterceptorChain.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -22,6 +22,7 @@
package org.infinispan.interceptors;
import org.infinispan.CacheException;
+import org.infinispan.config.ConfigurationException;
import org.infinispan.commands.VisitableCommand;
import org.infinispan.context.InvocationContext;
import org.infinispan.factories.annotations.Start;
@@ -41,8 +42,7 @@
*
* @author Mircea.Markus at jboss.com
* @author Galder Zamarreño
- * @since 4.0 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
+ * @since 4.0
*/
@Scope(Scopes.NAMED_CACHE)
public class InterceptorChain {
@@ -68,12 +68,25 @@
}
/**
+ * Ensures that the interceptor of type passed in isn't already added
+ * @param clazz type of interceptor to check for
+ */
+ private void assertNotAdded(Class<? extends CommandInterceptor> clazz) {
+ CommandInterceptor next = firstInChain;
+ while (next != null) {
+ if (next.getClass().equals(clazz)) throw new ConfigurationException("Detected interceptor of type [" + clazz.getName() + "] being added to the interceptor chain more than once!");
+ next = next.getNext();
+ }
+ }
+
+ /**
* Inserts the given interceptor at the specified position in the chain (o based indexing).
*
* @throws IllegalArgumentException if the position is invalid (e.g. 5 and there are only 2 interceptors in the
* chain)
*/
public synchronized void addInterceptor(CommandInterceptor interceptor, int position) {
+ assertNotAdded(interceptor.getClass());
if (position == 0) {
interceptor.setNext(firstInChain);
firstInChain = interceptor;
Modified: trunk/core/src/main/java/org/infinispan/transaction/tm/DummyXid.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/transaction/tm/DummyXid.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/transaction/tm/DummyXid.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -19,11 +19,11 @@
}
public byte[] getGlobalTransactionId() {
- throw new IllegalStateException("TODO - please implement me!!!"); //todo implement!!!
+ throw new IllegalStateException("Not implemented!");
}
public byte[] getBranchQualifier() {
- throw new IllegalStateException("TODO - please implement me!!!"); //todo implement!!!
+ throw new IllegalStateException("Not implemented!");
}
@Override
Modified: trunk/core/src/main/java/org/infinispan/transaction/xa/RemoteTransaction.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/transaction/xa/RemoteTransaction.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/transaction/xa/RemoteTransaction.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -4,9 +4,11 @@
import org.infinispan.container.entries.CacheEntry;
import org.infinispan.util.BidirectionalLinkedHashMap;
import org.infinispan.util.BidirectionalMap;
+import org.infinispan.util.InfinispanCollections;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -20,7 +22,7 @@
private List<WriteCommand> modifications;
- private BidirectionalLinkedHashMap<Object, CacheEntry> lookedUpEntries;
+ private BidirectionalMap<Object, CacheEntry> lookedUpEntries;
private GlobalTransaction tx;
@@ -31,6 +33,12 @@
this.tx = tx;
}
+ public RemoteTransaction(GlobalTransaction tx) {
+ this.modifications = Collections.emptyList();
+ lookedUpEntries = InfinispanCollections.emptyBidirectionalMap();
+ this.tx = tx;
+ }
+
public GlobalTransaction getGlobalTransaction() {
return tx;
}
@@ -81,11 +89,12 @@
}
@Override
+ @SuppressWarnings("unchecked")
public Object clone() {
try {
RemoteTransaction dolly = (RemoteTransaction) super.clone();
dolly.modifications = new ArrayList<WriteCommand>(modifications);
- dolly.lookedUpEntries = lookedUpEntries.clone();
+ dolly.lookedUpEntries = ((BidirectionalLinkedHashMap) lookedUpEntries).clone();
return dolly;
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Impossible!!");
Modified: trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/core/src/main/java/org/infinispan/transaction/xa/TransactionTable.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -73,16 +73,32 @@
*/
public RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx, WriteCommand[] modifications) {
RemoteTransaction remoteTransaction = new RemoteTransaction(modifications, globalTx);
- RemoteTransaction transaction = remoteTransactions.put(globalTx, remoteTransaction);
+ registerRemoteTransaction(globalTx, remoteTransaction);
+ return remoteTransaction;
+ }
+
+ /**
+ * Creates and register a {@link org.infinispan.transaction.xa.RemoteTransaction} with no modifications.
+ * Returns the created transaction.
+ *
+ * @throws IllegalStateException if an attempt to create a {@link org.infinispan.transaction.xa.RemoteTransaction}
+ * for an already registered id is made.
+ */
+ public RemoteTransaction createRemoteTransaction(GlobalTransaction globalTx) {
+ RemoteTransaction remoteTransaction = new RemoteTransaction(globalTx);
+ registerRemoteTransaction(globalTx, remoteTransaction);
+ return remoteTransaction;
+ }
+
+ private void registerRemoteTransaction(GlobalTransaction gtx, RemoteTransaction rtx) {
+ RemoteTransaction transaction = remoteTransactions.put(gtx, rtx);
if (transaction != null) {
String message = "A remote transaction with the given id was already registred!!!";
log.error(message);
throw new IllegalStateException(message);
}
- if (trace) {
- log.trace("Created and registered remote transaction " + remoteTransaction);
- }
- return remoteTransaction;
+
+ if (trace) log.trace("Created and registered remote transaction " + rtx);
}
/**
Modified: trunk/jopr-plugin/pom.xml
===================================================================
--- trunk/jopr-plugin/pom.xml 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/jopr-plugin/pom.xml 2009-10-29 15:06:55 UTC (rev 1069)
@@ -156,8 +156,7 @@
</goals>
<configuration>
<artifactItems>
- <!-- TODO include other needed external jars
- that should go into your jar file -->
+ <!-- TODO include other needed external jars that should go into your jar file -->
<artifactItem>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/parent/pom.xml 2009-10-29 15:06:55 UTC (rev 1069)
@@ -346,7 +346,6 @@
<repository>
<!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
<!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
- <!-- TODO : replace this with direct svn access once the svnkit providers are available -->
<id>repository.jboss.org</id>
<url>file://${maven.repository.root}</url>
</repository>
Modified: trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java 2009-10-29 15:06:55 UTC (rev 1069)
@@ -4,8 +4,6 @@
import org.infinispan.query.QueryIterator;
/**
- * // TODO: Document this
- * <p/>
* This is the abstract superclass of the 2 iterators. Since some of the methods have the same implementations they have
* been put onto a separate class.
*
Modified: trunk/src/main/resources/assemblies/single_jar.xml
===================================================================
--- trunk/src/main/resources/assemblies/single_jar.xml 2009-10-29 14:11:18 UTC (rev 1068)
+++ trunk/src/main/resources/assemblies/single_jar.xml 2009-10-29 15:06:55 UTC (rev 1069)
@@ -84,7 +84,6 @@
<binaries>
<unpack>false</unpack>
- <!-- TODO do not insert the project jar itself, only the deps -->
<outputDirectory>/.ignore</outputDirectory>
<dependencySets>
<dependencySet>
More information about the infinispan-commits
mailing list