geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r948266 - 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/
Date Wed, 26 May 2010 00:16:50 GMT
Author: djencks
Date: Wed May 26 00:16:50 2010
New Revision: 948266

URL: http://svn.apache.org/viewvc?rev=948266&view=rev
Log:
GERONIMO-5346 infer jndi entry type from injections, resources

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/AbstractNamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java

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=948266&r1=948265&r2=948266&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 May 26 00:16:50 2010
@@ -137,6 +137,7 @@ public class AdminObjectRefBuilder exten
 
         List<ResourceEnvRefType> resourceEnvRefsUntyped = convert(specDD.selectChildren(adminOjbectRefQNameSet),
JEE_CONVERTER, ResourceEnvRefType.class, ResourceEnvRefType.type);
         List<String> unresolvedRefs = new ArrayList<String>();
+        Bundle bundle = module.getEarContext().getDeploymentBundle();
         for (ResourceEnvRefType resourceEnvRef : resourceEnvRefsUntyped) {
             String name = getStringValue(resourceEnvRef.getResourceEnvRefName());
             if (lookupJndiContextMap(componentContext, name) != null) {
@@ -145,6 +146,7 @@ public class AdminObjectRefBuilder exten
             }
             addInjections(name, resourceEnvRef.getInjectionTargetArray(), componentContext);
             String type = getStringValue(resourceEnvRef.getResourceEnvRefType());
+            type = inferAndCheckType(module, bundle, resourceEnvRef.getInjectionTargetArray(),
name, type);
             GerResourceEnvRefType gerResourceEnvRef = refMap.remove(name);
 
             Object value = null;
@@ -189,17 +191,7 @@ public class AdminObjectRefBuilder exten
                 linkName = name;
             }
             String type = getStringValue(messageDestinationRef.getMessageDestinationType());
-            if (type == null) {
-                //must have an injection target to determine type EE5.8.1.3
-                InjectionTargetType[] targets = messageDestinationRef.getInjectionTargetArray();
-                if (targets.length == 0) {
-                    throw new DeploymentException("No type for message-destination-ref can
be determined from explicit specification or injection target: " + messageDestinationRef);
-                }
-                type = getStringValue(targets[0].getInjectionTargetClass());
-                if (type == null) {
-                    throw new DeploymentException("No type for message-destination-ref in
injection target: " + targets[0]);
-                }
-            }
+            type = inferAndCheckType(module, bundle, messageDestinationRef.getInjectionTargetArray(),
name, type);
 
             GerMessageDestinationType destination = getMessageDestination(linkName, messageDestinations);
 

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=948266&r1=948265&r2=948266&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 May 26 00:16:50 2010
@@ -130,6 +130,7 @@ public class ResourceRefBuilder extends 
         XmlObject[] gerResourceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_RESOURCE_REF_QNAME_SET);
         Map<String, GerResourceRefType> refMap = mapResourceRefs(gerResourceRefsUntyped);
         List<String> unresolvedRefs = new ArrayList<String>();
+        Bundle bundle = module.getEarContext().getDeploymentBundle();
         for (ResourceRefType resourceRef : resourceRefsUntyped) {
             String name = getStringValue(resourceRef.getResRefName());
             if (lookupJndiContextMap(componentContext, name) != null) {
@@ -138,6 +139,7 @@ public class ResourceRefBuilder extends 
             }
             addInjections(name, resourceRef.getInjectionTargetArray(), componentContext);
             String type = getStringValue(resourceRef.getResType());
+            type = inferAndCheckType(module, bundle, resourceRef.getInjectionTargetArray(),
name, type);
             GerResourceRefType gerResourceRef = refMap.get(name);
             log.debug("trying to resolve " + name + ", type " + type + ", resourceRef " +
gerResourceRef);
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=948266&r1=948265&r2=948266&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Wed May 26 00:16:50 2010
@@ -349,7 +349,7 @@ public abstract class AbstractNamingBuil
         return BASE_NAMING_QNAME;
     }
 
-    protected String InferAndCheckType(Module module, Bundle bundle, InjectionTargetType[]
injectionTargets, String name, String typeName) throws DeploymentException {
+    protected String inferAndCheckType(Module module, Bundle bundle, InjectionTargetType[]
injectionTargets, String name, String typeName) throws DeploymentException {
         Class<?> type = null;
         if (typeName != null) {
             try {

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=948266&r1=948265&r2=948266&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 May 26 00:16:50 2010
@@ -27,8 +27,6 @@ import javax.annotation.Resource;
 import javax.xml.namespace.QName;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
@@ -132,7 +130,7 @@ public class EnvironmentEntryBuilder ext
                 strValue = strValueOverride;
             }
 
-            type = InferAndCheckType(module, bundle, envEntry.getInjectionTargetArray(),
name, type);
+            type = inferAndCheckType(module, bundle, envEntry.getInjectionTargetArray(),
name, type);
 
 
             if (value == null) {



Mime
View raw message