Package com.cloud.cluster

Examples of com.cloud.cluster.CheckPointVO


    AllFieldsSearch.done();
  }
 
  @Override
  public boolean takeover(long takeOverMsid, long selfId) {
      CheckPointVO task = createForUpdate();
      task.setMsid(selfId);
      task.setThreadId(0);
     
      SearchCriteria<CheckPointVO> sc = AllFieldsSearch.create();
      sc.setParameters("msid", takeOverMsid);
      return update(task, sc) > 0;
     
View Full Code Here


        return this.search(sc, null);
  }

    @Override
  public long pushCleanupDelegate(long msid, int seq, String delegateClzName, Object context) {
    CheckPointVO delegateItem = new CheckPointVO();
    delegateItem.setMsid(msid);
    delegateItem.setThreadId(Thread.currentThread().getId());
    delegateItem.setSeq(seq);
    delegateItem.setDelegate(delegateClzName);
    delegateItem.setContext(SerializerHelper.toSerializedStringOld(context));
    delegateItem.setCreated(DateUtil.currentGMTTime());
   
    super.persist(delegateItem);
    return delegateItem.getId();
  }
View Full Code Here

    StackMaidDao dao = new StackMaidDaoImpl();
    dao.pushCleanupDelegate(1L, 0, "delegate1", "Hello, world");
    dao.pushCleanupDelegate(1L, 1, "delegate2", new Long(100));
    dao.pushCleanupDelegate(1L, 2, "delegate3", null);
   
    CheckPointVO item = dao.popCleanupDelegate(1L);
    Assert.assertTrue(item.getDelegate().equals("delegate3"));
    Assert.assertTrue(item.getContext() == null);
   
    item = dao.popCleanupDelegate(1L);
    Assert.assertTrue(item.getDelegate().equals("delegate2"));
    s_logger.info(item.getContext());

    item = dao.popCleanupDelegate(1L);
    Assert.assertTrue(item.getDelegate().equals("delegate1"));
    s_logger.info(item.getContext());
   
    txn.close();
  }
View Full Code Here

        StackMaidDao dao = new StackMaidDaoImpl();
        dao.pushCleanupDelegate(1L, 0, "delegate1", "Hello, world");
        dao.pushCleanupDelegate(1L, 1, "delegate2", new Long(100));
        dao.pushCleanupDelegate(1L, 2, "delegate3", null);

        CheckPointVO item = dao.popCleanupDelegate(1L);
        Assert.assertTrue(item.getDelegate().equals("delegate3"));
        Assert.assertTrue(item.getContext() == null);

        item = dao.popCleanupDelegate(1L);
        Assert.assertTrue(item.getDelegate().equals("delegate2"));
        s_logger.info(item.getContext());

        item = dao.popCleanupDelegate(1L);
        Assert.assertTrue(item.getDelegate().equals("delegate1"));
        s_logger.info(item.getContext());

        txn.close();
    }
View Full Code Here

    AllFieldsSearch.done();
  }
 
  @Override
  public boolean takeover(long takeOverMsid, long selfId) {
      CheckPointVO task = createForUpdate();
      task.setMsid(selfId);
      task.setThreadId(0);
     
      SearchCriteria<CheckPointVO> sc = AllFieldsSearch.create();
      sc.setParameters("msid", takeOverMsid);
      return update(task, sc) > 0;
     
View Full Code Here

        return this.search(sc, null);
  }

    @Override
  public long pushCleanupDelegate(long msid, int seq, String delegateClzName, Object context) {
    CheckPointVO delegateItem = new CheckPointVO();
    delegateItem.setMsid(msid);
    delegateItem.setThreadId(Thread.currentThread().getId());
    delegateItem.setSeq(seq);
    delegateItem.setDelegate(delegateClzName);
    delegateItem.setContext(SerializerHelper.toSerializedStringOld(context));
    delegateItem.setCreated(DateUtil.currentGMTTime());
   
    super.persist(delegateItem);
    return delegateItem.getId();
  }
View Full Code Here

TOP

Related Classes of com.cloud.cluster.CheckPointVO

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.