src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -601,25 +601,32 @@
                 super();
 
                 serviceProvider = bcsp;
             }
 
+            /**
+             * Returns the service provider.
+             * @return the service provider
+             */
             protected BeanContextServiceProvider getServiceProvider() {
                 return serviceProvider;
             }
 
-            /*
-             * fields
+            /**
+             * The service provider.
              */
 
             protected BeanContextServiceProvider serviceProvider;
         }
 
         /**
          * subclasses can override this method to create new subclasses of
          * BCSSServiceProvider without having to overrride addService() in
          * order to instantiate.
+         * @return a service provider without overriding addService()
+         * @param sc the class
+         * @param bcsp the service provider
          */
 
         protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
             return new BCSSServiceProvider(sc, bcsp);
         }

@@ -627,11 +634,11 @@
     /************************************************************************/
 
     /**
      * add a BeanContextServicesListener
      *
-     * @throws NullPointerException
+     * @throws NullPointerException if the argument is null
      */
 
     public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
         if (bcsl == null) throw new NullPointerException("bcsl");
 

@@ -658,18 +665,24 @@
         }
     }
 
     /**
      * add a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
      */
 
     public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) {
         return addService(serviceClass, bcsp, true);
     }
 
     /**
      * add a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
+     * @param fireEvent whether or not an event should be fired
+     * @return true if the service was successfully added
      */
 
     protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
 
         if (serviceClass == null) throw new NullPointerException("serviceClass");

@@ -707,10 +720,13 @@
         }
     }
 
     /**
      * remove a service
+     * @param serviceClass the service class
+     * @param bcsp the service provider
+     * @param revokeCurrentServicesNow whether or not to revoke the service
      */
 
     public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
 
         if (serviceClass == null) throw new NullPointerException("serviceClass");

@@ -1065,10 +1081,11 @@
         }
     }
 
     /**
      * Fires a <tt>BeanContextServiceEvent</tt> notifying of a new service.
+     * @param serviceClass the service class
      */
     protected final void fireServiceAdded(Class serviceClass) {
         BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
 
         fireServiceAdded(bcssae);

@@ -1107,10 +1124,12 @@
 
     /**
      * Fires a <tt>BeanContextServiceRevokedEvent</tt>
      * indicating that a particular service is
      * no longer available.
+     * @param serviceClass the service class
+     * @param revokeNow whether or not the event should be revoked now
      */
     protected final void fireServiceRevoked(Class serviceClass, boolean revokeNow) {
         Object[]                       copy;
         BeanContextServiceRevokedEvent bcsre = new BeanContextServiceRevokedEvent(getBeanContextServicesPeer(), serviceClass, revokeNow);