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 / BeanContextServices.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.4 KB  |  91 lines

  1. /*
  2.  * @(#)BeanContextServices.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. import java.util.TooManyListenersException;
  20.  
  21. import java.beans.beancontext.BeanContext;
  22.  
  23. import java.beans.beancontext.BeanContextServiceProvider;
  24.  
  25. import java.beans.beancontext.BeanContextServicesListener;
  26.  
  27.  
  28. /**
  29.  * <p>
  30.  * The BeanContextServices interface provides a mechanism for a BeanContext
  31.  * to expose generic "services" to the BeanContextChild objects within.
  32.  * </p>
  33.  */
  34.  
  35. public interface BeanContextServices extends BeanContext, BeanContextServicesListener {
  36.  
  37.     /**
  38.      * add a service to this BeanContext
  39.      */
  40.    
  41.     boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider);
  42.  
  43.     /**
  44.      * remove a service from this BeanContext
  45.      */
  46.  
  47.     void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow);
  48.  
  49.     /**
  50.      * @return true iff the service is available.
  51.      */
  52.  
  53.     boolean hasService(Class serviceClass);
  54.  
  55.     /**
  56.      * @return a reference to this context's named Service as requested or null
  57.      */
  58.  
  59.     Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException;
  60.  
  61.     /**
  62.      * release the service reference
  63.      */
  64.  
  65.     void releaseService(BeanContextChild child, Object requestor, Object service); 
  66.  
  67.     /**
  68.      * return the currently available services
  69.      */
  70.  
  71.     Iterator getCurrentServiceClasses();
  72.  
  73.     /**
  74.      * @return the currently available service selectors for the named serviceClass
  75.      */
  76.  
  77.     Iterator getCurrentServiceSelectors(Class serviceClass);
  78.  
  79.     /**
  80.      * add a BeanContextServicesListener to this BeanContext
  81.      */
  82.  
  83.     void addBeanContextServicesListener(BeanContextServicesListener bcsl);
  84.  
  85.     /**
  86.      * remove a BeanContextServicesListener from this BeanContext
  87.      */
  88.  
  89.     void removeBeanContextServicesListener(BeanContextServicesListener bcsl);
  90. }
  91.