[seam-commits] Seam SVN: r11885 - in modules/envconfig/trunk: src/main/java/org/jboss/seam/envconfig and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Dec 24 12:23:08 EST 2009
Author: dan.j.allen
Date: 2009-12-24 12:23:08 -0500 (Thu, 24 Dec 2009)
New Revision: 11885
Modified:
modules/envconfig/trunk/readme.txt
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/EnvironmentBinding.java
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/EnvironmentBindingExtension.java
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java
Log:
JavaDoc (credit to Matt Corey)
Modified: modules/envconfig/trunk/readme.txt
===================================================================
--- modules/envconfig/trunk/readme.txt 2009-12-23 22:41:14 UTC (rev 11884)
+++ modules/envconfig/trunk/readme.txt 2009-12-24 17:23:08 UTC (rev 11885)
@@ -30,3 +30,12 @@
Then inject the resource:
@Resource(lookup = "java:global/adminUser") User user;
+
+TODO:
+
+- Add tests (learning Arquillian first)
+- Support unbinding, either with @Unbind, or by simply handling a 'null' value for unbind
+- Support binding producer methods
+- Make 'value' optional on @Bind, using the property name for the binding if not provided (may need to qualify it with class name, possibly even module name?)
+- Implement JndiBinder as a Servlet for non-EJB containers?
+- Create web and/or REST interface to display/reprocess bindings?
Modified: modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java
===================================================================
--- modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java 2009-12-23 22:41:14 UTC (rev 11884)
+++ modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java 2009-12-24 17:23:08 UTC (rev 11885)
@@ -22,12 +22,27 @@
import java.lang.annotation.Target;
/**
+ * An annotation that can be applied to any field or method to indicate that
+ * its value should be bound to JNDI under the key provided in the 'value'
+ * attribute.
+ *
* @author Matt Corey
*/
@Target( { ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Bind
{
+ /**
+ * The JNDI key to bind the value to. If the value is not a full JNDI name,
+ * then the value will be prefixed with 'java:/global/', putting the value
+ * into the global JNDI namespace.
+ */
String value();
+
+ /**
+ * Specify whether or not to overwrite a value that may already exist at the
+ * provided JNDI name. If overwrite is set to false, the binding will be
+ * ignored if a value already exists.
+ */
boolean overwrite() default true;
}
Modified: modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/EnvironmentBinding.java
===================================================================
--- modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/EnvironmentBinding.java 2009-12-23 22:41:14 UTC (rev 11884)
+++ modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/EnvironmentBinding.java 2009-12-24 17:23:08 UTC (rev 11885)
@@ -25,6 +25,10 @@
import javax.enterprise.inject.Stereotype;
/**
+ * A stereotype that can be applied to any class that should be processed for
+ * @Bind fields or methods. Any bean with this stereotype applied will default
+ * to application-scoped.
+ *
* @author Matt Corey
*/
@Stereotype
Modified: modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/EnvironmentBindingExtension.java
===================================================================
--- modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/EnvironmentBindingExtension.java 2009-12-23 22:41:14 UTC (rev 11884)
+++ modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/EnvironmentBindingExtension.java 2009-12-24 17:23:08 UTC (rev 11885)
@@ -31,6 +31,11 @@
import org.slf4j.LoggerFactory;
/**
+ * A CDI portable extension class that is resposible for listening to
+ * ProcessBean events, and 'collecting' beans that have the @EnvironmentBinding
+ * stereotype annotation. A startup bean will then iterate over these
+ * beans and process the JNDI bindings.
+ *
* @author Matt Corey
*/
public class EnvironmentBindingExtension implements Extension
Modified: modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java
===================================================================
--- modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java 2009-12-23 22:41:14 UTC (rev 11884)
+++ modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java 2009-12-24 17:23:08 UTC (rev 11885)
@@ -34,6 +34,9 @@
import org.slf4j.LoggerFactory;
/**
+ * An EJB Singleton-based implementation that actually processes the
+ * @EnvironmentBinding annotated classes.
+ *
* @author Matt Corey
*/
public @Singleton @Startup class JndiBinder
More information about the seam-commits
mailing list