Consider some AppModule in Tapestry project.
I want to order sequence of actions, which must invoke on system startup.
Consider, I have two simple actions:
1) Action, which must go first:
@Startup
public static void initMyApplication(Logger logger, LiquibaseService liquibaseService) {
logger.info("Updating database by liquibase service...");
liquibaseService.update();
logger.info("update-db done.");
}
2) and the second one:
@Startup
@Order("after:LiquibaseService")
public static void doSomeChecks(HibernateSessionManager hsm) {
...
}
I can not understand (even after reading documentation): how can I specify order of such actions using @Order annotation?
More specifically: what do I need to point into @Order("after:<HERE>)?
It seems, that constructions like:
@Order("after:LiquibaseService")
or
@Order("after:initMyApplication")
don’t work. Actually my startup actions are invoked in arbitrary order.
I don’t think
@Ordercan be used with@Startupbut what you can do is usecontributeRegistryStartup. As it expects anOrderedConfigurationyou can order your contributions.