java.beans.beancontext
Interface BeanContextServices

All Superinterfaces:
BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext , BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild , BeanContextServiceRevokedListener sample code for java.beans.beancontext.BeanContextServiceRevokedListener definition code for java.beans.beancontext.BeanContextServiceRevokedListener , BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener , Collection sample code for java.util.Collection definition code for java.util.Collection , DesignMode sample code for java.beans.DesignMode definition code for java.beans.DesignMode , EventListener sample code for java.util.EventListener definition code for java.util.EventListener , Iterable sample code for java.lang.Iterable definition code for java.lang.Iterable , Visibility sample code for java.beans.Visibility definition code for java.beans.Visibility
All Known Implementing Classes:
BeanContextServicesSupport sample code for java.beans.beancontext.BeanContextServicesSupport definition code for java.beans.beancontext.BeanContextServicesSupport

public interface BeanContextServices
extends BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext , BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener

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


Field Summary
 
Fields inherited from interface java.beans.beancontext.BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext
globalHierarchyLock sample code for java.beans.beancontext.BeanContext.globalHierarchyLock definition code for java.beans.beancontext.BeanContext.globalHierarchyLock
 
Fields inherited from interface java.beans.DesignMode sample code for java.beans.DesignMode definition code for java.beans.DesignMode
PROPERTYNAME sample code for java.beans.DesignMode.PROPERTYNAME definition code for java.beans.DesignMode.PROPERTYNAME
 
Method Summary
 void addBeanContextServicesListener sample code for java.beans.beancontext.BeanContextServices.addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) definition code for java.beans.beancontext.BeanContextServices.addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) (BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener  bcsl)
          Adds a BeanContextServicesListener to this BeanContext
 boolean addService sample code for java.beans.beancontext.BeanContextServices.addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider) definition code for java.beans.beancontext.BeanContextServices.addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider) (Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass, BeanContextServiceProvider sample code for java.beans.beancontext.BeanContextServiceProvider definition code for java.beans.beancontext.BeanContextServiceProvider  serviceProvider)
          Adds a service to this BeanContext.
 Iterator sample code for java.util.Iterator definition code for java.util.Iterator getCurrentServiceClasses sample code for java.beans.beancontext.BeanContextServices.getCurrentServiceClasses() definition code for java.beans.beancontext.BeanContextServices.getCurrentServiceClasses() ()
          Gets the currently available services for this context.
 Iterator sample code for java.util.Iterator definition code for java.util.Iterator getCurrentServiceSelectors sample code for java.beans.beancontext.BeanContextServices.getCurrentServiceSelectors(java.lang.Class) definition code for java.beans.beancontext.BeanContextServices.getCurrentServiceSelectors(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass)
          Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.
 Object sample code for java.lang.Object definition code for java.lang.Object getService sample code for java.beans.beancontext.BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) definition code for java.beans.beancontext.BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) (BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild  child, Object sample code for java.lang.Object definition code for java.lang.Object  requestor, Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass, Object sample code for java.lang.Object definition code for java.lang.Object  serviceSelector, BeanContextServiceRevokedListener sample code for java.beans.beancontext.BeanContextServiceRevokedListener definition code for java.beans.beancontext.BeanContextServiceRevokedListener  bcsrl)
          A BeanContextChild, or any arbitrary object associated with a BeanContextChild, may obtain a reference to a currently registered service from its nesting BeanContextServices via invocation of this method.
 boolean hasService sample code for java.beans.beancontext.BeanContextServices.hasService(java.lang.Class) definition code for java.beans.beancontext.BeanContextServices.hasService(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass)
          Reports whether or not a given service is currently available from this context.
 void releaseService sample code for java.beans.beancontext.BeanContextServices.releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) definition code for java.beans.beancontext.BeanContextServices.releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) (BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild  child, Object sample code for java.lang.Object definition code for java.lang.Object  requestor, Object sample code for java.lang.Object definition code for java.lang.Object  service)
          Releases a BeanContextChild's (or any arbitrary object associated with a BeanContextChild) reference to the specified service by calling releaseService() on the underlying BeanContextServiceProvider.
 void removeBeanContextServicesListener sample code for java.beans.beancontext.BeanContextServices.removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) definition code for java.beans.beancontext.BeanContextServices.removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) (BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener  bcsl)
          Removes a BeanContextServicesListener from this BeanContext
 void revokeService sample code for java.beans.beancontext.BeanContextServices.revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) definition code for java.beans.beancontext.BeanContextServices.revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) (Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass, BeanContextServiceProvider sample code for java.beans.beancontext.BeanContextServiceProvider definition code for java.beans.beancontext.BeanContextServiceProvider  serviceProvider, boolean revokeCurrentServicesNow)
          BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method.
 
