This patch should hopefully complete the BeanContext
stuff.  As I've not seen any real uses of this stuff,
I'd be interested in any testcases; not sure how right
this is.

Changelog:

2006-12-01  Andrew John Hughes  <[EMAIL PROTECTED]>

        * java/beans/beancontext/BeanContextServicesSupport.java:
        
(BCSSProxyServiceProvider.getCurrentServiceSelectors(BeanContextServices,
        Class)): Implemented.
        (BCSSProxyServiceProvider.getService(BeanContextServices, Object,
        Class, Object)): Implemented.
        (BCSSProxyServiceProvider.releaseService(BeanContextServices,
        Object, Object)): Implemented.
        
(BCSSProxyServiceProvider.serviceRevoked(BeanContextServiceRevokedEvent)):
        Implemented.
        (initialiseBeanContextResources()): Implemented.
        (releaseBeanContextResoures()): Implemented.

-- 
Andrew :-)

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: java/beans/beancontext/BeanContextServicesSupport.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/java/beans/beancontext/BeanContextServicesSupport.java,v
retrieving revision 1.12
diff -u -3 -p -u -r1.12 BeanContextServicesSupport.java
--- java/beans/beancontext/BeanContextServicesSupport.java      24 Nov 2006 
04:38:19 -0000      1.12
+++ java/beans/beancontext/BeanContextServicesSupport.java      1 Dec 2006 
21:23:24 -0000
@@ -86,38 +86,39 @@ public class BeanContextServicesSupport
   {
     private static final long serialVersionUID = 7078212910685744490L;
 
-    private BCSSProxyServiceProvider()
+    private BeanContextServiceProvider provider;
+
+    private BCSSProxyServiceProvider(BeanContextServiceProvider p)
     {
+      provider = p;
     }
 
     public Iterator getCurrentServiceSelectors (BeanContextServices bcs,
                                                 Class serviceClass)
-      throws NotImplementedException
     {
-      throw new Error ("Not implemented");
+      return provider.getCurrentServiceSelectors(bcs, serviceClass);
     }
 
     public Object getService (BeanContextServices bcs,
                               Object requestor,
                               Class serviceClass,
                               Object serviceSelector)
-      throws NotImplementedException
     {
-      throw new Error ("Not implemented");
+      return provider.getService(bcs, requestor, serviceClass,
+                                serviceSelector);
     }
 
     public void releaseService (BeanContextServices bcs,
                                 Object requestor,
                                 Object service)
-      throws NotImplementedException
     {
-      throw new Error ("Not implemented");
+      provider.releaseService(bcs, requestor, service);
     }
 
     public void serviceRevoked (BeanContextServiceRevokedEvent bcsre)
-      throws NotImplementedException
     {
-      throw new Error ("Not implemented");
+      if (provider instanceof BeanContextServiceRevokedListener)
+       ((BeanContextServiceRevokedListener) provider).serviceRevoked(bcsre);
     }
   }
 
@@ -772,16 +773,24 @@ public class BeanContextServicesSupport
     serviceLeases = new HashMap();
   }
 
-  protected  void initializeBeanContextResources ()
-    throws NotImplementedException
+  /**
+   * Subclasses may override this method to allocate resources
+   * from the nesting bean context.
+   */
+  protected  void initializeBeanContextResources()
   {
-    throw new Error ("Not implemented");
+    /* Purposefully left empty */
   }
 
-  protected  void releaseBeanContextResources ()
-    throws NotImplementedException
+  /**
+   * Relinquishes any resources obtained from the parent context.
+   * Specifically, those services obtained from the parent are revoked.
+   * Subclasses may override this method to deallocate resources
+   * from the nesting bean context.  
+   */
+  protected void releaseBeanContextResources()
   {
-    throw new Error ("Not implemented");
+    /* Purposefully left empty */
   }
 
   /**

Attachment: signature.asc
Description: Digital signature

Reply via email to