public class MicroAgentDescriptor
extends java.lang.Object
implements java.io.Serializable
MicroAgentDescriptor objects are used by microagents to advertise their supported methods along with all the information required to invoke them.
By convention, every microagent should have a globally unique name. If two microagent instances have the same name they should also have the same MicroAgentDescriptor, which implies that they advertise support for the same methods with the same signatures.
Constructor and Description |
---|
MicroAgentDescriptor(java.lang.String name,
java.lang.String displayName,
java.lang.String desc,
MethodDescriptor[] methods)
Constructs a microagent descriptor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
long |
getChecksum()
Returns the checksum of this descriptor.
|
java.lang.String |
getDescription()
Returns a description of the microagent.
|
java.lang.String |
getDisplayName()
Returns the display name of the microagent.
|
MethodDescriptor[] |
getMethodDescriptors()
Returns the descriptors for the methods supported by this microagent.
|
java.lang.String |
getName()
Returns the name of the microagent.
|
void |
setDisplayName(java.lang.String displayName)
sets the display name of the microagent
|
void |
setName(java.lang.String name)
Sets the name of the microagent.
|
java.lang.String |
toFormattedString()
Returns a formatted string representation of this descriptor.
|
java.lang.String |
toString()
Returns a string representation of this descriptor.
|
public MicroAgentDescriptor(java.lang.String name, java.lang.String displayName, java.lang.String desc, MethodDescriptor[] methods)
name
- The name of the microagent. Must be a non-null non-empty string.
All microagents should have unique names.
It is recommended that all microagents have a name that is prefaced by their
developing organization's Internet
domain name. For example, microagents developed by Cloud Software Group, Inc.
have names prefaced by "COM.TIBCO.".displayName
- A name which may be used as an alternate to name
for presentation purposes only. Because a microagent's name needs to
be unique, it might be lengthy. The display name can be used to provide
an abbreviated name which is intended for use for presentation purposes only.desc
- A description of the microagentmethods
- An array of MethodDescriptor objects describing the methods supported
by this microagent. All methods must have unique names. This array must contain at
least 1 method descriptor. It may not contain null elements.java.lang.IllegalArgumentException
- If the parameter conditions are violated.public java.lang.String getName()
public void setName(java.lang.String name)
name
- public java.lang.String getDisplayName()
Because a microagent's name needs to be unique, it might be lengthy. The display name can be used to provide an abreiviated name which is intended for use for presentation purposes only.
If a display name was not supplied, this method will return the
same value as getName()
;
public void setDisplayName(java.lang.String displayName)
displayName
- public java.lang.String getDescription()
public MethodDescriptor[] getMethodDescriptors()
public long getChecksum()
The checksum is computed using a CRC-32 algorithm. It takes into account the microagent name and all method names and their signatures.
The following attributes of the contained objects are not used to compute checksum as they are not considered part of the microagent's signature:
The checksum is not collision proof. If two descriptors are the same, they will have the same checksum. If two descriptors have the same name and checksum then it is likely, but not guaranteed, that their method signatures match.
public boolean equals(java.lang.Object obj)
Two MicroAgentDescriptor objects are equal if they have the same name, display name, description, and method descriptors. (Note: two MicroAgentDescriptors may have the same checksum but not be equal.)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toFormattedString()
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.