Open topic with navigation

TIBCO GridServer® 7.1.0

# Custom Discriminator and Affinity Conditions

In addition to Conditions based on Engine Properties, you can implement your own custom Conditions. For example, you might have a number of Services that require a connection to a database and might have more Engines working on those Services than available connections. You could write a Server Hook that keeps track of how many tasks are currently running, and write a Custom Discriminator to prevent all Engines from taking a Task if all connections are in use by other Tasks.

To write a Custom Condition:

| 1. | Implement the `CustomDiscriminator` or `CustomAffinity` interface in `SchedulingConditionFactory`.

| 2. | Package your classes into a JAR file, and for each Broker on which this is used, place that file in `DS_MANAGER``/webapps/livecluster/WEB-INF/lib`.

| 3. | At Service creation time, create it using the `SchedulingConditionFactory.createCustom[Affinity/Discriminator]` call. Note that it is not necessary to have the JAR in a Java Driver classpath; likewise, this is also available for C++ and .NET Services, since the class is only used on Brokers.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.