[jboss-cvs] JBossAS SVN: r88112 - in projects/ejb-book/trunk/ch05-encryption/src/main: resources/META-INF and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 1 18:01:29 EDT 2009


Author: ALRubinger
Date: 2009-05-01 18:01:29 -0400 (Fri, 01 May 2009)
New Revision: 88112

Modified:
   projects/ejb-book/trunk/ch05-encryption/src/main/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionBean.java
   projects/ejb-book/trunk/ch05-encryption/src/main/resources/META-INF/ejb-jar.xml
Log:
[EJBBOOK-5] Remove TODOs and injection-target workaround, instead specifying @Resource.name to match env-entry name

Modified: projects/ejb-book/trunk/ch05-encryption/src/main/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionBean.java
===================================================================
--- projects/ejb-book/trunk/ch05-encryption/src/main/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionBean.java	2009-05-01 21:57:37 UTC (rev 88111)
+++ projects/ejb-book/trunk/ch05-encryption/src/main/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionBean.java	2009-05-01 22:01:29 UTC (rev 88112)
@@ -80,6 +80,12 @@
    private static final String ENV_ENTRY_NAME_CIPHERS_PASSPHRASE = "ciphersPassphrase";
 
    /**
+    * Name of the environment entry representing the message digest algorithm supplied
+    * in ejb-jar.xml
+    */
+   private static final String ENV_ENTRY_NAME_MESSAGE_DIGEST_ALGORITHM = "messageDigestAlgorithm";
+
+   /**
     * Default Algorithm used by the Digest for one-way hashing
     */
    private static final String DEFAULT_ALGORITHM_MESSAGE_DIGEST = "MD5";
@@ -134,16 +140,11 @@
     */
    private String ciphersPassphrase;
 
-   //TODO https://jira.jboss.org/jira/browse/EJBTHREE-1813
-   //TODO https://jira.jboss.org/jira/browse/EJBBOOK-5
-   /*
-    * injection-target in XML should *NOT* be required here.
-    */
    /**
     * Algorithm to use in message digest (hash) operations, injected
-    * via @Resource annotation
+    * via @Resource annotation with name property equal to env-entry name
     */
-   @Resource
+   @Resource(name = ENV_ENTRY_NAME_MESSAGE_DIGEST_ALGORITHM)
    private String messageDigestAlgorithm;
 
    /**

Modified: projects/ejb-book/trunk/ch05-encryption/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- projects/ejb-book/trunk/ch05-encryption/src/main/resources/META-INF/ejb-jar.xml	2009-05-01 21:57:37 UTC (rev 88111)
+++ projects/ejb-book/trunk/ch05-encryption/src/main/resources/META-INF/ejb-jar.xml	2009-05-01 22:01:29 UTC (rev 88112)
@@ -34,18 +34,6 @@
         <env-entry-name>messageDigestAlgorithm</env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>SHA</env-entry-value>
-        <!--
-          TODO This "injection-target" should not be required, we've got @Resource on the
-          member
-          
-          https://jira.jboss.org/jira/browse/EJBTHREE-1813
-          https://jira.jboss.org/jira/browse/EJBBOOK-5
-        -->
-        <injection-target>
-          <injection-target-class>
-            org.jboss.ejb3.examples.ch05.encryption.EncryptionBean</injection-target-class>
-          <injection-target-name>messageDigestAlgorithm</injection-target-name>
-        </injection-target>
 
       </env-entry>
 




More information about the jboss-cvs-commits mailing list