Package jadex.core
Class ComponentIdentifier
java.lang.Object
jadex.core.ComponentIdentifier
Identifier for components.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuto-generates a ComponentIdentifier.ComponentIdentifier(String localname) Generates a ComponentIdentifier using a custom local ID.ComponentIdentifier(String localname, long pid, String host) Generates a ComponentIdentifier from its elements.ComponentIdentifier(String localname, GlobalProcessIdentifier gpid) Generates a ComponentIdentifier from its elements. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the ID.static final ComponentIdentifierfromString(String idstring) Instantiates a ComponentIdentifier using an ID-String.Returns the global process identifier.Returns the local component id.inthashCode()Generates a hashcode.booleanisLocaL()Returns if the component runs on the local JVM.static voidTest main.static voidsetDeterministicNameGeneration(boolean deterministic) Make the id generation deterministic or random.toString()Converts the ID to a unique String.
-
Field Details
-
gen
protected static jadex.idgenerator.IdGenerator gen
-
-
Constructor Details
-
ComponentIdentifier
public ComponentIdentifier()Auto-generates a ComponentIdentifier. -
ComponentIdentifier
Generates a ComponentIdentifier using a custom local ID.- Parameters:
localid- Local identifier of the component.
-
ComponentIdentifier
Generates a ComponentIdentifier from its elements.- Parameters:
gpid- The global process id.localid- Local identifier of the component.
-
ComponentIdentifier
Generates a ComponentIdentifier from its elements.- Parameters:
pid- Process ID of the process on the host running the componenthost- Host running the process that is running the componentlocalid- Local identifier of the component.
-
-
Method Details
-
getLocalName
Returns the local component id.- Returns:
- The local component id.
-
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. -
equals
Compares the ID. -
toString
Converts the ID to a unique String. -
fromString
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
Test main.- Parameters:
args- Command-line args, unused.
-