Package aleph.dir

Examples of aleph.dir.DirectoryManager.open()


   */
  @Atomic
  @Override
  public boolean remove(E value) {
    DirectoryManager locator = HyFlow.getLocator();
    IDContainer<ImmutableHashMap<E, E>> container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "r");
    final ImmutableHashMap<E, E> map = container.getItem();
    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.remove(value, found);
    if (found.value == null) {
      return false;
View Full Code Here


    Box found = new Box(null);
    final ImmutableHashMap<E, E> newMap = map.remove(value, found);
    if (found.value == null) {
      return false;
    }
    container = (IDContainer<ImmutableHashMap<E, E>>) locator.open(containerID, "w");
    container.setItem(newMap);
    return true;
  }

}
View Full Code Here

    DirectoryManager locator = HyFlow.getLocator();
    for(int i=0; i<localObjectsCount; i++){
      for(int j=0;j<node;j++){
        if(i%node==j){
          try {
            balance+=((LoanAccount) locator.open(j + "-" + i,"r")).checkBalance();
          } catch (Throwable e) {
            e.printStackTrace();
         
        }
      }
View Full Code Here

    DirectoryManager locator = HyFlow.getLocator();
    Map<String, LoanAccount> opened = new HashMap<String, LoanAccount>();
    while(true){
      try {
        opened.clear();
        opened.put(id, (LoanAccount)locator.open(id, "w"));
        for(String accNum : accountNums)
          opened.put(accNum, (LoanAccount)locator.open(accNum, "w"));
        break;
      } catch (TimeoutException e) {
        Logger.debug("Timeout!");
View Full Code Here

    while(true){
      try {
        opened.clear();
        opened.put(id, (LoanAccount)locator.open(id, "w"));
        for(String accNum : accountNums)
          opened.put(accNum, (LoanAccount)locator.open(accNum, "w"));
        break;
      } catch (TimeoutException e) {
        Logger.debug("Timeout!");
        for(LoanAccount acc : opened.values()){
          locator.release(acc);
View Full Code Here

    BankAccount subAccount1 = null;
    BankAccount subAccount2 = null;
    while(true){
      boolean locked = false;
      try {
        subAccount1 = (BankAccount) locator.open(subAccountNum1, "r");
        locked = true;
        Logger.debug("Lock " + subAccountNum1);
        subAccount2 = (BankAccount) locator.open(subAccountNum2, "r");
        Logger.debug("Lock " + subAccountNum2);
        break;
View Full Code Here

      boolean locked = false;
      try {
        subAccount1 = (BankAccount) locator.open(subAccountNum1, "r");
        locked = true;
        Logger.debug("Lock " + subAccountNum1);
        subAccount2 = (BankAccount) locator.open(subAccountNum2, "r");
        Logger.debug("Lock " + subAccountNum2);
        break;
      } catch (TimeoutException e) {
        Logger.debug("Timeout!");
        if(locked){
View Full Code Here

    DirectoryManager locator = HyFlow.getLocator();
    Map<String, LoanAccount> opened = new HashMap<String, LoanAccount>();
    while(true){
      try {
        opened.clear();
        opened.put(id, (LoanAccount)locator.open(id, "r"));
        for(String accNum : accountNums)
          opened.put(accNum, (LoanAccount)locator.open(accNum, "r"));
        break;
      } catch (TimeoutException e) {
        Logger.debug("Timeout!");
View Full Code Here

    while(true){
      try {
        opened.clear();
        opened.put(id, (LoanAccount)locator.open(id, "r"));
        for(String accNum : accountNums)
          opened.put(accNum, (LoanAccount)locator.open(accNum, "r"));
        break;
      } catch (TimeoutException e) {
        Logger.debug("Timeout!");
        for(LoanAccount acc : opened.values()){
          locator.release(acc);
View Full Code Here

    BankAccount account2 = null;   
    DirectoryManager locator = HyFlow.getLocator();
    while(true){
      boolean locked = false;
      try {
        account1 = (BankAccount) locator.open(accountNum1);
        locked = true;
        Logger.debug("Lock " + accountNum1);
        account2 = (BankAccount) locator.open(accountNum2);
        Logger.debug("Lock " + accountNum2);
        break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.