Plugin for data monitoring [message #1725645] |
Sat, 05 March 2016 12:58  |
Eclipse User |
|
|
|
Hello,
i would like to create om2m plugin which will get (intercept) inserted data after new contentInstance and do something with it.
I was thinking about subscribing on application but i want this for all applications and i need get this data as fast as possible (dont want to loose to much time between new contentInstance and getting this data in my plugin). Is there any option that i could use ServiceTracker on SCL service or something like that?
I would rly appreciate your help.
M.
|
|
|
|
Re: Plugin for data monitoring [message #1725728 is a reply to message #1725660] |
Mon, 07 March 2016 05:26   |
Eclipse User |
|
|
|
Hello Matej,
In my point of view, you have multiple options to perform this operation.
The first one, as you pointed out, is making subscriptions on every container you are interested in and make your own computation in your plugin (push to another database as you mentioned). But this can be hard to make as, depending on your installation and deployment, you can have a lot of applications/containers and you have to create a lot of subscriptions.
Then, talking about the duration, the subscription is not that slow to be sent and is good enough for your intent. (it can be slow if you have a lot of subscriptions, depends on your configuration)
Another possibility, if you are brave enough to look at the ContentInstanceController in the core plugin, is to add directly a call to your plugin at the end of the creation of a ContentInstance (Threaded call of course to let the response of the request to be sent back). In that case, your plugin will be directly called and you will not have to make subscriptions.
Furthermore, you will have to use the ServiceTracker to find your plugin (you have some example in the platform, you just have to look at Activator classes).
The main concern in that case is that you have to change a part of code in the core plugin of the platform. This can be annoying to maintain as this is the main plugin that we change and update (for bug fix, enhancement, etc).
So the choice is yours but still, I would advise the first one which is more maintainable in my point of view.
Hope this can help,
François
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06422 seconds