Activator.java 文件源码

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

项目:magic-bundle 作者:
@Override
public void start(BundleContext context) throws Exception {
    log.info("######################################################");
    log.info("start");
    log.info("######################################################");

    Hashtable<String, String> props = new Hashtable<>();
    props.put("osgi.http.whiteboard.servlet.pattern", "/*");
    props.put("init.message", "Crazy filter!");
    props.put("service.ranking", "1");
    serviceRegistration = context.registerService(Filter.class.getName(), new CrazyFilter(), props);

    final ServiceReference<?> httpRef = context.getServiceReference("org.osgi.service.http.HttpService");
    httpService = (HttpService) context.getService(httpRef);

    httpService.registerServlet("/foo", new FooServlet(), new Hashtable(), httpService.createDefaultHttpContext());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号