本文整理汇总了Java中com.googlecode.openbeans.beancontext.BeanContextServices类的典型用法代码示例。如果您正苦于以下问题:Java BeanContextServices类的具体用法?Java BeanContextServices怎么用?Java BeanContextServices使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BeanContextServices类属于com.googlecode.openbeans.beancontext包,在下文中一共展示了BeanContextServices类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasService
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Checks whether a service is registed in this context or the parent
* context.
*
* @param serviceClass
* the service class
* @return true if the service is registered
* @see com.googlecode.openbeans.beancontext.BeanContextServices#hasService(java.lang.Class)
*/
public boolean hasService(Class serviceClass) {
if (serviceClass == null) {
throw new NullPointerException();
}
boolean has;
synchronized (services) {
has = services.containsKey(serviceClass);
}
if (!has && getBeanContext() instanceof BeanContextServices) {
has = ((BeanContextServices) getBeanContext())
.hasService(serviceClass);
}
return has;
}
示例2: serviceAvailable
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Notify all listeners and children that implements
* <code>BeanContextServices</code> of the event.
*
* @see com.googlecode.openbeans.beancontext.BeanContextServicesListener#serviceAvailable(com.googlecode.openbeans.beancontext.BeanContextServiceAvailableEvent)
*/
public void serviceAvailable(BeanContextServiceAvailableEvent event) {
if (null == event) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
if (services.containsKey(event.serviceClass)) {
return;
}
fireServiceAdded(event);
Object childs[] = copyChildren();
for (int i = 0; i < childs.length; i++) {
if (childs[i] instanceof BeanContextServices) {
((BeanContextServices) childs[i]).serviceAvailable(event);
}
}
}
示例3: serviceRevoked
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Notify all listeners and children that implements
* <code>BeanContextServices</code> of the event.
*
* @see com.googlecode.openbeans.beancontext.BeanContextServiceRevokedListener#serviceRevoked(com.googlecode.openbeans.beancontext.BeanContextServiceRevokedEvent)
*/
public void serviceRevoked(BeanContextServiceRevokedEvent event) {
if (null == event) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
if (services.containsKey(event.serviceClass)) {
return;
}
fireServiceRevoked(event);
Object childs[] = copyChildren();
for (int i = 0; i < childs.length; i++) {
if (childs[i] instanceof BeanContextServices) {
((BeanContextServices) childs[i]).serviceRevoked(event);
}
}
}
示例4: BeanContextServiceRevokedEvent
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc,
boolean invalidate) {
super(bcs);
this.serviceClass = sc;
this.invalidateRefs = invalidate;
}
示例5: getService
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Delegate to the wrapped <code>BeanContextServices</code>.
*/
Object getService(BeanContextServices bcs, Object requestor,
Class serviceClass, Object serviceSelector,
BeanContextServiceRevokedListener listener)
throws TooManyListenersException {
return backBCS.getService(BeanContextServicesSupport.this
.getBeanContextServicesPeer(), requestor, serviceClass,
serviceSelector, new ServiceRevokedListenerDelegator(
listener));
}
示例6: notifyServiceAvailable
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
private void notifyServiceAvailable(BeanContextServiceAvailableEvent event) {
fireServiceAdded(event);
Object childs[] = copyChildren();
for (int i = 0; i < childs.length; i++) {
if (childs[i] instanceof BeanContextServices) {
((BeanContextServices) childs[i]).serviceAvailable(event);
}
}
}
示例7: initializeBeanContextResources
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Called after the parent context is updated. The implementation checks if
* the parent context is a <code>BeanContextServices</code>. If it is,
* then a <code>BCSSProxyServiceProvider</code> is created to delegate
* service requests to the parent context.
*
* @see com.googlecode.openbeans.beancontext.BeanContextChildSupport#initializeBeanContextResources()
*/
protected void initializeBeanContextResources() {
super.initializeBeanContextResources();
BeanContext context = getBeanContext();
if (context instanceof BeanContextServices) {
proxy = new BCSSProxyServiceProvider((BeanContextServices) context);
} else {
proxy = null;
}
}
示例8: getSourceAsBeanContextServices
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServices getSourceAsBeanContextServices() {
return (BeanContextServices) super.getBeanContext();
}
示例9: BCSSProxyServiceProvider
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
BCSSProxyServiceProvider(BeanContextServices backBCS) {
this.backBCS = backBCS;
}
示例10: getCurrentServiceSelectors
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Throws <code>UnsupportedOperationException</code>.
*/
public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
Class serviceClass) {
throw new UnsupportedOperationException();
}
示例11: releaseService
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
* Delegate to the wrapped <code>BeanContextServices</code>.
*/
public void releaseService(BeanContextServices bcs, Object requestor,
Object service) {
backBCS.releaseService(BeanContextServicesSupport.this
.getBeanContextServicesPeer(), requestor, service);
}
示例12: getService
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
Object getService(BeanContextServices bcs, Object requestor, Class serviceClass,
Object serviceSelector);
示例13: BeanContextServiceAvailableEvent
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
super(bcs);
this.serviceClass = sc;
}
示例14: getCurrentServiceSelectors
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public Iterator getCurrentServiceSelectors() {
return ((BeanContextServices) super.source)
.getCurrentServiceSelectors(serviceClass);
}
示例15: getSourceAsBeanContextServices
import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServices getSourceAsBeanContextServices() {
return (BeanContextServices) super.source;
}