Package aleph.comm

Examples of aleph.comm.CommunicationManager


   * Identity politics.
   * @return our PE
   **/
  public static PE thisPE () {
    if (thisPE == null) {
      CommunicationManager cManager = CommunicationManager.getManager();
      thisPE = new PE(cManager.getAddress());
    }
    return thisPE;
  }
View Full Code Here


  }

 
  public static void startPE() throws IOException{
    // Concoct user-readable name
      CommunicationManager cManager = CommunicationManager.getManager();
      Aleph.setDebugFile(thisPE().label);

      // Initialize static fields
      thisPE = new PE(cManager.getAddress());
      thisPE.parent = cManager.getParentAddress();
      thisPE.numPEs = Integer.parseInt(Aleph.getProperty("aleph.numPEs", "1"));
      thisPE.index  = Integer.parseInt(Aleph.getProperty("aleph.index""0"));

      // Fill in peers, using handshake with parent
      synchronized (lock) {  // only the paranoid survive
        thisPE.group = null;
        Integer id = new Integer(Aleph.getIntProperty("aleph.group", 0));
        cManager.send(thisPE.parent, new PEGroup.AskParent(thisPE, id, thisPE.index));
        while (thisPE.group == null) {
          try {lock.wait();} catch (InterruptedException e) {}
        }
       
        Logger.fetal("PE started...");
View Full Code Here

   * @return whether shutdown is confirmed.
   * @exception SecurityException If caller is not allowed to kill this server.
   **/
  public boolean stop (int code) throws SecurityException {
    try {
      CommunicationManager cManager = CommunicationManager.getManager();
      cManager.send(address, new HaltMessage(code));
      cManager.flush(address);
      return true;
    } catch (IOException e) { // timed out
      return false;
    } catch (Exception e) {
      Aleph.panic(e);
View Full Code Here

   * display warning message
   * @param message what to display
   **/
  public static void warning (String message) {
    try {
      CommunicationManager cManager = CommunicationManager.getManager();
      cManager.send(cManager.getConsoleAddress(),
                    new Warning(message));
    } catch (Exception e) {
      Aleph.panic(e);
    }
  }
View Full Code Here

   * display error message
   * @param message what to display
   **/
  public static void error (String message) {
    try {
      CommunicationManager cManager = CommunicationManager.getManager();
      cManager.send(cManager.getConsoleAddress(),
                    new Error(message));
    } catch (Exception e) {
      Aleph.panic(e);
    }
  }
View Full Code Here

   * display informative message
   * @param message what to display
   **/
  public static void inform (String message) {
    try {
      CommunicationManager cManager = CommunicationManager.getManager();
      cManager.send(cManager.getConsoleAddress(),
                    new Inform(message));
    } catch (Exception e) {
      Aleph.panic(e);
    }
  }
View Full Code Here

    if (DEBUG)
      Aleph.debug("new PEGroup[" + label + ", size " + group +"]");
    synchronized (this) {
      group = new ArrayList(numPEs); // list of component PEs
      group.addAll(Collections.nCopies(numPEs, null)); // initialize
      CommunicationManager cManager = CommunicationManager.getManager();
      // start up my PE
      pending = numPEs;

      if(pending==0)
    try {
View Full Code Here

    if (DEBUG)
      Aleph.debug("new PEGroup[" + label + ", size " + group +"]");
    synchronized (this) {
      group = new ArrayList(numPEs); // list of component PEs
      group.addAll(Collections.nCopies(numPEs, null)); // initialize
      CommunicationManager cManager = CommunicationManager.getManager();
      Iterator iterator = hosts.iterator();
      // start up PEs
      pending = numPEs;
      for (int i = 0; i < numPEs; i++) {
        if (! iterator.hasNext())
          iterator = hosts.iterator();
        Host host = (Host) iterator.next();
        host.startPE(cManager.getAddress(),
                     cManager.getConsoleAddress(),
                     i,
                     numPEs,
                     id,
                     label + "." + i,
                     args,
View Full Code Here

TOP

Related Classes of aleph.comm.CommunicationManager

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.