站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Interface BeanContextServices - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

JavaTM 2 Platform
Standard Edition

java.beans.beancontext
Interface BeanContextServices

All Known Implementing Classes:
BeanContextServicesSupport

public interface BeanContextServices
extends BeanContext, BeanContextServicesListener

The BeanContextServices interface provides a mechanism for a BeanContext to expose generic "services" to the BeanContextChild objects within.


Fields inherited from interface java.beans.beancontext.BeanContext
globalHierarchyLock
 
Fields inherited from interface java.beans.DesignMode
PROPERTYNAME
 
Method Summary
 void addBeanContextServicesListener(BeanContextServicesListener bcsl)
          add a BeanContextServicesListener to this BeanContext
 boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider)
          add a service to this BeanContext
 Iterator getCurrentServiceClasses()
          return the currently available services
 Iterator getCurrentServiceSelectors(Class serviceClass)
           
 Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
           
 boolean hasService(Class serviceClass)
           
 void releaseService(BeanContextChild child, Object requestor, Object service)
          release the service reference
 void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
          remove a BeanContextServicesListener from this BeanContext
 void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
          remove a service from this BeanContext
 
Methods inherited from interface java.beans.beancontext.BeanContext
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener
 
Methods inherited from interface java.beans.beancontext.BeanContextServicesListener
serviceAvailable
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.beans.DesignMode
isDesignTime, setDesignTime
 
Methods inherited from interface java.beans.Visibility
avoidingGui, dontUseGui, needsGui, okToUseGui
 
Methods inherited from interface java.beans.beancontext.BeanContextServiceRevokedListener
serviceRevoked
 

Method Detail

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider serviceProvider)
add a service to this BeanContext

revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider serviceProvider,
                          boolean revokeCurrentServicesNow)
remove a service from this BeanContext

hasService

public boolean hasService(Class serviceClass)
Returns:
true iff the service is available.

getService

public Object getService(BeanContextChild child,
                         Object requestor,
                         Class serviceClass,
                         Object serviceSelector,
                         BeanContextServiceRevokedListener bcsrl)
                  throws TooManyListenersException
Returns:
a reference to this context's named Service as requested or null

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
release the service reference

getCurrentServiceClasses

public Iterator getCurrentServiceClasses()
return the currently available services

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(Class serviceClass)
Returns:
the currently available service selectors for the named serviceClass

addBeanContextServicesListener

public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
add a BeanContextServicesListener to this BeanContext

removeBeanContextServicesListener

public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
remove a BeanContextServicesListener from this BeanContext

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.