Interface BeanContextServices

All Superinterfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Collection, DesignMode, EventListener, Iterable, Visibility
All Known Implementing Classes:
BeanContextServicesSupport

@Deprecated(since="23", forRemoval=true) public interface BeanContextServices extends BeanContext, BeanContextServicesListener
Deprecated, for removal: This API element is subject to removal in a future version.

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

  • Field Summary

    Fields declared in interface BeanContext

    globalHierarchyLock
    Modifier and Type
    Field
    Description
    static final Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc.

    Fields declared in interface DesignMode

    PROPERTYNAME
    Modifier and Type
    Field
    Description
    static final String
    The standard value of the propertyName as fired from a BeanContext or other source of PropertyChangeEvents.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a BeanContextServicesListener to this BeanContext
    boolean
    addService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a service to this BeanContext.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the currently available services for this context.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.
    getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
    Deprecated, for removal: This API element is subject to removal in a future version.
    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(Class<?> serviceClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reports whether or not a given service is currently available from this context.
    void
    releaseService(BeanContextChild child, Object requestor, Object service)
    Deprecated, for removal: This API element is subject to removal in a future version.
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a BeanContextServicesListener from this BeanContext
    void
    revokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
    Deprecated, for removal: This API element is subject to removal in a future version.
    BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method.

    Methods declared in interface BeanContext

    addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener
    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds the specified BeanContextMembershipListener to receive BeanContextMembershipEvents from this BeanContext whenever it adds or removes a child Component(s).
    Deprecated, for removal: This API element is subject to removal in a future version.
    Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Instantiate the javaBean named as a child of this BeanContext.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes the specified BeanContextMembershipListener so that it no longer receives BeanContextMembershipEvents when the child Component(s) are added or removed.

    Methods declared in interface BeanContextChild

    addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a PropertyChangeListener to this BeanContextChild in order to receive a PropertyChangeEvent whenever the specified property has changed.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a VetoableChangeListener to this BeanContextChild to receive events whenever the specified property changes.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the BeanContext associated with this BeanContextChild.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a PropertyChangeListener from this BeanContextChild so that it no longer receives PropertyChangeEvents when the specified property is changed.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a VetoableChangeListener from this BeanContextChild so that it no longer receives events when the specified property changes.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Objects that implement this interface, shall fire a java.beans.PropertyChangeEvent, with parameters: propertyName "beanContext", oldValue (the previous nesting BeanContext instance, or null), newValue (the current nesting BeanContext instance, or null).

    Methods declared in interface BeanContextServiceRevokedListener

    serviceRevoked
    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    The service named has been revoked. getService requests for this service will no longer be satisfied.

    Methods declared in interface BeanContextServicesListener

    serviceAvailable
    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    The service named has been registered. getService requests for this service may now be made.

    Methods declared in interface Collection

    add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
    Modifier and Type
    Method
    Description
    boolean
    Ensures that this collection contains the specified element (optional operation).
    boolean
    Adds all of the elements in the specified collection to this collection (optional operation).
    void
    Removes all of the elements from this collection (optional operation).
    boolean
    Returns true if this collection contains the specified element.
    boolean
    Returns true if this collection contains all of the elements in the specified collection.
    boolean
    Compares the specified object with this collection for equality.
    int
    Returns the hash code value for this collection.
    boolean
    Returns true if this collection contains no elements.
    Returns an iterator over the elements in this collection.
    default Stream
    Returns a possibly parallel Stream with this collection as its source.
    boolean
    Removes a single instance of the specified element from this collection, if it is present (optional operation).
    boolean
    Removes all of this collection's elements that are also contained in the specified collection (optional operation).
    default boolean
    Removes all of the elements of this collection that satisfy the given predicate (optional operation).
    boolean
    Retains only the elements in this collection that are contained in the specified collection (optional operation).
    int
    Returns the number of elements in this collection.
    default Spliterator
    Creates a Spliterator over the elements in this collection.
    default Stream
    Returns a sequential Stream with this collection as its source.
    Returns an array containing all of the elements in this collection.
    default <T> Object[]
    toArray(IntFunction generator)
    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.
    <T> Object[]
    Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

    Methods declared in interface DesignMode

    isDesignTime, setDesignTime
    Modifier and Type
    Method
    Description
    boolean
    A value of true denotes that JavaBeans should behave in design time mode, a value of false denotes runtime behavior.
    void
    setDesignTime(boolean designTime)
    Sets the "value" of the "designTime" property.

    Methods declared in interface Iterable

    forEach
    Modifier and Type
    Method
    Description
    default void
    forEach(Consumer action)
    Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

    Methods declared in interface Visibility

    avoidingGui, dontUseGui, needsGui, okToUseGui
    Modifier and Type
    Method
    Description
    boolean
    Determines whether this bean is avoiding using a GUI.
    void
    This method instructs the bean that it should not use the Gui.
    boolean
    Determines whether this bean needs a GUI.
    void
    This method instructs the bean that it is OK to use the Gui.
  • Method Details

    • addService

      boolean addService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Returns:
      true if the service was successful added, false otherwise
    • revokeService

      void revokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      boolean hasService(Class<?> serviceClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 - if there are too many listeners
    • releaseService

      void releaseService(BeanContextChild child, Object requestor, Object service)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      Iterator<?> getCurrentServiceClasses()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the currently available services for this context.
      Returns:
      an Iterator consisting of the currently available services
    • getCurrentServiceSelectors

      Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      void addBeanContextServicesListener(BeanContextServicesListener bcsl)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a BeanContextServicesListener to this BeanContext
      Parameters:
      bcsl - the BeanContextServicesListener to add
    • removeBeanContextServicesListener

      void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a BeanContextServicesListener from this BeanContext
      Parameters:
      bcsl - the BeanContextServicesListener to remove from this context