Class AbstractComponent<E extends AbstractComponent>

java.lang.Object
org.jppf.client.monitoring.AbstractComponent<E>
Type Parameters:
E - the type of component.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractJobComponent, AbstractTopologyComponent

public abstract class AbstractComponent<E extends AbstractComponent> extends Object implements Serializable
Base superclass for components of a JPPF grid topology. This class proivdes an API to navigate the topology tree and attributes common to all ellements in te tree.
Since:
5.1
Author:
Laurent Cohen
See Also:
  • Field Details

    • children

      protected final transient Map<String,E extends AbstractComponent> children
      The children of this component.
    • parent

      protected transient E extends AbstractComponent parent
      The parent of this component.
    • uuid

      protected final String uuid
      The uuid of this component.
  • Constructor Details

    • AbstractComponent

      protected AbstractComponent(String uuid)
      Initialize this component witht he specified uuid.
      Parameters:
      uuid - the uuid assigned to this component.
  • Method Details

    • getParent

      public E getParent()
      Get the parent of this compponent.
      Returns:
      the parent as a AbstractComponent instance.
    • getChild

      public E getChild(String uuid)
      Get the child with the specified uuid.
      Parameters:
      uuid - the uuid of the child to look for.
      Returns:
      a AbstractComponent or null if there is no child with this uuid.
    • getChildCount

      public int getChildCount()
      Get the number of children of this topology component.
      Returns:
      the number of children.
    • getChildren

      public List<E> getChildren()
      Get the children of this component in a thread-safe way. The returned list is a copy of the list of children and can be mainupalted without affect the internal state of this object.
      Returns:
      a list of AbstractComponent instances.
    • add

      public void add(E child)
      Add a child to this component.
      Parameters:
      child - the child component to add.
    • remove

      public void remove(E child)
      Remove a child from this component.
      Parameters:
      child - the child component to remove.
    • getUuid

      public String getUuid()
      Get the uuid of this ocmponent.
      Returns:
      the uuid as a strring.
    • getDisplayName

      public String getDisplayName()
      Get a user-friendly representation of this topology component.
      Returns:
      a displayable string representing this object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object