geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r931414 - in /geronimo/server/trunk/plugins: connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ j2ee/geronim...
Date Wed, 07 Apr 2010 03:17:49 GMT
Author: gawor
Date: Wed Apr  7 03:17:47 2010
New Revision: 931414

URL: http://svn.apache.org/viewvc?rev=931414&view=rev
Log:
GERONIMO-5232: Update DD with @Resource.lookup attribute

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/AnnotationHelperTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/ResourceAnnotationExample.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/resources/annotation/env-entry-expected.xml

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
Wed Apr  7 03:17:47 2010
@@ -440,7 +440,13 @@ public class AdminObjectRefBuilder exten
             if (!mappdedNameAnnotation.equals("")) {
                 XsdStringType mappedName = resourceEnvRef.addNewMappedName();
                 mappedName.setStringValue(mappdedNameAnnotation);
-                resourceEnvRef.setMappedName(mappedName);
+            }
+            
+            // lookup
+            String lookup = annotation.lookup();
+            if (!lookup.equals("")) {
+                XsdStringType lookupName = resourceEnvRef.addNewLookupName();
+                lookupName.setStringValue(lookup);
             }
         }
 
@@ -460,7 +466,6 @@ public class AdminObjectRefBuilder exten
                 // message-destination-ref-type
                 MessageDestinationTypeType msgDestType = messageDestinationRef.addNewMessageDestinationType();
                 msgDestType.setStringValue(resourceType);
-                messageDestinationRef.setMessageDestinationType(msgDestType);
             }
             if (method != null || field != null) {
                 // injectionTarget
@@ -484,7 +489,13 @@ public class AdminObjectRefBuilder exten
             if (!mappdedNameAnnotation.equals("")) {
                 XsdStringType mappedName = messageDestinationRef.addNewMappedName();
                 mappedName.setStringValue(mappdedNameAnnotation);
-                messageDestinationRef.setMappedName(mappedName);
+            }
+            
+            // lookup
+            String lookup = annotation.lookup();
+            if (!lookup.equals("")) {
+                XsdStringType lookupName = messageDestinationRef.addNewLookupName();
+                lookupName.setStringValue(lookup);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Wed Apr  7 03:17:47 2010
@@ -374,26 +374,28 @@ public class ResourceRefBuilder extends 
                         if (annotation.authenticationType() == Resource.AuthenticationType.CONTAINER)
{
                             ResAuthType resAuth = resourceRef.addNewResAuth();
                             resAuth.setStringValue("Container");
-                            resourceRef.setResAuth(resAuth);
                         } else if (annotation.authenticationType() == Resource.AuthenticationType.APPLICATION)
{
                             ResAuthType resAuth = resourceRef.addNewResAuth();
                             resAuth.setStringValue("Application");
-                            resourceRef.setResAuth(resAuth);
                         }
 
                         // sharing scope
                         ResSharingScopeType resScope = resourceRef.addNewResSharingScope();
                         resScope.setStringValue(annotation.shareable() ? "Shareable" : "Unshareable");
-                        resourceRef.setResSharingScope(resScope);
 
                         // mappedName
                         String mappdedNameAnnotation = annotation.mappedName();
                         if (!mappdedNameAnnotation.equals("")) {
                             XsdStringType mappedName = resourceRef.addNewMappedName();
                             mappedName.setStringValue(mappdedNameAnnotation);
-                            resourceRef.setMappedName(mappedName);
                         }
 
+                        // lookup
+                        String lookup = annotation.lookup();
+                        if (!lookup.equals("")) {
+                            XsdStringType lookupName = resourceRef.addNewLookupName();
+                            lookupName.setStringValue(lookup);
+                        }
                     }
                     catch (Exception anyException) {
                         log.debug("ResourceRefBuilder: Exception caught while processing
<resource-ref>");

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
Wed Apr  7 03:17:47 2010
@@ -230,18 +230,17 @@ public class EnvironmentEntryBuilder ext
                             configureInjectionTarget(injectionTarget, method, field);
                         }
 
+                        //------------------------------------------------------------------------------
+                        // <env-entry> optional elements:
+                        //------------------------------------------------------------------------------
+                        
                         // mappedName
                         String mappdedNameAnnotation = annotation.mappedName();
                         if (!mappdedNameAnnotation.equals("")) {
                             XsdStringType mappedName = envEntry.addNewMappedName();
                             mappedName.setStringValue(mappdedNameAnnotation);
-                            envEntry.setMappedName(mappedName);
                         }
 
-                        //------------------------------------------------------------------------------
-                        // <env-entry> optional elements:
-                        //------------------------------------------------------------------------------
-
                         // description
                         String descriptionAnnotation = annotation.description();
                         if (!descriptionAnnotation.equals("")) {
@@ -249,6 +248,12 @@ public class EnvironmentEntryBuilder ext
                             description.setStringValue(descriptionAnnotation);
                         }
 
+                        // lookup
+                        String lookup = annotation.lookup();
+                        if (!lookup.equals("")) {
+                            XsdStringType lookupName = envEntry.addNewLookupName();
+                            lookupName.setStringValue(lookup);
+                        }
                     }
                     catch (Exception anyException) {
                         log.debug("ResourceAnnotationHelper: Exception caught while processing
<env-entry>");

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/AnnotationHelperTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/AnnotationHelperTest.java?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/AnnotationHelperTest.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/AnnotationHelperTest.java
Wed Apr  7 03:17:47 2010
@@ -60,7 +60,7 @@ public class AnnotationHelperTest extend
 
         List<Method> annotatedMethods = classFinder.findAnnotatedMethods(Resource.class);
         assertNotNull(annotatedMethods);
-        assertEquals(2, annotatedMethods.size());
+        assertEquals(3, annotatedMethods.size());
         assertTrue(annotatedMethods.contains(ResourceAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod1",
new Class[]{String.class})));
         assertTrue(annotatedMethods.contains(ResourceAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod2",
new Class[]{String.class})));
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/ResourceAnnotationExample.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/ResourceAnnotationExample.java?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/ResourceAnnotationExample.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/annotation/ResourceAnnotationExample.java
Wed Apr  7 03:17:47 2010
@@ -67,4 +67,7 @@ public class ResourceAnnotationExample {
     public void setAnnotatedMethod2(String string) {
     }
 
+    @Resource(lookup = "java:app/foo")
+    public void setAnnotatedMethod3(String string) {
+    }
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/resources/annotation/env-entry-expected.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/resources/annotation/env-entry-expected.xml?rev=931414&r1=931413&r2=931414&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/resources/annotation/env-entry-expected.xml
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/resources/annotation/env-entry-expected.xml
Wed Apr  7 03:17:47 2010
@@ -18,8 +18,8 @@
 
 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-   version="2.5" >
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+   version="3.0" >
 
     <display-name>Empty web application</display-name>
     <description>Empty web application</description>
@@ -37,5 +37,14 @@
              <injection-target-name>annotatedMethod2</injection-target-name>
         </injection-target>
     </env-entry>
+    <env-entry>
+        <env-entry-name>org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationTest/annotatedMethod3</env-entry-name>
+        <env-entry-type>java.lang.String</env-entry-type>
+        <injection-target>
+             <injection-target-class>org.apache.geronimo.naming.deployment.annotation.ResourceAnnotationExample</injection-target-class>
+             <injection-target-name>annotatedMethod3</injection-target-name>
+        </injection-target>
+        <lookup-name>java:app/foo</lookup-name>
+    </env-entry>
 
 </web-app>



Mime
View raw message