package cn.cerc.mis.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;

import cn.cerc.db.core.IHandle;
import cn.cerc.db.core.ISession;

@Component
@Scope(WebApplicationContext.SCOPE_REQUEST)
public class BasicHandle implements IHandle, AutoCloseable {
    private ISession session;

    public BasicHandle() {
        super();
    }

    public BasicHandle(String token) {
        super();
        this.loadToken(token);
    }

    @Override
    public ISession getSession() {
        if (session == null)
            session = Application.getSession();
        return session;
    }

    @Autowired
    @Override
    public void setSession(ISession session) {
        this.session = session;
    }

    @Override
    public void close() {
        if (session != null) {
            session.close();
            session = null;
        }
    }

    public BasicHandle loadToken(String token) {
        getSession().loadToken(token);
        return this;
    }

}

@@ -576,20 +576,28 @@
         
-this
+getSession()
 .loadTok
@@ -1035,122 +1035,6 @@
  %7D%0A%0A
-    public BasicHandle loadToken(String token) %7B%0A        getSession().loadToken(token);%0A        return this;%0A    %7D%0A%0A
 %7D%0A

Update BasicHandle.java