TestBeanContextServicesSupport.java 文件源码

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

项目:freeVM 作者:
/**
 * @see java.beans.beancontext.BeanContextServicesSupport#getService()
 */
public Result testGetService() throws Exception {

    context = new BeanContextServicesSupport();

    serviceBean = new ServiceBean();

    // Adding the component
    context.add(serviceBean);

    // Listen for new services
    context.addBeanContextServicesListener(serviceBean);
    TestServiceProvider provider = new TestServiceProvider();

    // Add service to the context
    context.addService(TestCounter.class, provider);

    if ((serviceBean.service instanceof TestCounter))
        return passed();
    else
        return failed("method testGetService");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号