public class MethodSubscription extends MethodInvocation
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.
Constructor and Description |
---|
MethodSubscription(java.lang.String methodName,
DataElement[] args)
Used to construct method subscriptions for asynchronous methods
|
MethodSubscription(java.lang.String methodName,
DataElement[] args,
long interval)
Used to construct method subscriptions for synchronous methods
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
long |
getInterval()
Returns the subscription interval of subscriptions constructed for synchronous methods.
|
int |
hashCode()
Returns a hashcode for this Integer.
|
boolean |
isAsync()
Returns true if this object was built with the constructor
for asynchronous method subscriptions.
|
java.lang.String |
toString()
Returns a string representation of this MethodSubscription
|
getArguments, getArgumentValue, getMethodName
public MethodSubscription(java.lang.String methodName, DataElement[] args, long interval)
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.public MethodSubscription(java.lang.String methodName, DataElement[] args)
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.public long getInterval()
java.lang.IllegalStateException
- If isAsync()
returns truepublic boolean isAsync()
public boolean equals(java.lang.Object obj)
Two MethodSubscription objects are equal if they have the same interval, method name and equalent argument lists.
equals
in class MethodInvocation
public int hashCode()
hashCode
in class MethodInvocation
public java.lang.String toString()
toString
in class MethodInvocation
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.