Skip to main content
Level 2
Mar 22, 2017 7:59 AM UTC
Solved

Methods are deprecated in 6.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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
CarstenZiAccepted solution
Adobe Employee
Mar 27, 2017 7:35 AM UTC

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 + "=*))");

3 replies

MC_Stuff
Level 10
Mar 24, 2017 7:55 PM UTC

Hi Girish,

Use the property filter.  Some thing like 

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

Thanks,

Translate
kautuk_sahni
Level 9
Mar 27, 2017 6:28 AM UTC

Hi 

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

~kautuk

Translate
Kautuk Sahni
CarstenZiAdobe EmployeeAccepted solution
Adobe Employee
Mar 27, 2017 7:35 AM UTC

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 + "=*))");

Translate