Build Bean for Scheduled Tasks

How do I build a bean for use in scheduled Task?

In scheduled tasks you can use any bean with an interface and with at least one suitable method.
For example:


package com.company.demo.beans;
public interface MyBean {
    String NAME = "demo_MyBean";
    String execute();
}

package com.company.demo.beans;
import org.springframework.stereotype.Component;
@Component(MyBean.NAME)
public class MyBeanImpl implements MyBean {
    @Override
    public String execute() {
        return "Done";
    }
}

I found out how to do it. The Bean was in wrong module.
To see the Bean in Bean Name list in Web. Please put the Bean and Interface in the “app-web” module
It work with spring and Cuba Scheduled Task.
Tank you.

Actually, CUBA scheduled tasks can invoke only beans defined in the core module.
We will add this notice to the docs.

Where should i put public interface for bean? is there any working example?