Class MethodDescriptor
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis impact value indicates that the method takes some action that can potentially change the state of the managed object.static final intThis impact value indicates that the method takes some action that can potentially change the state of the managed object and also returns some information as a return value.static final intThis impact value indicates that the method simply retrieves some information in a manner that does not change the state of the managed object. -
Constructor Summary
ConstructorsConstructorDescriptionMethodDescriptor(String name, String desc, DataDescriptor ret, DataDescriptor[] args, boolean async, int impact, int maxTime) Constructs a method descriptor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this object against the specified object.Returns a DataDescriptor array describing the method's arguments or null if this method accepts no arguments.Returns a description of this methodintReturns the impact of this method.intReturns the maximum response time for this method.getName()Returns the name of this methodReturns the DataDescriptor describing the method's return value or null if the method returns no value.booleanisAsync()Returns true if the method is asynchronous.booleanReturns true if this descriptor describes an open method.toFormattedString(String indent) Returns a formatted string representation of this descriptor.toString()Returns a string representation of this descriptor.
-
Field Details
-
IMPACT_INFO
public static final int IMPACT_INFOThis impact value indicates that the method simply retrieves some information in a manner that does not change the state of the managed object.- See Also:
-
IMPACT_ACTION
public static final int IMPACT_ACTIONThis impact value indicates that the method takes some action that can potentially change the state of the managed object.- See Also:
-
IMPACT_ACTION_INFO
public static final int IMPACT_ACTION_INFOThis impact value indicates that the method takes some action that can potentially change the state of the managed object and also returns some information as a return value.- See Also:
-
-
Constructor Details
-
MethodDescriptor
public MethodDescriptor(String name, String desc, DataDescriptor ret, DataDescriptor[] args, boolean async, int impact, int maxTime) Constructs a method descriptor.- Parameters:
name- The name of the method. Must be a non-null, non-empty string.desc- A description of the methodret- A DataDescriptor describing the return value of the method. It may be null to indicate that this method has no return value.args- An array of DataDescriptor objects describing the arguments required by the method. It may be null or empty array to indicat that this method has no arguments. If not empty, the array must not contain null elements. Each DataDescriptor in this array must have a unique name.async- Indicates whether or not this method is an asynchronous method. An asynchronous method is analogous to an event source. Listeners that subscribe to an asynchronous method will receive the method's declared return value each time an particular event occurs. A method may not be declared as asynchronous unless it also describes a return value (seeretparameter).impact- States the impact this method will have. Must be one ofIMPACT_ACTION, IMPACT_INFO, or IMPACT_ACTION_INFO.A method that does not return a value (seeretparameter) may not be declared to have an impact ofIMPACT_INFO or IMPACT_ACTION_INFO.maxTime- The maximum response time for this method, in seconds. Must be greater than zero. This is the amount of time that must elapse between the method's invocation and its return before declaring it to have timed out. If the method is being invoked remotely, the round-trip time of the intervening transport mechanism should also be taken into account before declaring a timeout.- Throws:
IllegalArgumentException- If the parameter conditions are violated.
-
-
Method Details
-
getName
Returns the name of this method- Returns:
- The name of this method
-
getDescription
Returns a description of this method- Returns:
- A description of this method
-
getReturnDescriptor
Returns the DataDescriptor describing the method's return value or null if the method returns no value.- Returns:
- The DataDescriptor describing the method's return value or null if the method returns no value.
-
getArgumentDescriptors
Returns a DataDescriptor array describing the method's arguments or null if this method accepts no arguments.- Returns:
- A DataDescriptor array describing the method's arguments or null if this method accepts no arguments.
-
isAsync
public boolean isAsync()Returns true if the method is asynchronous.An asynchronous method is analogous to an event source. Listeners that subscribe to an asynchronous method will receive the method's declared return value each time a particular event occurs.
- Returns:
- True if the method is asynchronous
-
getImpact
public int getImpact()Returns the impact of this method.- Returns:
- the impact of this method.
- See Also:
-
getMaxResponseTime
public int getMaxResponseTime()Returns the maximum response time for this method. This is the amount of time, in seconds, that must elapse between the method's invocation and its return before declaring it to have timed out. If the method is being invoked remotely, the round-trip time of the intervening transport mechanism should also be taken into account before declaring a timeout.- Returns:
- the maximum response time for this method.
-
isOpenMethod
public boolean isOpenMethod()Returns true if this descriptor describes an open method.An open method is one whose argument and return types are limited to the set of open data types defined by the OpenData interface.
Because an open method uses a well known set of types, it can be used in an open manner by any application using this api.
A non-open method is a proprietary method from the perspective of the TIB/Hawk Console API because it uses data types outside of this set.
Use of non-open methods is supported by this api. However, this api by itself is not sufficient to use such methods. An additonal proprietary api is required.
- Returns:
- True if this descriptor describes an open method.
- See Also:
-
equals
Compares this object against the specified object.Two MethodDescriptor objects are equal if they have the same name, description, return descriptors, argument descriptors (specified in the same order), and the same async and impact values.
-
toString
Returns a string representation of this descriptor. -
toFormattedString
Returns a formatted string representation of this descriptor.
-