Methods inherited from interface java.beans.beancontext.BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext
addBeanContextMembershipListener sample code for java.beans.beancontext.BeanContext.addBeanContextMembershipListener(java.beans.beancontext.BeanContextMembershipListener) definition code for java.beans.beancontext.BeanContext.addBeanContextMembershipListener(java.beans.beancontext.BeanContextMembershipListener) , getResource sample code for java.beans.beancontext.BeanContext.getResource(java.lang.String, java.beans.beancontext.BeanContextChild) definition code for java.beans.beancontext.BeanContext.getResource(java.lang.String, java.beans.beancontext.BeanContextChild) , getResourceAsStream sample code for java.beans.beancontext.BeanContext.getResourceAsStream(java.lang.String, java.beans.beancontext.BeanContextChild) definition code for java.beans.beancontext.BeanContext.getResourceAsStream(java.lang.String, java.beans.beancontext.BeanContextChild) , instantiateChild sample code for java.beans.beancontext.BeanContext.instantiateChild(java.lang.String) definition code for java.beans.beancontext.BeanContext.instantiateChild(java.lang.String) , removeBeanContextMembershipListener sample code for java.beans.beancontext.BeanContext.removeBeanContextMembershipListener(java.beans.beancontext.BeanContextMembershipListener) definition code for java.beans.beancontext.BeanContext.removeBeanContextMembershipListener(java.beans.beancontext.BeanContextMembershipListener)
 
Methods inherited from interface java.beans.beancontext.BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild
addPropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , addVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) , getBeanContext sample code for java.beans.beancontext.BeanContextChild.getBeanContext() definition code for java.beans.beancontext.BeanContextChild.getBeanContext() , removePropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , removeVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) , setBeanContext sample code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext) definition code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext)
 
Methods inherited from interface java.util.Collection sample code for java.util.Collection definition code for java.util.Collection
add sample code for java.util.Collection.add(E) definition code for java.util.Collection.add(E) , addAll sample code for java.util.Collection.addAll(java.util.Collection) definition code for java.util.Collection.addAll(java.util.Collection) , clear sample code for java.util.Collection.clear() definition code for java.util.Collection.clear() , contains sample code for java.util.Collection.contains(java.lang.Object) definition code for java.util.Collection.contains(java.lang.Object) , containsAll sample code for java.util.Collection.containsAll(java.util.Collection) definition code for java.util.Collection.containsAll(java.util.Collection) , equals sample code for java.util.Collection.equals(java.lang.Object) definition code for java.util.Collection.equals(java.lang.Object) , hashCode sample code for java.util.Collection.hashCode() definition code for java.util.Collection.hashCode() , isEmpty sample code for java.util.Collection.isEmpty() definition code for java.util.Collection.isEmpty() , iterator sample code for java.util.Collection.iterator() definition code for java.util.Collection.iterator() , remove sample code for java.util.Collection.remove(java.lang.Object) definition code for java.util.Collection.remove(java.lang.Object) , removeAll sample code for java.util.Collection.removeAll(java.util.Collection) definition code for java.util.Collection.removeAll(java.util.Collection) , retainAll sample code for java.util.Collection.retainAll(java.util.Collection) definition code for java.util.Collection.retainAll(java.util.Collection) , size sample code for java.util.Collection.size() definition code for java.util.Collection.size() , toArray sample code for java.util.Collection.toArray() definition code for java.util.Collection.toArray() , toArray sample code for java.util.Collection.toArray(T[]) definition code for java.util.Collection.toArray(T[])
 
