[weld-commits] Weld SVN: r6174 - extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Apr 28 09:05:43 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-04-28 09:05:40 -0400 (Wed, 28 Apr 2010)
New Revision: 6174

Modified:
   extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAware.java
   extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerProvider.java
Log:
javadoc for BMA/BMP

Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAware.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAware.java	2010-04-28 12:47:09 UTC (rev 6173)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAware.java	2010-04-28 13:05:40 UTC (rev 6174)
@@ -29,15 +29,26 @@
 import org.jboss.weld.extensions.util.service.ServiceLoader;
 
 /**
+ * <p>
  * Super-class for non-CDI-native components that need a reference to the
- * {@link BeanManager}
+ * {@link BeanManager}. {@link BeanManagerProvider}s can be registered to allow
+ * third parties to register custom methods of looking up the BeanManager.
+ * </p>
+ * 
  * <p>
- * <b>**WARNING**</b> This class is <b>NEVER</b> safe to use outside of specific
- * seam-faces implementation classes, and should be <b>avoided at all costs</b>.
- * If you need a handle to the {@link BeanManager} you should probably register
- * an {@link Extension} instead of using this class; have you tried using @
- * {@link Inject}?
+ * <b>**WARNING**</b> This class is <b>NOT</b> a clever way to get the BeanManager,
+ * and should be <b>avoided at all costs</b>. If you need a handle to the 
+ * {@link BeanManager} you should probably register an {@link Extension} instead of
+ * using this class; have you tried using @{@link Inject}?
+ * </p>
  * 
+ * <p>
+ * If you think you need to use this class, chat to the community and make sure you
+ * aren't missing an trick!
+ * </p>
+ * 
+ * @see BeanManagerProvider
+ * 
  * @author Nicklas Karlsson
  */
 public class BeanManagerAware
@@ -56,6 +67,11 @@
       }
    }
 
+   /**
+    * Obtain the {@link BeanManager} from the {@link BeanManagerProvider}s
+    * 
+    * @return the current BeanManager for the bean archive
+    */
    protected BeanManager getBeanManager()
    {
       if (beanManager == null)

Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerProvider.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerProvider.java	2010-04-28 12:47:09 UTC (rev 6173)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerProvider.java	2010-04-28 13:05:40 UTC (rev 6174)
@@ -21,8 +21,20 @@
 import org.jboss.weld.extensions.util.Sortable;
 
 /**
- * Provider for obtaining a BeanManager
+ * BeanManagerProvider is an SPI which allows third parties to
+ * register a way of obtaining the BeanManager outside of CDI
+ * managed objects.
  * 
+ * Built in providers are {@link DefaultJndiBeanManagerProvider}
+ * and {@link JBossJndiBeanManagerProvider}.
+ * 
+ * Providers can specify a precedence, allowing a provider to be a 
+ * "last resort" provider only.
+ * 
+ * Precedence about 100 is reserved for providers that should always
+ * be used. Precedence below 10 is reserved for providers of last
+ * resort.
+ * 
  * @author Nicklas Karlsson
  * 
  */



More information about the weld-commits mailing list