Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvc Setup 的 destroy 方法,读取不到 Ioc #153

Closed
zozoh opened this issue Feb 9, 2012 · 2 comments
Closed

Mvc Setup 的 destroy 方法,读取不到 Ioc #153

zozoh opened this issue Feb 9, 2012 · 2 comments
Assignees
Milestone

Comments

@zozoh
Copy link
Member

zozoh commented Feb 9, 2012

我随便建立了一个 Setup init 的时候很好,但是 destory 的时候, 获取 Ioc 取不到

public class ZTaskSetup implements Setup {

private static final Log log = Logs.get();

@Override
public void init(NutConfig config) {
   ...

@Override
public void destroy(NutConfig config) {
    // 关闭并通知
    Ioc ioc = config.getIoc();
    GlobalLock glock = ioc.get(GlobalLock.class, "schedule");
    glock.setStop(true);

    ...
}

等有时时间我再跟一下, 看来是 Mvcs.getIoc() 的问题,
而且 Mvcs.NAME 再 Filter 的 destroy 方法里,返回的就是 null

为啥 Mvcs.NAME 要用 ThreadLocal 呢? 难到要支持多个 Ioc 容器不成 ?

@ghost ghost assigned wendal Feb 9, 2012
@wendal
Copy link
Member

wendal commented Feb 10, 2012

恩.很快搞定

wendal added a commit that referenced this issue Feb 10, 2012
@wendal
Copy link
Member

wendal commented Feb 10, 2012

是的,需要支持多个NutServlet/NutFilter同时存在于web.xml

@wendal wendal closed this as completed Feb 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants