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

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Sat May 8 11:24:07 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-05-08 11:24:06 -0400 (Sat, 08 May 2010)
New Revision: 6217

Added:
   extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAccessor.java
Log:
WELDX-99

Added: extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAccessor.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAccessor.java	                        (rev 0)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAccessor.java	2010-05-08 15:24:06 UTC (rev 6217)
@@ -0,0 +1,35 @@
+package org.jboss.weld.extensions.beanManager;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+import javax.inject.Inject;
+
+/**
+ * <p>
+ * Super-class for non-CDI-native components that need a reference to the
+ * {@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>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
+ * 
+ */
+public class BeanManagerAccessor extends BeanManagerAware
+{
+   public static BeanManager getManager()
+   {
+      return new BeanManagerAccessor().getBeanManager();
+   }
+} 
\ No newline at end of file


Property changes on: extensions/trunk/src/main/java/org/jboss/weld/extensions/beanManager/BeanManagerAccessor.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the weld-commits mailing list