geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1427693 - in /geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi: CDI.java CDIProvider.java
Date Wed, 02 Jan 2013 08:08:59 GMT
Author: struberg
Date: Wed Jan  2 08:08:59 2013
New Revision: 1427693

URL: http://svn.apache.org/viewvc?rev=1427693&view=rev
Log:
GERONIMO-6182 add new CDI-1.1 CDI and CDIProvider classes

Added:
    geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
    geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java

Added: geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java?rev=1427693&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
Wed Jan  2 08:08:59 2013
@@ -0,0 +1,41 @@
+package javax.enterprise.inject.spi;
+
+import javax.enterprise.inject.Instance;
+
+/**
+ * <p>Static helper class to access the {@link BeanManager}</p>
+ *
+ * TODO not yet implemented!
+ *
+ * <p>Usage:
+ * <pre>
+ * BeanManager bm = CDI.current().getBeanManager();
+ * </pre>
+ * </p>
+ *
+ *
+ */
+public abstract class CDI<T> implements Instance<T>
+{
+
+    public static CDI<Object> current()
+    {
+        return null; //X TODO implement!
+    }
+
+    /**
+     * <p>A container or an application can set this manually. If not
+     * we will use the {@link java.util.ServiceLoader} and use the
+     * first service we find.</p>
+     *
+     * TODO: clarify if this is per 'application' or general?
+     *
+     * @param provider to use
+     */
+    public static void setCDIProvider(CDIProvider provider)
+    {
+        //X TODO implement!
+    }
+
+    public abstract BeanManager getBeanManager();
+}

Added: geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java?rev=1427693&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java
Wed Jan  2 08:08:59 2013
@@ -0,0 +1,11 @@
+package javax.enterprise.inject.spi;
+
+/**
+ * <p>Pluggable mechanism to resolve the CDI instance.</p>
+ * <p>A container or an application can set this with
+ * {@link CDI#setCDIProvider(CDIProvider)}</p>
+ */
+public interface CDIProvider
+{
+    public CDI<Object> getCDI();
+}



Mime
View raw message