Expand my Community achievements bar.

SOLVED

Methods are deprecated in 6.2

Avatar

Level 2

HI All,


We are checking an condition for triggering the event using the method EventUtil.isLocal(event) which is deprecated in 6.2 could you let us know if any alternates are available.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi,

the combination of the two proposed solutions helps when registering a event handler service:

import org.osgi.service.event.EventConstants;
import org.apache.sling.event.dea.DEAConstants;

 

@Property(name = EventConstants.EVENT_FILTER, value = "(!(" + DEAConstants.PROPERTY_APPLICATION + "=*))");

View solution in original post

3 Replies

Avatar

Level 9

Hi Girish,

Use the property filter.  Some thing like 

@Property(name = EventConstants.EVENT_FILTER, value = "(!(propertyName=*))") 

Thanks,

Avatar

Administrator

Hi 

Replaced 
EventUtil.isLocal(evt) 
with 
evt.getProperty(DEAConstants.PROPERTY_APPLICATION) == null ? true : false)

~kautuk



Kautuk Sahni

Avatar

Correct answer by
Level 1

Hi,

the combination of the two proposed solutions helps when registering a event handler service:

import org.osgi.service.event.EventConstants;
import org.apache.sling.event.dea.DEAConstants;

 

@Property(name = EventConstants.EVENT_FILTER, value = "(!(" + DEAConstants.PROPERTY_APPLICATION + "=*))");