Class MethodSubscription
- All Implemented Interfaces:
Serializable
A MethodSubscription is similar to a MethodInvocation but is used to subscribe to method results.
A MethodSubscription should be constructed in accordance with the MethodDescriptor of the target method.
You can use either of two constructors to build a MethodSubscription
depending on whether you are creating a subscription for a synchronous
or asynchronous method. (See
MethodDescriptor.isAsync()
)
The constructor for synchronous method subscriptions requires an interval parameter. It is used to specify a desired subscription service rate. Subscriptions made of synchronous methods will use this value as a hint to determine how often to deliver data to service a subscription. Most microagents will usually enforce a minimum rate which will be used if the supplied value is below their minimum.
The constructor for asynchronous method subscriptions does not accept an interval parameter. Asynchronous methods deliver data at a rate determined by the microagent, typically, whenever it is available.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMethodSubscription(String methodName, DataElement[] args) Used to construct method subscriptions for asynchronous methodsMethodSubscription(String methodName, DataElement[] args, long interval) Used to construct method subscriptions for synchronous methods -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this object against the specified object.longReturns the subscription interval of subscriptions constructed for synchronous methods.inthashCode()Returns a hashcode for this Integer.booleanisAsync()Returns true if this object was built with the constructor for asynchronous method subscriptions.toString()Returns a string representation of this MethodSubscriptionMethods inherited from class COM.TIBCO.hawk.talon.MethodInvocation
getArguments, getArgumentValue, getMethodName
-
Constructor Details
-
MethodSubscription
Used to construct method subscriptions for synchronous methods- Parameters:
methodName- The name of the methodargs- An array of DataElement objects representing the arguments of the method. The names and values of these elements should correspond to what was described in the MethodDescriptor for this method. They must be serializable types.interval- The desired subscription service rate in milliseconds. Must be greater than zero.
-
MethodSubscription
Used to construct method subscriptions for asynchronous methods- Parameters:
methodName- The name of the methodargs- An array of DataElement objects representing the arguments of the method. The names and values of these elements should correspond to what was described in the MethodDescriptor for this method. They must be serializable types.
-
-
Method Details
-
getInterval
public long getInterval()Returns the subscription interval of subscriptions constructed for synchronous methods.- Returns:
- The subscription interval
- Throws:
IllegalStateException- IfisAsync()returns true
-
isAsync
public boolean isAsync()Returns true if this object was built with the constructor for asynchronous method subscriptions. -
equals
Compares this object against the specified object.Two MethodSubscription objects are equal if they have the same interval, method name and equalent argument lists.
- Overrides:
equalsin classMethodInvocation- Returns:
- true if the two objects are equal.
-
hashCode
public int hashCode()Returns a hashcode for this Integer.- Overrides:
hashCodein classMethodInvocation- Returns:
- a hash code value for this object.
-
toString
Returns a string representation of this MethodSubscription- Overrides:
toStringin classMethodInvocation
-