ShiroActivator.java 文件源码

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

项目:adeptj-modules 作者:
/**
 * Initializes the Shiro Security Framework.
 */
@Override
public void start(BundleContext context) throws Exception {
    cacheProviderTracker = new CacheProviderTracker(context, CacheProvider.class);
    cacheProviderTracker.open();
    // Register the Shiro EnvironmentLoaderListener first.
    Dictionary<String, Object> shiroListenerProps = new Hashtable<>();
    shiroListenerProps.put(Constants.SERVICE_VENDOR, "AdeptJ");
    shiroListenerProps.put("osgi.http.whiteboard.listener", "true");
    servRegShiroListener = context.registerService(ServletContextListener.class, new ExtEnvironmentLoaderListener(),
            shiroListenerProps);
    // Now Register the ShiroFilter.
    Dictionary<String, Object> shiroFilterProps = new Hashtable<>();
    shiroFilterProps.put(Constants.SERVICE_VENDOR, "AdeptJ");
    shiroFilterProps.put("osgi.http.whiteboard.filter.name", "Shiro Filter");
    shiroFilterProps.put("osgi.http.whiteboard.filter.pattern", "/*");
    shiroFilterProps.put("osgi.http.whiteboard.filter.asyncSupported", "true");
    shiroFilterProps.put("osgi.http.whiteboard.filter.dispatcher",
            new String[] { "REQUEST", "INCLUDE", "FORWARD", "ASYNC", "ERROR" });
    servRegShiroFilter = context.registerService(Filter.class, new ShiroFilter(), shiroFilterProps);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号