Package com.betfair.platform.virtualheap

Examples of com.betfair.platform.virtualheap.Heap


        // returns true if a new heap was added
        public boolean addHeap(long heapId, String uri) {
            heapSubMutationLock.lock();
            try {
                if (!heapStates.containsKey(heapId)) {
                    Heap heap = new ImmutableHeap(uri, newListenerConflater);
                    initialLatches.put(heapId, new CountDownLatch(1));
                    heapStates.put(heapId, new HeapState(heap));
                    return true;
                }
                return false;
View Full Code Here


        // returns true if a new heap was added
        public boolean addHeap(long heapId, String uri) {
            heapSubMutationLock.lock();
            try {
                if (!heapStates.containsKey(heapId)) {
                    Heap heap = new ImmutableHeap(uri, newListenerConflater);
                    initialLatches.put(heapId, new CountDownLatch(1));
                    heapStates.put(heapId, new HeapState(heap));
                    return true;
                }
                return false;
View Full Code Here

    NodeProjector<FootballScores> scoresFactory = objectProjector(FootballScores.class);
 
  @Test
  public void simple() {
    Heap src = new MutableHeap("src");

    Heap target = new MutableHeap("target");

    src.addListener(target.asListener(), false);

    src.beginUpdate();

    FootballScores scores = scoresFactory.project(src.ensureRoot(NodeType.OBJECT));
    src.endUpdate();
   
    Assert.assertEquals(src.toString(), target.toString());
   
    src.beginUpdate();
    scores.setAway(0);
    scores.setHome(1);
    GoalDetail firstGoal = scores.goals().addLast();
    firstGoal.setScorer("Rooney");
    firstGoal.setMinutes(34);
    src.endUpdate();
   
    Assert.assertEquals(src.toString(), target.toString());
   
    src.beginUpdate();
    scores.goals().clear();
    src.endUpdate();
   
    Assert.assertEquals(src.toString(), target.toString());
   
    src.beginUpdate();
    scores.clear();
    src.endUpdate();
   
    Assert.assertEquals(src.toString(), target.toString());
   
   
  }
View Full Code Here

TOP

Related Classes of com.betfair.platform.virtualheap.Heap

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.