Search in sources :

Example 1 with SessionBy

use of org.nutz.mvc.annotation.SessionBy in project nutz by nutzam.

the class NutLoading method createSessionProvider.

@SuppressWarnings({ "all" })
protected void createSessionProvider(NutConfig config, Class<?> mainModule) throws Exception {
    SessionBy sb = mainModule.getAnnotation(SessionBy.class);
    if (sb != null) {
        SessionProvider sp = null;
        if (sb.args() != null && sb.args().length == 1 && sb.args()[0].startsWith("ioc:"))
            sp = config.getIoc().get(sb.value(), sb.args()[0].substring(4));
        else
            sp = Mirror.me(sb.value()).born((Object[]) sb.args());
        if (log.isInfoEnabled())
            log.info("SessionBy --> " + sp);
        config.setSessionProvider(sp);
    }
}
Also used : SessionBy(org.nutz.mvc.annotation.SessionBy) SessionProvider(org.nutz.mvc.SessionProvider)

Aggregations

SessionProvider (org.nutz.mvc.SessionProvider)1 SessionBy (org.nutz.mvc.annotation.SessionBy)1