home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / beans / beancontext / BeanContextServiceProvider.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.0 KB  |  65 lines

  1. /*
  2.  * @(#)BeanContextServiceProvider.java    1.3 98/03/18
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.beans.beancontext;
  16.  
  17. import java.util.Iterator;
  18.  
  19. /**
  20.  * <p>
  21.  * One of the primary functions of a BeanContext is to act a as rendezvous 
  22.  * between JavaBeans, and BeanContextServiceProviders.
  23.  * </p>
  24.  * <p>
  25.  * A JavaBean nested within a BeanContext, may ask that BeanContext to 
  26.  * provide an instance of a "service", based upon a reference to a Java
  27.  * Class object that represents that service.
  28.  * </p>
  29.  * <p>
  30.  * If such a service has been registered with the context, or one of its 
  31.  * nesting context's, in the case where a context delegate to its context
  32.  * to satisfy a service request, then the BeanContextServiceProvider associated with 
  33.  * the service is asked to provide an instance of that service.
  34.  * </p>
  35.  * <p>
  36.  * The ServcieProvider may always return the same instance, or it may
  37.  * construct a new instance for each request.
  38.  * </p>
  39.  */
  40.  
  41. public interface BeanContextServiceProvider {
  42.  
  43.    /**
  44.     * request an instance of a service, 
  45.     *
  46.     * @param requestor         The object requesting the service
  47.     * @param serviceClass    The service requested
  48.     * @param serviceSelector    Additional parameterisation of the service 
  49.     */
  50.  
  51.     Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector);
  52.  
  53.     /**
  54.      * release the service
  55.      */
  56.  
  57.     public void releaseService(BeanContextServices bcs, Object requestor, Object service);
  58.  
  59.     /**
  60.      * @return the current service selectors for the specified serviceClass
  61.      */
  62.  
  63.     Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass);
  64. }
  65.