Methods inherited from interface java.beans.DesignMode sample code for java.beans.DesignMode definition code for java.beans.DesignMode
isDesignTime sample code for java.beans.DesignMode.isDesignTime() definition code for java.beans.DesignMode.isDesignTime() , setDesignTime sample code for java.beans.DesignMode.setDesignTime(boolean) definition code for java.beans.DesignMode.setDesignTime(boolean)
 
Methods inherited from interface java.beans.Visibility sample code for java.beans.Visibility definition code for java.beans.Visibility
avoidingGui sample code for java.beans.Visibility.avoidingGui() definition code for java.beans.Visibility.avoidingGui() , dontUseGui sample code for java.beans.Visibility.dontUseGui() definition code for java.beans.Visibility.dontUseGui() , needsGui sample code for java.beans.Visibility.needsGui() definition code for java.beans.Visibility.needsGui() , okToUseGui sample code for java.beans.Visibility.okToUseGui() definition code for java.beans.Visibility.okToUseGui()
 
Methods inherited from interface java.beans.beancontext.BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener
serviceAvailable sample code for java.beans.beancontext.BeanContextServicesListener.serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent) definition code for java.beans.beancontext.BeanContextServicesListener.serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent)
 
Methods inherited from interface java.beans.beancontext.BeanContextServiceRevokedListener sample code for java.beans.beancontext.BeanContextServiceRevokedListener definition code for java.beans.beancontext.BeanContextServiceRevokedListener
serviceRevoked sample code for java.beans.beancontext.BeanContextServiceRevokedListener.serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent) definition code for java.beans.beancontext.BeanContextServiceRevokedListener.serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent)
 

Method Detail

addService sample code for java.beans.beancontext.BeanContextServices.addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider) definition code for java.beans.beancontext.BeanContextServices.addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider)

boolean addService(Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass,
                   BeanContextServiceProvider sample code for java.beans.beancontext.BeanContextServiceProvider definition code for java.beans.beancontext.BeanContextServiceProvider  serviceProvider)
Adds a service to this BeanContext. BeanContextServiceProviders call this method to register a particular service with this context. If the service has not previously been added, the BeanContextServices associates the service with the BeanContextServiceProvider and fires a BeanContextServiceAvailableEvent to all currently registered BeanContextServicesListeners. The method then returns true, indicating that the addition of the service was successful. If the given service has already been added, this method simply returns false.

Parameters:
serviceClass - the service to add
serviceProvider - the BeanContextServiceProvider associated with the service

revokeService sample code for java.beans.beancontext.BeanContextServices.revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean) definition code for java.beans.beancontext.BeanContextServices.revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean)

void revokeService(Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass,
                   BeanContextServiceProvider sample code for java.beans.beancontext.BeanContextServiceProvider definition code for java.beans.beancontext.BeanContextServiceProvider  serviceProvider,
                   boolean revokeCurrentServicesNow)
BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method. Upon revocation of the service, the BeanContextServices fires a BeanContextServiceRevokedEvent to its list of currently registered BeanContextServiceRevokedListeners and BeanContextServicesListeners.

Parameters:
serviceClass - the service to revoke from this BeanContextServices
serviceProvider - the BeanContextServiceProvider associated with this particular service that is being revoked
revokeCurrentServicesNow - a value of true indicates an exceptional circumstance where the BeanContextServiceProvider or BeanContextServices wishes to immediately terminate service to all currently outstanding references to the specified service.

hasService sample code for java.beans.beancontext.BeanContextServices.hasService(java.lang.Class) definition code for java.beans.beancontext.BeanContextServices.hasService(java.lang.Class)

