Package com.sun.sgs.app.util

Examples of com.sun.sgs.app.util.ScalableHashMap$PrefixEntry


 
  private static PrefixEntry[] toPrefixEntry(S3ListBucketPrefixEntry[] engineEntries) {
    if(engineEntries != null) {
      PrefixEntry[] entries = new PrefixEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new PrefixEntry();
        entries[i].setPrefix(engineEntries[i].getPrefix());
      }
     
      return entries;
    }
View Full Code Here


    private static PrefixEntry[] toPrefixEntry(S3ListBucketPrefixEntry[] engineEntries) {
        if (engineEntries != null) {
            PrefixEntry[] entries = new PrefixEntry[engineEntries.length];
            for (int i = 0; i < engineEntries.length; i++) {
                entries[i] = new PrefixEntry();
                entries[i].setPrefix(engineEntries[i].getPrefix());
            }

            return entries;
        }
View Full Code Here

 
  private static PrefixEntry[] toPrefixEntry(S3ListBucketPrefixEntry[] engineEntries) {
    if(engineEntries != null) {
      PrefixEntry[] entries = new PrefixEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new PrefixEntry();
        entries[i].setPrefix(engineEntries[i].getPrefix());
      }
     
      return entries;
    }
View Full Code Here

    }

    private AudioManagerConnectionHandler() {
        super();

  ScalableHashMap<BigInteger, String> sessionCallIDMap = new ScalableHashMap();

  sessionCallIDMapRef = AppContext.getDataManager().createReference(sessionCallIDMap);

  ScalableHashMap<String, ManagedReference<AudioCallStatusListener>> callIDListenerMap = new ScalableHashMap();

  callIDListenerMapRef = AppContext.getDataManager().createReference(callIDListenerMap);
    }
View Full Code Here

    @Test public void testConstructorNoArg() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      new ScalableHashMap<Integer,Integer>();
        assertEquals(6, getMaxTreeDepth(test));
        assertEquals(6, getMaxTreeDepth(test));
        dataService.setBinding("test", test);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(6, getMaxTreeDepth(test));
        assertEquals(6, getMinTreeDepth(test));
    }
      }, taskOwner);
View Full Code Here

    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(control, test);
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testPutOldValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(Boolean.TRUE, bar);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.put(Boolean.TRUE, Boolean.FALSE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.put(Boolean.TRUE, Boolean.FALSE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testPutOldKeyNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(bar, Boolean.TRUE);
    }
      }, taskOwner);
  try {
      txnScheduler.runTask(
          new TestAbstractKernelRunnable() {
        public void run() throws Exception {
      dataService.removeObject(
          dataService.getBinding("bar"));
      ScalableHashMap test =
          (ScalableHashMap) dataService.getBinding("test");
      assertEquals(null, test.put(new Bar(1), Boolean.FALSE));
      assertEquals(Boolean.FALSE, test.get(new Bar(1)));
      throw new RuntimeException("Intentional Abort");
        }
    }, taskOwner);
  } catch (RuntimeException re) {}
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.put(new Bar(1), Boolean.FALSE));
        assertEquals(Boolean.FALSE, test.get(new Bar(1)));
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testGetValueNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(Boolean.TRUE, bar);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.get(Boolean.TRUE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        try {
      test.get(Boolean.TRUE);
      fail("Expected ObjectNotFoundException");
        } catch (ObjectNotFoundException e) {
      assertEquals(1, test.size());
        }
    }
      }, taskOwner);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test public void testGetKeyNotFound() throws Exception {
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test = new ScalableHashMap();
        dataService.setBinding("test", test);
        Bar bar = new Bar(1);
        dataService.setBinding("bar", bar);
        test.put(bar, Boolean.TRUE);
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        dataService.removeObject(dataService.getBinding("bar"));
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.get(new Bar(1)));
    }
      }, taskOwner);
  txnScheduler.runTask(
      new TestAbstractKernelRunnable() {
    public void run() throws Exception {
        ScalableHashMap test =
      (ScalableHashMap) dataService.getBinding("test");
        assertEquals(null, test.get(new Bar(1)));
    }
      }, taskOwner);
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.util.ScalableHashMap$PrefixEntry

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.