aleph
Class PE

java.lang.Object
  |
  +--aleph.PE

public class PE
extends java.lang.Object
implements java.io.Serializable

A PE object names a Processing Element. A PE can be

  • a PE group member, or a solo PE
  • a child of another PE, or autonomous When a PE group is shut down, it shuts down all members. When a PE exits or is shut down, it shuts down its children.

    See Also:
    Serialized Form

    Inner Class Summary
    static class PE.HaltMessage
              Ask PE to shut down
    static class PE.TellChild
              Tell new PE about group.
     
    Method Summary
    static java.util.Iterator allPEs()
               
    static void closeConsoleStreams()
              Close input and error streams to console.
     boolean equals(java.lang.Object anObject)
              Always compare PEs with equals, never ==.
    static void exit(int code)
              Shut down me, my children, and my group.
     Address getAddress()
               
     int getIndex()
               
    static PE getPE(int i)
               
    static void halt(int code)
              Shut down me and my children, but not other group members.
     int hashCode()
               
    static void main(java.lang.String[] args)
              Top-level program called by Server.
    static int numPEs()
               
    static void panic()
              Shuts down peers, children, and parent.
    static void panic(PE sender)
              Shuts down peers, children, and parent.
     boolean ping()
               
    static java.util.Iterator roundRobin()
               
     boolean stop()
              Shuts down a PE and its children.
     boolean stop(int code)
              Shuts down a PE and its children.
    static PE thisPE()
              Identity politics.
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     

    Method Detail

    getAddress

    public Address getAddress()
    Returns:
    this PE's address
    See Also:

    ping

    public boolean ping()
    Returns:
    whether a PE seems to be running.

    equals

    public boolean equals(java.lang.Object anObject)
    Always compare PEs with equals, never ==.
    Overrides:
    equals in class java.lang.Object

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class java.lang.Object

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object

    thisPE

    public static PE thisPE()
    Identity politics.
    Returns:
    our PE

    numPEs

    public static int numPEs()
    Returns:
    number of PEs in our group.

    allPEs

    public static java.util.Iterator allPEs()
    Returns:
    Iterates over all PEs in this PE group.

    roundRobin

    public static java.util.Iterator roundRobin()
    Returns:
    Iterate over my group's PEs in round-robin order.

    main

    public static void main(java.lang.String[] args)
    Top-level program called by Server. Initializes local PE state from Aleph properties. Undertakes handshake with parent to discover salient properties.

    stop

    public boolean stop()
                 throws java.lang.SecurityException
    Shuts down a PE and its children. Leaves other group members unharmed.
    Returns:
    whether shutdown is confirmed.
    Throws:
    java.lang.SecurityException - If caller is not allowed to kill this server.

    stop

    public boolean stop(int code)
                 throws java.lang.SecurityException
    Shuts down a PE and its children. Leaves other group members unharmed.
    Parameters:
    code - termination code
    Returns:
    whether shutdown is confirmed.
    Throws:
    java.lang.SecurityException - If caller is not allowed to kill this server.

    exit

    public static void exit(int code)
    Shut down me, my children, and my group.
    Parameters:
    code - exit code (0 is normal, etc).

    halt

    public static void halt(int code)
    Shut down me and my children, but not other group members.
    Parameters:
    code - exit code (0 is normal, etc).

    panic

    public static void panic()
    Shuts down peers, children, and parent.

    panic

    public static void panic(PE sender)
    Shuts down peers, children, and parent.

    getIndex

    public int getIndex()
    Returns:
    my index within group

    getPE

    public static PE getPE(int i)
    Returns:
    i-th PE, wrapping around if necessary

    closeConsoleStreams

    public static void closeConsoleStreams()
    Close input and error streams to console. Can be called when PE shuts down, or if the PE wants to disassociate itself from the console.