简体   繁体   English

Websphere 8.5应用程序启动/停止通知

[英]Websphere 8.5 an application start/stop notification

How do I know that a application deployed in Websphere 8.5 has started/stopped. 我怎么知道在Websphere 8.5中部署的应用程序已启动/停止。 Intention is to send an email to a team when application is started/stopped. 目的是在启动/停止应用程序时向团队发送电子邮件。

So far I could not able to move any step further as I am not sure how to proceed. 到目前为止,由于不确定如何继续,我无法进一步采取任何措施。

You can use a singleton ejb marked as "startup" bean, where you use @PostConstruct and @PreDestroy for managing the lifecycle of your app. 您可以使用标记为“启动” bean的单例ejb,在其中使用@PostConstruct和@PreDestroy来管理应用程序的生命周期。

@javax.ejb.Startup
@javax.ejb.Singleton
public class Lifecycle {


    @javax.annotation.PostConstruct
    public void start() {
        //send mail
    }

    @javax.annotation.PreDestroy
    public void shutdown {
        // do something else :)
    }

}

Instead of trying to get application status in application scope, you can write a script which periodically checks application logs to find any start/stop logs, then send mail to recipients. 您可以编写一个脚本,该脚本定期检查应用程序日志以查找任何开始/停止日志,然后将邮件发送给收件人,而不是尝试获取应用程序范围内的应用程序状态。

WSVR0217I: Stopping application: ApplicationName
WSVR0221I: Application started: ApplicationName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM