I am new to thorntail. I have integrated quartz in thorntail and able to hit it as REST API. But can I store the scheduler information in context so that scheduler runs once the application is up instead of hitting a URL to run it? Please correct me if I am wrong .
The question doesn't have much details, but if I understand you correctly, you want to run some code when the application starts. There are at least these 2 ways how to do it:
Using CDI, create an
@ApplicationScopedbean with an observer for the@Initialized(ApplicationScoped.class)event:This requires the
io.thorntail:cdifraction.Using EJB, create a
@Singleton @StartupEJB and add a@PostConstructmethod:This requires the
io.thorntail:ejbfraction.I assume you already use CDI, so the 1st variant is probably preferable.