Package aleph.comm

Examples of aleph.comm.Address


    }

  @Override
  public boolean isAvaliable(Object id, ControlContext context)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    return ((Reservation)locator.open(context, id, "r")).isAvailable(context);
  }
View Full Code Here


  }

  @Override
  public boolean reserve(Object id, ControlContext context)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    return ((Reservation)locator.open(context, id, "w")).reserve(context);
  }
View Full Code Here

  }

  @Override
  public void release(Object id, ControlContext context)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    ((Reservation)locator.open(context, id, "w")).release(context);
  }
View Full Code Here

  }

  @Override
  public int getPrice(Object id, ControlContext context)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    return ((Reservation)locator.open(context, id, "r")).getPrice(context);
  }
View Full Code Here

  }

  @Override
  public void setPrice(Object id, ControlContext context, int price)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    ((Reservation)locator.open(context, id, "w")).setPrice(price, context);
  }
View Full Code Here

  }

  @Override
  public void retrieItem(Object id, ControlContext context)
      throws RemoteException {
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    ((Reservation)locator.open(context, id, "w")).retrieItem(context);
  }
View Full Code Here

 
  private static final int terminate =  Integer.getInteger("terminateIdle") * 1000;
 
  public static void linkDelay(boolean callConstructionCost, Address remote){
    // TODO use matrix of local/remote addresses
    Address localhost = PE.thisPE().getAddress();
    boolean local = false;
    if(localhost!=null)
      local= ((aleph.comm.tcp.Address)localhost).inetAddress.equals(((aleph.comm.tcp.Address)remote).inetAddress);
    long delay = linkDelay;
    if(local)
View Full Code Here

    }


  @Override
  public Integer checkBalance(Object id, ControlContext context){
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    return ((BankAccount)locator.open(context, id, "r",true)).checkBalance(context);
  }
View Full Code Here

  }


  @Override
  public boolean withdraw(Object id, ControlContext context, int dollars){
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    return ((BankAccount)locator.open(context, id, "w", true)).withdraw(dollars, context);
  }
View Full Code Here

  }


  @Override
  public void deposit(Object id, ControlContext context, int dollars){
    Address caller = ((ControlContext)context).getLastExecuter();
    Network.linkDelay(true, caller);
    ControlContext.getNeighbors(context.getContextId()).add(caller);
    ((BankAccount)locator.open(context, id, "w", true)).deposit(dollars, context);
  }
View Full Code Here

TOP

Related Classes of aleph.comm.Address

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.