Package org.jppf.client.monitoring
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractComponent(String uuid) Initialize this component witht he specified uuid. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a child to this component.booleanGet the child with the specified uuid.intGet the number of children of this topology component.Get the children of this component in a thread-safe way.Get a user-friendly representation of this topology component.Get the parent of this compponent.getUuid()Get the uuid of this ocmponent.inthashCode()voidRemove a child from this component.
-
Field Details
-
children
The children of this component. -
parent
The parent of this component. -
uuid
The uuid of this component.
-
-
Constructor Details
-
AbstractComponent
Initialize this component witht he specified uuid.- Parameters:
uuid- the uuid assigned to this component.
-
-
Method Details
-
getParent
Get the parent of this compponent.- Returns:
- the parent as a
AbstractComponentinstance.
-
getChild
Get the child with the specified uuid.- Parameters:
uuid- the uuid of the child to look for.- Returns:
- a
AbstractComponentornullif 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
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
AbstractComponentinstances.
-
add
Add a child to this component.- Parameters:
child- the child component to add.
-
remove
Remove a child from this component.- Parameters:
child- the child component to remove.
-
getUuid
Get the uuid of this ocmponent.- Returns:
- the uuid as a strring.
-
getDisplayName
Get a user-friendly representation of this topology component.- Returns:
- a displayable string representing this object.
-
hashCode
public int hashCode() -
equals
-