Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Analytics : Using the position service framework : Implementing custom position trackers : Registering custom position trackers
Registering custom position trackers
In your custom tracker, use the com.apama.position.tracker.PSTrackerFactory event to register your custom tracker with the position service manager. There are two actions available for registering your tracker: registerTracker() and registerTrackerWithConfig().
Each action
*Registers your custom tracker with the position service manager. The position service manager will use the provided PSTrackerInterface object to communicate with your custom tracker.
*Creates a new position tracker manager interface object (com.apama.position.tracker.PSTrackerManagerInterface) and returns it to your custom tracker. Your custom tracker uses this object to communicate with the position service manager.
In addition, the registerTrackerWithConfig() action specifies an additional callback action that you can use when your custom tracker requires initial configuration. For example, if your custom tracker has its own persistence mechanism. The position service manager calls this action before it finishes registration of your custom tracker.
The arguments to the registration actions are as follows:
A name for your custom tracker. The name must be unique in your application.
The type of your tracker. This is application-dependent and must be unique in your application.
A reference to the main context.
An instance of com.apama.position.PositionConfigSchema, which defines the configuration parameters that can be set when subscribing to this tracker.
An instance of com.apama.position.tracker.PSTrackerInterface that defines the set of callback actions the custom position tracker is registering. These are the actions that your custom tracker is required to implement plus any other actions required by your application. See Actions custom trackers must implement.
A callback action that will be called before registration is complete. Use this action to perform any initial configuration, for example, if you want to configure a particular persistence mechanism. You specify this argument only for the registerTrackerWithConfig() action.
A callback action that will be called after registration of a custom tracker. This action returns an instance of PSTrackerManagerInterface, a boolean value that indicates success or failure, and a string message that you define and that is provided back to you upon registration. A typical use of this string is to provide information if the registration failed, for example, if you try to register a tracker with the same trackerType as a tracker already registered.
See also Sample code for implementing a custom position tracker.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback