当前位置: 首页>>代码示例>>Java>>正文


Java BeanContextServicesSupport.revokeService方法代码示例

本文整理汇总了Java中java.beans.beancontext.BeanContextServicesSupport.revokeService方法的典型用法代码示例。如果您正苦于以下问题:Java BeanContextServicesSupport.revokeService方法的具体用法?Java BeanContextServicesSupport.revokeService怎么用?Java BeanContextServicesSupport.revokeService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.beans.beancontext.BeanContextServicesSupport的用法示例。


在下文中一共展示了BeanContextServicesSupport.revokeService方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRevokeServiceException

import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServicesSupport#revokeService()
 */
public Result testRevokeServiceException()    throws Exception {

    Class serviceClass = null;
    BeanContextServiceProvider bcsp = null;
    BeanContextServicesSupport context = new BeanContextServicesSupport();
    serviceBean = null;

    try {
        context.revokeService(serviceClass,bcsp,true);
    } catch (NullPointerException e) {
        return passed();
    }
    return failed("testRevokeServiceException");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:18,代码来源:TestBeanContextServicesSupportException.java

示例2: testIsServiceClass

import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServiceRevokedEvent#isServiceClass()
 */
public Result testIsServiceClass() 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 the service to the context
    context.addService(TestCounter.class, provider);

    // Revoke the service from the context
    context.revokeService(TestCounter.class, provider, true);

    if ((context.hasService(TestCounter.class))
            || (serviceBean.bcsre.isServiceClass(TestCounter.class)))
        return passed();
    else
        return failed("method testIsServiceClasss");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:30,代码来源:TestBeanContextServiceRevokedEvent.java

示例3: testIsCurrentServiceInvalidNow

import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServiceRevokedEvent#isCurrentServiceInvalidNow()
 */
public Result testIsCurrentServiceInvalidNow() 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 the service to the context
    context.addService(TestCounter.class, provider);

    // Revoke the service from the context
    context.revokeService(TestCounter.class, provider, true);

    // Verified that the method isCurrentServiceInvalidNow return true if current service is revoked
    if ((context.hasService(TestCounter.class))
            || (serviceBean.bcsre.isCurrentServiceInvalidNow()))
        return passed();
    else
        return failed("method testIsCurrentServiceInvalidNow");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:31,代码来源:TestBeanContextServiceRevokedEvent.java

示例4: testGetSourceAsBeanContextServices

import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
 * @see java.beans.beancontext.BeanContextServiceRevokedEvent#getSourceAsBeanContextServices()
 */
public Result testGetSourceAsBeanContextServices() 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 the service to the context
    context.addService(TestCounter.class, provider);

    // Revoke the service from the context
    context.revokeService(TestCounter.class, provider, true);

    // Verified that the method getSourceAsBeanContextServices return BeanContextServicesSupport object if current service is revoked
    if ((context.hasService(TestCounter.class))
            || serviceBean.bcsre.getSourceAsBeanContextServices() instanceof BeanContextServicesSupport)
        return passed();
    else
        return failed("method testGetSourceAsBeanContextServices");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:31,代码来源:TestBeanContextServiceRevokedEvent.java

示例5: testNumberRevokedEvents

import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
 * Test for revoke events numbers
 * @see java.beans.beancontext.BeanContextServiceRevokedEvent
 */
public Result testNumberRevokedEvents() 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 the service to the context
    context.addService(TestCounter.class, provider);

    // Revoke the service from the context
    context.revokeService(TestCounter.class, provider, true);

    if ((context.hasService(TestCounter.class))
            || (serviceBean.counterRevokedEvent == 2))
        return passed();
    else
        return failed("method testNumberRevokedEvents");
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:31,代码来源:TestBeanContextServiceRevokedEvent.java


注:本文中的java.beans.beancontext.BeanContextServicesSupport.revokeService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。