boolean hasService(Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass)
Reports whether or not a given service is currently available from this context.

Parameters:
serviceClass - the service in question
Returns:
true if the service is available

getService sample code for java.beans.beancontext.BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener) definition code for java.beans.beancontext.BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener)

Object sample code for java.lang.Object definition code for java.lang.Object  getService(BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild  child,
                  Object sample code for java.lang.Object definition code for java.lang.Object  requestor,
                  Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass,
                  Object sample code for java.lang.Object definition code for java.lang.Object  serviceSelector,
                  BeanContextServiceRevokedListener sample code for java.beans.beancontext.BeanContextServiceRevokedListener definition code for java.beans.beancontext.BeanContextServiceRevokedListener  bcsrl)
                  throws TooManyListenersException sample code for java.util.TooManyListenersException definition code for java.util.TooManyListenersException 
A BeanContextChild, or any arbitrary object associated with a BeanContextChild, may obtain a reference to a currently registered service from its nesting BeanContextServices via invocation of this method. When invoked, this method gets the service by calling the getService() method on the underlying BeanContextServiceProvider.

Parameters:
child - the BeanContextChild associated with this request
requestor - the object requesting the service
serviceClass - class of the requested service
serviceSelector - the service dependent parameter
bcsrl - the BeanContextServiceRevokedListener to notify if the service should later become revoked
Returns:
a reference to this context's named Service as requested or null
Throws:
TooManyListenersException sample code for java.util.TooManyListenersException definition code for java.util.TooManyListenersException

releaseService sample code for java.beans.beancontext.BeanContextServices.releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object) definition code for java.beans.beancontext.BeanContextServices.releaseService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Object)

void releaseService(BeanContextChild sample code for java.beans.beancontext.BeanContextChild definition code for java.beans.beancontext.BeanContextChild  child,
                    Object sample code for java.lang.Object definition code for java.lang.Object  requestor,
                    Object sample code for java.lang.Object definition code for java.lang.Object  service)
Releases a BeanContextChild's (or any arbitrary object associated with a BeanContextChild) reference to the specified service by calling releaseService() on the underlying BeanContextServiceProvider.

Parameters:
child - the BeanContextChild
requestor - the requestor
service - the service

getCurrentServiceClasses sample code for java.beans.beancontext.BeanContextServices.getCurrentServiceClasses() definition code for java.beans.beancontext.BeanContextServices.getCurrentServiceClasses()

Iterator sample code for java.util.Iterator definition code for java.util.Iterator  getCurrentServiceClasses()
Gets the currently available services for this context.

Returns:
an Iterator consisting of the currently available services

getCurrentServiceSelectors sample code for java.beans.beancontext.BeanContextServices.getCurrentServiceSelectors(java.lang.Class) definition code for java.beans.beancontext.BeanContextServices.getCurrentServiceSelectors(java.lang.Class)

Iterator sample code for java.util.Iterator definition code for java.util.Iterator  getCurrentServiceSelectors(Class sample code for java.lang.Class definition code for java.lang.Class  serviceClass)
Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.

Parameters:
serviceClass - the specified service
Returns:
the currently available service selectors for the named serviceClass

addBeanContextServicesListener sample code for java.beans.beancontext.BeanContextServices.addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) definition code for java.beans.beancontext.BeanContextServices.addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener)

void addBeanContextServicesListener(BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener  bcsl)
Adds a BeanContextServicesListener to this BeanContext

Parameters:
bcsl - the BeanContextServicesListener to add

removeBeanContextServicesListener sample code for java.beans.beancontext.BeanContextServices.removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener) definition code for java.beans.beancontext.BeanContextServices.removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener)

void removeBeanContextServicesListener(BeanContextServicesListener sample code for java.beans.beancontext.BeanContextServicesListener definition code for java.beans.beancontext.BeanContextServicesListener  bcsl)
Removes a BeanContextServicesListener from this BeanContext

Parameters:
bcsl - the BeanContextServicesListener to remove from this context