StandardContext.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:tomcat7 作者:
/** Destroy needs to clean up the context completely.
 * 
 * The problem is that undoing all the config in start() and restoring 
 * a 'fresh' state is impossible. After stop()/destroy()/init()/start()
 * we should have the same state as if a fresh start was done - i.e
 * read modified web.xml, etc. This can only be done by completely 
 * removing the context object and remapping a new one, or by cleaning
 * up everything.
 * 
 * XXX Should this be done in stop() ?
 * 
 */ 
@Override
protected void destroyInternal() throws LifecycleException {

    // If in state NEW when destroy is called, the object name will never
    // have been set so the notification can't be created
    if (getObjectName() != null) { 
        // Send j2ee.object.deleted notification 
        Notification notification = 
            new Notification("j2ee.object.deleted", this.getObjectName(), 
                             sequenceNumber.getAndIncrement());
        broadcaster.sendNotification(notification);
    }

    if (namingResources != null) {
        namingResources.destroy();
    }

    synchronized (instanceListenersLock) {
        instanceListeners = new String[0];
    }

    super.destroyInternal();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号