Event trigger is not firing

Questions about YourKit Java Profiler
Post Reply
ajitmahadik
Posts: 1
Joined: Wed Feb 25, 2015 4:24 pm

Event trigger is not firing

Post by ajitmahadik »

I am using following event to trigger

Method Invocation:

Method Pattern:
<packageName>.EventBatchWriter : updateEventNotificationStatus(EventBatchDomain)

Instance of class:
<packageName>.EventBatchWriter

Below three check boxes are checked. But the event is not getting fired.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Event trigger is not firing

Post by Anton Katilin »

Hi,

1. Did you you add an action? The 3 checks you mentioned are applied only if the RecordMethodInvocation action is added.
2. Is EventBatchWriter an interface/a base class or the actual class contains the definition of updateEventNotificationStatus()? The method pattern implies the latter: it matches class name, not its superclasses.
3. You don't need to specify "Instance of class" unless you want to additionally filter the classes matching the "Method Pattern".

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Event trigger is not firing

Post by Anton Katilin »

More questions:

4. When did you apply the trigger? If you did it after the class to be implemented had loaded and some of its instances had been created, they may keep using the old method definition. To avoid this problem apply the triggers from start, as described in the "How to specify triggers on startup" section:
https://www.yourkit.com/docs/java/help/triggers.jsp
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Event trigger is not firing

Post by Anton Katilin »

An update:

It looks like the method pattern is wrong. Please note that the parameter types, if specified, should be full class names.

So, your pattern should likely use the EventBatchDomain's full class name:

Code: Select all

<packageName>.EventBatchWriter : updateEventNotificationStatus(<packageName>.EventBatchDomain)
Alternatively, if there is only one method named updateEventNotificationStatus, you can use a wildcard to match any parameter list:

Code: Select all

<packageName>.EventBatchWriter : updateEventNotificationStatus(*)
Post Reply