我说的是 Java EE 应用程序和 Wildfly 应用程序服务器。假设我有一个 jar 作为定义以下类的库:
@Singleton
@Startup
class StartupService {
@PostConstruct
public void onConstruct() {
/* do something */
}
}
现在,我有我的实际战争项目(maven 项目),它具有上述 jar 作为依赖项。因此,StartupService
当战争部署到 Wildfly 并开始时,就会执行该类。
有没有办法StartupService
在我的实际项目中覆盖行为或禁用?