Package aleph.comm.tcp

Examples of aleph.comm.tcp.Address


    try {
      for(int i=0; i<Benchmark.queryPerTransaction; i++){
        IReservation reservation = (IReservation)reservations[i];
        if(reservation==null){
          try {
            Address address = (Address) Network.getAddress(Benchmark.getServerId(objId[i]));
            IVacation vacation = (IVacation)LocateRegistry.getRegistry(address.inetAddress.getHostAddress(), address.port).lookup("vacation");
            vacation.createReservation(objId[i], price[i]);
            Logger.info(">>>>>>>>>>Add Item...");
          } catch (NotBoundException e) {
            e.printStackTrace();
View Full Code Here


    Logger.debug(context + ": Open Remotly " + key);
    Class<?> clazz = key.getObjectClass();
    try {
      object = clazz.newInstance();
      Address address = (Address)key.getHome().getAddress();
      ((ControlContext)context).addNeighbor(address);
      ((IHyFlow)object).setRemote(key.getKey(), address.inetAddress.getHostAddress(), address.port + 1000);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

   
  }
 
  public void enqueue(Integer item) {
    INode tail = null, last=null;
    Address tailServer = null, lastServer=null;
    String lastId = null;
    try{
      tailServer = (Address) Network.getAddress(Benchmark.getServerId(TAIL));
      tail = (INode)LocateRegistry.getRegistry(tailServer.inetAddress.getHostAddress(), tailServer.port).lookup(TAIL);
      Network.linkDelay(true, tailServer);
View Full Code Here

  }

  public Integer dequeue() {
      INode next = null, front=null, first=null;
    String nextId = null, firstId=null;
    Address nexServer= null, server=null, firstServer=null;
    Integer value;
    try{
      //Get the Front Node
      server = (Address) Network.getAddress(Benchmark.getServerId(HEAD));
      front = (INode)LocateRegistry.getRegistry(server.inetAddress.getHostAddress(), server.port).lookup(HEAD);
View Full Code Here

  }
 
  public Integer sum(){  // used in sanity checks only
    Integer sum=0;
    INode pred = null, curr = null,front=null, end=null;
    Address server=null,predServer = null, currServer=null, endServer=null;
    String predId=null, firstId=null, currId=null;
    try {
      //Get a lock on front and end node so no one else can delete the nodes in queue
      //While traversing through it
      server = (Address) Network.getAddress(Benchmark.getServerId(HEAD));
View Full Code Here

      Integer key = (Integer) ids[0];
      IDistributedHashTable[] tables = new IDistributedHashTable[READ_RANGE];
      try {
        for (int i = 0; i < READ_RANGE; i++) {
          Integer nodeId = findNode(i + key);
          Address server1 = (Address) Network.getAddress(String
              .valueOf(nodeId));
          tables[i] = (IDistributedHashTable) LocateRegistry
              .getRegistry(server1.inetAddress.getHostAddress(),
                  server1.port).lookup(
                  DistributedHashTable.BINDING_KEY);
View Full Code Here

      Integer key = (Integer) ids[0];
      IDistributedHashTable[] tables = new IDistributedHashTable[WRITE_RANGE];
      try {
        for(int i=0;i<WRITE_RANGE;i++){
          Integer nodeId = findNode(key+i);
          Address server1 = (Address) Network.getAddress(String.valueOf(nodeId));
          tables[i] = (IDistributedHashTable) LocateRegistry
          .getRegistry(server1.inetAddress.getHostAddress(),
              server1.port).lookup(
                  DistributedHashTable.BINDING_KEY);
          tables[i].lock(key);
View Full Code Here

    IDistributedHashTable[] tables = new IDistributedHashTable[Network
        .getInstance().nodesCount()];
    try {
      for (int i = 0; i < Network.getInstance().nodesCount(); i++) {
        Integer nodeId = findNode(i);
        Address server1 = (Address) Network.getAddress(String
            .valueOf(nodeId));
        tables[i] = (IDistributedHashTable) LocateRegistry.getRegistry(
            server1.inetAddress.getHostAddress(), server1.port)
            .lookup(DistributedHashTable.BINDING_KEY);
      }
View Full Code Here

  }
 
  public static boolean transfer(String subAccountNum1, String subAccountNum2, int amount) {
    IBankAccount account1 = null;
    IBankAccount account2 = null;
    Address server1 = null, server2 = null;
    try {
      while(true){
        boolean locked1 = false;
        try {
          server1 = (Address) Network.getAddress(Benchmark.getServerId(subAccountNum1));
View Full Code Here

  public static boolean transfer(Timespec deadline, Timespec period_ts, String[] lockedAccounts, String subAccountNum1, String subAccountNum2, int amount) {

    IBankAccount subAccount1 = null;
    IBankAccount subAccount2  = null;
    Address server1 = null, server2 = null;
    Timespec currenttime = new Timespec();
    char num1 = subAccountNum1.split("-")[1].charAt(0);
    char num2 = subAccountNum2.split("-")[1].charAt(0);
    boolean locked1 = false;
    boolean locked2 = false;
View Full Code Here

TOP

Related Classes of aleph.comm.tcp.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.