Package org.jboss.cache.marshall

Examples of org.jboss.cache.marshall.MethodCall


      // create a compensating method call (reverting the effect of
      // this modification) and put it into the TX's undo list.
      if (tx != null && create_undo_ops)
      {
         MethodCall undo_op;
         if (old_value == null)
         {
            undo_op = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal_id, tx, fqn, key, false);
         }
         else
View Full Code Here


         throws CacheException
   {

      NodeSPI n;
      NodeSPI parent_node;
      MethodCall undo_op;

      if (trace)
      {
         log.trace("_remove(" + tx + ", \"" + fqn + "\", undo=" + create_undo_ops + ")");
      }
View Full Code Here

    * @return Object
    */
   public Object _remove(GlobalTransaction tx, Fqn fqn, Object key, boolean create_undo_ops)
         throws CacheException
   {
      MethodCall undo_op;
      Object old_value;

      if (trace)
      {
         log.trace("_remove(" + tx + ", \"" + fqn + "\", key=" + key + ")");
View Full Code Here

    * Internal method to remove data from a node.
    */
   public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction, DataVersion version)
         throws CacheException
   {
      MethodCall undo_op = null;

      if (trace)
      {
         log.trace("_removeData(" + tx + ", \"" + fqn + "\")");
      }
View Full Code Here

         notifier.notifyNodeMoved(nodeToMoveFqn, new Fqn(newParentFqn, nodeToMoveFqn.getLastElement()), false, ctx);

      // now register an undo op
      if (ctx.getTransaction() != null)
      {
         MethodCall undo = MethodCallFactory.create(MethodDeclarations.moveMethodLocal_id, new Fqn(newParentFqn, nodeToMoveFqn.getLastElement()), oldParent.getFqn());
         transactionTable.addUndoOperation(ctx.getGlobalTransaction(), undo);
      }
   }
View Full Code Here

   public void testFqnManipulation()
   {
      Fqn fqn1 = Fqn.fromString("/hello/world");

      MethodCall call1 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn1, "key", "value");
      MethodCall call2 = MethodCallFactory.create(MethodDeclarations.replicateMethod_id, call1);

      BuddyManager bm = createBasicBuddyManager();

      MethodCall newReplicatedCall = bm.transformFqns(call2);
      MethodCall newPutCall = (MethodCall) newReplicatedCall.getArgs()[0];

      // should use object refs to transform the original MethodCall.
      String expected = "/" + BuddyManager.BUDDY_BACKUP_SUBTREE + "/" + null + "/hello/world";
      assertEquals(expected, newPutCall.getArgs()[0].toString());

   }
View Full Code Here

   public void testRootFqnManipulation()
   {
      Fqn fqn1 = Fqn.ROOT;

      MethodCall call1 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn1, "key", "value");
      MethodCall call2 = MethodCallFactory.create(MethodDeclarations.replicateMethod_id, call1);

      BuddyManager bm = createBasicBuddyManager();

      MethodCall newReplicatedCall = bm.transformFqns(call2);
      MethodCall newPutCall = (MethodCall) newReplicatedCall.getArgs()[0];

      // should use object refs to transform the original MethodCall.
      String expected = "/" + BuddyManager.BUDDY_BACKUP_SUBTREE + "/" + null;
      assertEquals(expected, newPutCall.getArgs()[0].toString());
   }
View Full Code Here

      Fqn fqn1 = Fqn.ROOT;
      Fqn fqn2 = Fqn.fromString("/hello/world");
      Fqn fqn3 = Fqn.fromString("/hello/again");
      Fqn fqn4 = Fqn.fromString("/buddy/replication");

      MethodCall call1 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn1, "key", "value");
      MethodCall call2 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn2, "key", "value");
      MethodCall call3 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn3, "key", "value");
      MethodCall call4 = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, fqn4, "key", "value");
      List<MethodCall> list = new ArrayList<MethodCall>();
      list.add(call1);
      list.add(call2);
      list.add(call3);
      list.add(call4);

      MethodCall call5 = MethodCallFactory.create(MethodDeclarations.replicateAllMethod_id, list);

      BuddyManager bm = createBasicBuddyManager();

      MethodCall newReplicatedCall = bm.transformFqns(call5);
      List l = (List) newReplicatedCall.getArgs()[0];

      // should use object refs to transform the original MethodCall.
      String expected = "/" + BuddyManager.BUDDY_BACKUP_SUBTREE + "/null";

      int i = 0;
View Full Code Here

      // this method will return immediately if we're the only member
      if (cache.getMembers() != null && cache.getMembers().size() > 1)
      {
         // Map method calls to data versioned equivalents.
         // See JBCACHE-843 and docs/design/DataVersioning.txt
         MethodCall toBroadcast = mapDataVersionedMethodCalls(methodCall, getTransactionWorkspace(gtx));

         //record the things we have possibly sent
         broadcastTxs.add(gtx);
         if (log.isDebugEnabled())
         {
View Full Code Here

      if (cache.getMembers() != null && cache.getMembers().size() > 1)
      {
         try
         {
            broadcastTxs.remove(gtx);
            MethodCall commit_method = MethodCallFactory.create(MethodDeclarations.commitMethod_id, gtx);

            if (log.isDebugEnabled())
               log.debug("running remote commit for " + gtx + " and coord=" + cache.getLocalAddress());

            // for an optimistic commit we don't need to force an OOB message since O/L means we have non-blocking reads.
View Full Code Here

TOP

Related Classes of org.jboss.cache.marshall.MethodCall

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.