[jboss-cvs] JBossCache/src/org/jboss/cache/optimistic ...

Manik Surtani msurtani at jboss.com
Sat Dec 30 21:08:42 EST 2006


  User: msurtani
  Date: 06/12/30 21:08:42

  Modified:    src/org/jboss/cache/optimistic  WorkspaceNodeImpl.java
  Log:
  Updates to tests to go along with changes in node methods
  
  Revision  Changes    Path
  1.35      +11 -13    JBossCache/src/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WorkspaceNodeImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/optimistic/WorkspaceNodeImpl.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -b -r1.34 -r1.35
  --- WorkspaceNodeImpl.java	30 Dec 2006 19:48:46 -0000	1.34
  +++ WorkspaceNodeImpl.java	31 Dec 2006 02:08:42 -0000	1.35
  @@ -289,7 +289,7 @@
   
      public Object getName()
      {
  -      return node.getFqn().getLast();
  +      return node.getFqn().getLastElement();
      }
   
      public TransactionWorkspace getTransactionWorkspace()
  @@ -377,16 +377,9 @@
   
      public Node getChild(Fqn f)
      {
  -      boolean origVal = getCache().getInvocationContext().getOptionOverrides().isBypassInterceptorChain();
  -      if (!origVal) getCache().getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
  -      try
  -      {
  -         return node.getChild(f);
  -      }
  -      finally
  -      {
  -         if (!origVal) getCache().getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  -      }
  +      if (f.size() > 1)
  +         throw new UnsupportedOperationException("Workspace node does not support fetching indirect children");
  +      return getChild(f.getLastElement());
      }
   
      public Set<Node> getChildren()
  @@ -430,8 +423,13 @@
   
      public void removeChild(Fqn f)
      {
  -      throw new UnsupportedOperationException();
  -      // TODO Auto-generated method stub
  +      if (f.size() > 1) throw new UnsupportedOperationException("Workspace nodes can only remove direct children!");
  +      Object key = f.getLastElement();
  +      if (optimisticChildNodeMap.containsKey(key))
  +      {
  +         dirty = true;
  +         optimisticChildNodeMap.remove(key);
  +      }
      }
   
      public void removeChildren()
  
  
  



More information about the jboss-cvs-commits mailing list