Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Level 10
9 Replies

Avatar

Correct answer by
Level 10

Avatar

Level 3

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/A...

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

Thanks!

Avatar

Level 3

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....

Avatar

Level 10

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

Avatar

Level 2

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

Avatar

Level 2

anyone with a solution? i am on 6.4

Avatar

Employee Advisor

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/anno...

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

Avatar

Level 2

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]