本文整理汇总了Java中java.beans.beancontext.BeanContextServicesSupport.getService方法的典型用法代码示例。如果您正苦于以下问题:Java BeanContextServicesSupport.getService方法的具体用法?Java BeanContextServicesSupport.getService怎么用?Java BeanContextServicesSupport.getService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.beancontext.BeanContextServicesSupport
的用法示例。
在下文中一共展示了BeanContextServicesSupport.getService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetServiceException
import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
/**
* @see java.beans.beancontext.BeanContextServicesSupport#getService()
*/
public Result testGetServiceException() throws Exception {
BeanContextChild child = null;
Object requestor = null;
Class serviceClass = null;
Object serviceSelector = null;
BeanContextServiceRevokedListener bcsrl = null;
BeanContextServicesSupport context = new BeanContextServicesSupport();
serviceBean = null;
try {
context.getService(child, requestor ,serviceClass,serviceSelector,bcsrl);
} catch (NullPointerException e) {
return passed();
}
return failed("testGetServiceException");
}
示例2: initializeBeanContextResources
import java.beans.beancontext.BeanContextServicesSupport; //导入方法依赖的package包/类
protected void initializeBeanContextResources() {
super.initializeBeanContextResources();
BeanContextServicesSupport bcs = (BeanContextServicesSupport) getBeanContext();
try {
bcs.getService(this, this, MyService1.class, null, this);
}
catch (Exception exception) {
exception.printStackTrace();
}
bcs.addService(this.getClass(), this);
}