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


Java BeanContextServices类代码示例

本文整理汇总了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;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:25,代码来源:BeanContextServicesSupport.java

示例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);
        }
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:22,代码来源:BeanContextServicesSupport.java

示例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);
        }
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:22,代码来源:BeanContextServicesSupport.java

示例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;        
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:8,代码来源:BeanContextServiceRevokedEvent.java

示例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));
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:13,代码来源:BeanContextServicesSupport.java

示例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);
        }
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:10,代码来源:BeanContextServicesSupport.java

示例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;
    }
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:19,代码来源:BeanContextServicesSupport.java

示例8: getSourceAsBeanContextServices

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServices getSourceAsBeanContextServices() {
    return (BeanContextServices) super.getBeanContext();
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:4,代码来源:BeanContextServiceRevokedEvent.java

示例9: BCSSProxyServiceProvider

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
BCSSProxyServiceProvider(BeanContextServices backBCS) {
    this.backBCS = backBCS;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:4,代码来源:BeanContextServicesSupport.java

示例10: getCurrentServiceSelectors

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
/**
 * Throws <code>UnsupportedOperationException</code>.
 */
public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
        Class serviceClass) {
    throw new UnsupportedOperationException();
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:8,代码来源:BeanContextServicesSupport.java

示例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);
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:9,代码来源:BeanContextServicesSupport.java

示例12: getService

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
Object getService(BeanContextServices bcs, Object requestor, Class serviceClass,
Object serviceSelector);
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:3,代码来源:BeanContextServiceProvider.java

示例13: BeanContextServiceAvailableEvent

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
    super(bcs);
    this.serviceClass = sc;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:5,代码来源:BeanContextServiceAvailableEvent.java

示例14: getCurrentServiceSelectors

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public Iterator getCurrentServiceSelectors() {
    return ((BeanContextServices) super.source)
            .getCurrentServiceSelectors(serviceClass);
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:5,代码来源:BeanContextServiceAvailableEvent.java

示例15: getSourceAsBeanContextServices

import com.googlecode.openbeans.beancontext.BeanContextServices; //导入依赖的package包/类
public BeanContextServices getSourceAsBeanContextServices() {
    return (BeanContextServices) super.source;
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:4,代码来源:BeanContextServiceAvailableEvent.java


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