EventHandler questions
Looking for advice/examples for creating an EventHandler plugin to send a notification to an external app when a work item is closed.
2 Questions: 1. Looking at the other process articles, such as: https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample it isn't clear to me whether my plugin should have an Activator created or not. The instructions in the example article say to check the Singleton and "auto-activate" check boxes. The plugin wizard must have changed in 3.5 because there's no Singleton check box. I am assuming that Activator==auto-activate (but it could be the reverse). Anyone know the answer? 2. Are there any examples floating around of an EventHandler plugin? I'd like see one and haven't been able to find any. -Sky |
5 answers
Jared Burns (4.5k●2●9)
| answered Sep 28 '09, 8:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Fri, 25 Sep 2009 18:37:59 +0000, sky wrote:
Looking for advice/examples for creating an EventHandler plugin to send Have you also checked for this option in the manifest (Manifest.mf/ plugin.xml) editor? I'm on Eclipse 3.4, but for me there are two options on the Overview tab: "Activate this plug-in when one of its classes is loaded" and "This plug-in is a singleton". Both of those should be checked. -- Jared Burns Jazz Process Team |
I think there is away to register a listener using an extension point declared in com.ibm.team.repository.client which would cause your plugin to be loaded and your listener to handle the events of when someone connects/disconnects, logs in/logs out from a repository. I don't have access to the source code currently. I will reply tomorrow with an example.
|
Here is an example:
<extension> <listener> </listener> </extension> The listener class must extend com.ibm.team.repository.client.util.IListener In the above example the listener will notified about repository connections being added and removed. Hope this helps. |
<extension
point="com.ibm.team.repository.client.eventListener"> <listener eventCategory="state" listenerClass="com.ibm.team.repository.client.tests.events.DeclarativeListenerTest$Listener"> </listener> </extension> |
For listening to repository connection additions and removals use:
eventCategory="repositories" |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.