Package jadex.core

Class ComponentIdentifier

java.lang.Object
jadex.core.ComponentIdentifier

public class ComponentIdentifier extends Object
Identifier for components.
  • Field Details

    • gen

      protected static jadex.idgenerator.IdGenerator gen
  • Constructor Details

    • ComponentIdentifier

      public ComponentIdentifier()
      Auto-generates a ComponentIdentifier.
    • ComponentIdentifier

      public ComponentIdentifier(String localname)
      Generates a ComponentIdentifier using a custom local ID.
      Parameters:
      localid - Local identifier of the component.
    • ComponentIdentifier

      public ComponentIdentifier(String localname, GlobalProcessIdentifier gpid)
      Generates a ComponentIdentifier from its elements.
      Parameters:
      gpid - The global process id.
      localid - Local identifier of the component.
    • ComponentIdentifier

      public ComponentIdentifier(String localname, long pid, String host)
      Generates a ComponentIdentifier from its elements.
      Parameters:
      pid - Process ID of the process on the host running the component
      host - Host running the process that is running the component
      localid - Local identifier of the component.
  • Method Details

    • getLocalName

      public String getLocalName()
      Returns the local component id.
      Returns:
      The local component id.
    • getGlobalProcessIdentifier

      public GlobalProcessIdentifier getGlobalProcessIdentifier()
      Returns the global process identifier.
      Returns:
      The global process identifier.
    • isLocaL

      public boolean isLocaL()
      Returns if the component runs on the local JVM.
      Returns:
      True, if the component runs on the local JVM.
    • hashCode

      public int hashCode()
      Generates a hashcode.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compares the ID.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Converts the ID to a unique String.
      Overrides:
      toString in class Object
    • fromString

      public static final ComponentIdentifier fromString(String idstring)
      Instantiates a ComponentIdentifier using an ID-String.
      Parameters:
      idstring - The ID-String obtained by calling toString().
      Returns:
      A ComponentIdentifier.
    • setDeterministicNameGeneration

      public static void setDeterministicNameGeneration(boolean deterministic)
      Make the id generation deterministic or random. Default is random.
      Parameters:
      deterministic - The deterministic flag.
    • main

      public static void main(String[] args)
      Test main.
      Parameters:
      args - Command-line args, unused.