Package org.jboss.cache.buddyreplication

Examples of org.jboss.cache.buddyreplication.GravitateResult


      ArrayList listReference = new ArrayList();
      expect(containerMock.buildNodeData(Collections.EMPTY_LIST, nodes.abcNode, false)).andReturn(listReference);

      control.replay();
      GravitateResult result = (GravitateResult) command.perform(ctx);
      assert result.getNodeData() == listReference;
      control.verify();
   }
View Full Code Here


      assertSame(listClass, cache2.get(fqn, key).getClass());

      GravitateDataCommand gravitateDataCommand = new GravitateDataCommand(fqn, false, cache1.getRPCManager().getLocalAddress());

      List responses = cache1.getRPCManager().callRemoteMethods(null, gravitateDataCommand, true, 15000, false);
      GravitateResult data = (GravitateResult) responses.get(0);// response from the first (and only) node

      assertTrue("Should have found remote data", data.isDataFound());
      assertNotNull(data.getNodeData());
      Object value = data.getNodeData().get(0).getAttributes().get(key);

      assertNotNull(value);
      if (useMarshalledValues) value = ((MarshalledValue) value).get();
      assertNotSame(MyList.class, value.getClass());
      assertSame(listClass, value.getClass());
View Full Code Here

      assertSame(listClass, cache2.get(fqn, key).getClass());

      GravitateDataCommand gravitateDataCommand = new GravitateDataCommand(fqn, false, cache1.getRPCManager().getLocalAddress());

      List responses = cache1.getRPCManager().callRemoteMethods(null, gravitateDataCommand, true, 15000, false);
      GravitateResult data = (GravitateResult) responses.get(0);// response from the first (and only) node

      assertTrue("Should have found remote data", data.isDataFound());
      assertNotNull(data.getNodeData());
      Object value = data.getNodeData().get(0).getAttributes().get(key);

      assertNotNull(value);
      if (useMarshalledValues) value = ((MarshalledValue) value).get();
      assertNotSame(MyList.class, value.getClass());
      assertSame(listClass, value.getClass());
View Full Code Here

      {
         if (o1 instanceof GravitateResult)
         {
            if (o2 instanceof GravitateResult)
            {
               GravitateResult g2 = (GravitateResult) o2;
               if (g2.isDataFound() == false)
               {
                  return -1;
               }
               else
               {
View Full Code Here

   }

   private BackupData remoteBackupGet(Fqn name) throws Exception
   {
      BackupData result = null;
      GravitateResult gr = gravitateData(name);
      if (gr.isDataFound())
      {
         if (trace)
         {
            log.trace("Got response " + gr);
         }
View Full Code Here

         if (mbrs.size() > 1) log.error("No replies to call " + command);
         return GravitateResult.noDataFound();
      }

      // test for and remove exceptions
      GravitateResult result = GravitateResult.noDataFound();
      for (Object o : resps)
      {
         if (o instanceof Throwable)
         {
            if (log.isDebugEnabled())
            {
               log.debug("Found remote Throwable among responses - removing from responses list", (Exception) o);
            }
         }
         else if (o instanceof GravitateResult)
         {
            GravitateResult candidate = (GravitateResult) o;
            if (isPreferable(candidate, result))
            {
               result = candidate;
            }
         }
View Full Code Here

      }
   }

   private BackupData localBackupGet(Fqn fqn, InvocationContext ctx) throws CacheException
   {
      GravitateResult result = cacheSPI.gravitateData(fqn, true, ctx);// a "local" gravitation
      boolean found = result.isDataFound();
      BackupData data = null;

      if (found)
      {
         Fqn backupFqn = result.getBuddyBackupFqn();
         data = new BackupData(fqn, result);
         // now the cleanup
         if (buddyManager.isDataGravitationRemoveOnFind())
         {
            // Remove locally only; the remote call will
View Full Code Here

   }

   private BackupData remoteBackupGet(Fqn name) throws Exception
   {
      BackupData result = null;
      GravitateResult gr = gravitateData(name);
      if (gr.isDataFound())
      {
         if (trace)
         {
            log.trace("Got response " + gr);
         }
View Full Code Here

         if (mbrs.size() > 1) log.error("No replies to call " + command);
         return GravitateResult.noDataFound();
      }

      // test for and remove exceptions
      GravitateResult result = GravitateResult.noDataFound();
      for (Object o : resps)
      {
         if (o instanceof Throwable)
         {
            if (log.isDebugEnabled())
            {
               log.debug("Found remote Throwable among responses - removing from responses list", (Exception) o);
            }
         }
         else if (o != null)
         {
            result = (GravitateResult) o;
            if (result.isDataFound())
            {
               break;
            }
         }
         else if (!configuration.isUseRegionBasedMarshalling())
View Full Code Here

      }
   }

   private BackupData localBackupGet(Fqn fqn, InvocationContext ctx) throws CacheException
   {
      GravitateResult result = cacheSPI.gravitateData(fqn, true, ctx);// a "local" gravitation
      boolean found = result.isDataFound();
      BackupData data = null;

      if (found)
      {
         Fqn backupFqn = result.getBuddyBackupFqn();
         data = new BackupData(fqn, result);
         // now the cleanup
         if (buddyManager.isDataGravitationRemoveOnFind())
         {
            // Remove locally only; the remote call will
View Full Code Here

TOP

Related Classes of org.jboss.cache.buddyreplication.GravitateResult

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.