[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at belmont.prod.atl2.jboss.com
Tue Aug 29 12:35:52 EDT 2006
User: msurtani
Date: 06/08/29 12:35:52
Modified: src/org/jboss/cache InvocationContext.java
TreeCacheProxyImpl.java
Log:
Fixed basic replication issues
Revision Changes Path
1.9 +168 -140 JBossCache/src/org/jboss/cache/InvocationContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InvocationContext.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/InvocationContext.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- InvocationContext.java 22 Aug 2006 12:27:51 -0000 1.8
+++ InvocationContext.java 29 Aug 2006 16:35:52 -0000 1.9
@@ -37,6 +37,7 @@
/**
* Retrieves the transaction associated with this invocation
+ *
* @return The transaction associated with this invocation
*/
public Transaction getTransaction()
@@ -46,6 +47,7 @@
/**
* Sets the transaction associated with this invocation
+ *
* @param transaction
*/
public void setTransaction(Transaction transaction)
@@ -55,6 +57,7 @@
/**
* Retrieves the global transaction associated with this invocation
+ *
* @return the global transaction associated with this invocation
*/
public GlobalTransaction getGlobalTransaction()
@@ -64,6 +67,7 @@
/**
* Sets the global transaction associated with this invocation
+ *
* @param globalTransaction
*/
public void setGlobalTransaction(GlobalTransaction globalTransaction)
@@ -73,6 +77,7 @@
/**
* Retrieves the option overrides associated with this invocation
+ *
* @return the option overrides associated with this invocation
*/
public Option getOptionOverrides()
@@ -86,6 +91,7 @@
/**
* Sets the option overrides associated with this invocation
+ *
* @param optionOverrides
*/
public void setOptionOverrides(Option optionOverrides)
@@ -95,6 +101,7 @@
/**
* Tests if this invocation originated locally or from a remote cache.
+ *
* @return true if the invocation originated locally.
*/
public boolean isOriginLocal()
@@ -105,6 +112,7 @@
/**
* If set to true, the invocation is assumed to have originated locally. If set to false,
* assumed to have originated from a remote cache.
+ *
* @param originLocal
*/
public void setOriginLocal(boolean originLocal)
@@ -157,4 +165,24 @@
clone.setOptionOverrides(getOptionOverrides().clone());
return clone;
}
+
+ /**
+ * Sets the state of the InvocationContext based on the template context passed in
+ *
+ * @param template
+ */
+ public void setState(InvocationContext template)
+ {
+ if (template == null)
+ {
+ throw new NullPointerException("Template InvocationContext passed in to InvocationContext.setState() passed in is null");
+ }
+
+ this.setGlobalTransaction(template.getGlobalTransaction());
+ this.setLocalRollbackOnly(template.isLocalRollbackOnly());
+ this.setOptionOverrides(template.getOptionOverrides());
+ this.setOriginLocal(template.isOriginLocal());
+ this.setTransaction(template.getTransaction());
+ this.setTxHasMods(template.isTxHasMods());
+ }
}
1.19 +503 -499 JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheProxyImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- TreeCacheProxyImpl.java 25 Aug 2006 14:10:09 -0000 1.18
+++ TreeCacheProxyImpl.java 29 Aug 2006 16:35:52 -0000 1.19
@@ -15,10 +15,10 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.IdentityLock;
+import org.jboss.cache.marshall.MethodCall;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jgroups.Address;
-import org.jboss.cache.marshall.MethodCall;
import javax.management.ObjectName;
import javax.transaction.Transaction;
@@ -249,22 +249,22 @@
public void create() throws Exception
{
- treeCache.create();
+ treeCache.createService();
}
public void start() throws Exception
{
- treeCache.start();
+ treeCache.startService();
}
public void stop()
{
- treeCache.stop();
+ treeCache.stopService();
}
public void destroy()
{
- treeCache.destroy();
+ treeCache.destroyService();
}
public Node getParent()
@@ -278,7 +278,9 @@
Set<Node> children = new HashSet<Node>(m.size());
Iterator i = m.values().iterator();
while (i.hasNext())
+ {
children.add(new TreeCacheProxyImpl(treeCache, (NodeImpl) i.next()));
+ }
return children;
}
@@ -411,7 +413,10 @@
treeCache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
return value;
}
- else return treeCache.remove(currentNode.getFqn(), k);
+ else
+ {
+ return treeCache.remove(currentNode.getFqn(), k);
+ }
}
public void clearData()
@@ -464,7 +469,6 @@
return treeCache.started;
}
-
// -----------
// TODO: Think about what we need to do here regarding locking on Nodes
More information about the jboss-cvs-commits
mailing list