Java Deprecated Inheritance Feature - What's the 'Right' Way Now? | Community
Skip to main content
timlwhite
Level 2
May 6, 2016 2:39 PM UTC
Solved

Java Deprecated Inheritance Feature - What's the 'Right' Way Now?

Hello, we have a class that inherits from AbsoluteTimeAutoAdvancer:

public class WorkflowDelayedPublish extends AbsoluteTimeAutoAdvancer {

And we've started seeing these warnings:

[WARNING] C:\Projects\EWCM_Projects\ewcm\core\src\main\java\ewcm\global\core\workflow\email\process\WorkflowDelayedPublish.java [1:1]:  Component ewcm.global.core.workflow.email.process.WorkflowDelayedPublish is using the deprecated inheritance feature and inherits from com.day.cq.workflow.timeout.autoadvance.AbsoluteTimeAutoAdvancer. This feature will be removed in future versions.


[WARNING] C:\Projects\EWCM_Projects\ewcm\core\src\main\java\ewcm\global\core\workflow\email\process\WorkflowDelayedPublish.java [1:1]:  Component ewcm.global.core.workflow.email.process.WorkflowDelayedPublish is using the deprecated inheritance feature and inherits from com.day.cq.workflow.timeout.autoadvance.AutoAdvancer. This feature will be removed in future versions.

If someone could point me at how we're supposed to do this instead now, I'd really appreciate it. :)

Thank you!

Tim

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

9 replies

Level 2
Jun 29, 2018 8:37 PM UTC

So I am trying to use the autoAdvancer,

[1]

import com.adobe.granite.workflow.console.timeout.autoadvance.AutoAdvancer;

@Component(immediate = false,service= {AbsoluteTimeoutHandler.class})

public abstract class BaseAutoAdvancer extends AutoAdvancer implements AbsoluteTimeoutHandler {

But errors at AutoAdvancer which forces me to use com.day.cq.workflow.timeout.autoadvance.AutoAdvancer.

I do see the granite Autoadvancer service in the workflow-console-1.0.86 jar but cannot use it,wonder why.

I do not see the granite api listed here either

"The Adobe AEM Quickstart and Web Application."

[2]

I tried using the com.day.cq.workflow.timeout. although I would want to stick with granite, but the way I could do so is by casting, I did not want to update code everywhere.. please suggest

Any idea if I could just cast it to granite to com.day.cq as below?

public void execute(com.day.cq.workflow.exec.WorkItem workItem, com.day.cq.workflow.WorkflowSession workflowSession, com.day.cq.workflow.metadata.MetaDataMap metaDataMap) {

                emailMap = workflowService.initializeEmailMap((com.adobe.granite.workflow.exec.WorkItem)workItem, (com.adobe.granite.workflow.WorkflowSession)workflowSession);

Kindly assist with both [1] and [2]

Translate
joerghoh
Employee
Jun 29, 2018 8:07 PM UTC

Which maven plugin is throwing this warning? If the scr plugin is throwing it, you might hit the deprecation of the @Component(abstract=true) feature. http://javadox.com/org.apache.felix/org.apache.felix.scr.annotations/1.9.8/org/apache/felix/scr/annotations/Component.ht…

If you encounter this specific situation with the SCR plugin, you can safely ignore the warning on your side. But you should report it to Adobe support to raise awareness of this.

Jörg

Translate
Level 2
Jun 29, 2018 6:12 PM UTC

anyone with a solution? i am on 6.4

Translate
varshneyanuj
Level 2
May 19, 2016 9:41 AM UTC

We have updated the AbsoluteTimeAutoAdvancer to use the Granite Version of the API but still seeing the similar issue… Any pointers?

 

[WARNING] C:\Projects\EWCM_Projects\ewcm\core\src\main\java\ewcm\global\core\workflow\email\process\WorkflowDelayedPublish.java [1:1]:  Component ewcm.global.core.workflow.email.process.WorkflowDelayedPublish is using the deprecated inheritance feature and inherits from com.adobe.granite.workflow.console.timeout.autoadvance.AbsoluteTimeAutoAdvancer. This feature will be removed in future versions.

[WARNING] C:\Projects\EWCM_Projects\ewcm\core\src\main\java\ewcm\global\core\workflow\email\process\WorkflowDelayedPublish.java [1:1]:  Component ewcm.global.core.workflow.email.process.WorkflowDelayedPublish is using the deprecated inheritance feature and inherits from com.adobe.granite.workflow.console.timeout.autoadvance.AutoAdvancer. This feature will be removed in future versions.

 

Thanks in advance.

 

-Anuj

Translate
smacdonald2008
Level 10
May 16, 2016 8:50 PM UTC

It was a Javadoc issue - that is the proper API to use. 

Translate
timlwhite
timlwhiteAuthor
Level 2
May 16, 2016 7:47 PM UTC

It looks like it may be a javadoc issue?

While I do not see it here:

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/overview-summary.html

I was able to compile against that path in 6.0....

Translate
smacdonald2008
Level 10
May 11, 2016 1:54 AM UTC

I will double check this

Translate
timlwhite
timlwhiteAuthor
Level 2
May 6, 2016 7:56 PM UTC

Thanks, Scott!

Unfortunately, I can't seem to locate the 6.0 version of AbsoluteTimeAutoAdvancer in the com.adobe.granite tree... :(

I only see it here:

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/workflow/timeout/autoadvance/AbsoluteTimeAutoAdvancer.html

I don't see a deprecation warning, or other note on what it might have been replaced by?

Thanks!

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
May 6, 2016 7:09 PM UTC