geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/naming/src/java/org/apache/geronimo/naming/deployment ENCConfigBuilder.java
Date Tue, 09 Mar 2004 22:49:07 GMT
djencks     2004/03/09 14:49:07

  Modified:    modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        WARConfigBuilder.java
               modules/naming/src/java/org/apache/geronimo/naming/deployment
                        ENCConfigBuilder.java
  Log:
  jndi lookups of admin objects
  
  Revision  Changes    Path
  1.13      +8 -1      incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java
  
  Index: WARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigBuilder.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WARConfigBuilder.java	9 Mar 2004 18:03:52 -0000	1.12
  +++ WARConfigBuilder.java	9 Mar 2004 22:49:07 -0000	1.13
  @@ -297,6 +297,13 @@
           }
           ENCConfigBuilder.addResourceRefs(webApp.getResourceRefArray(), cl, resourceRefMap,
builder);
           // todo resource-env-ref
  +        Map resourceEnvRefMap = new HashMap();
  +        JettyLocalRefType[] jettyResourceEnvRefs = jettyWebApp.getResourceEnvRefArray();
  +        for (int i = 0; i < jettyResourceEnvRefs.length; i++) {
  +            JettyLocalRefType jettyResourceEnvRef = jettyResourceEnvRefs[i];
  +            resourceEnvRefMap.put(jettyResourceEnvRef.getRefName(), new JettyRefAdapter(jettyResourceEnvRef));
  +        }
  +        ENCConfigBuilder.addResourceEnvRefs(webApp.getResourceEnvRefArray(), cl, resourceEnvRefMap,
builder);
           // todo message-destination-ref
           // todo usertransaction
           return builder.getContext();
  
  
  
  1.2       +22 -1     incubator-geronimo/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
  
  Index: ENCConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ENCConfigBuilder.java	9 Mar 2004 18:03:11 -0000	1.1
  +++ ENCConfigBuilder.java	9 Mar 2004 22:49:07 -0000	1.2
  @@ -23,6 +23,7 @@
   
   import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
   import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
  +import org.apache.geronimo.xbeans.j2ee.ResourceEnvRefType;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.naming.java.ComponentContextBuilder;
   
  @@ -70,5 +71,25 @@
               }
           }
   
  +    }
  +
  +    public static void addResourceEnvRefs(ResourceEnvRefType[] resourceEnvRefArray, ClassLoader
cl, Map refAdapterMap, ComponentContextBuilder builder) throws DeploymentException {
  +        for (int i = 0; i < resourceEnvRefArray.length; i++) {
  +            ResourceEnvRefType resourceEnvRef = resourceEnvRefArray[i];
  +            String name = resourceEnvRef.getResourceEnvRefName().getStringValue();
  +            String type = resourceEnvRef.getResourceEnvRefType().getStringValue();
  +            Class iface = null;
  +            try {
  +                iface = cl.loadClass(type);
  +            } catch (ClassNotFoundException e) {
  +                throw new DeploymentException("could not load class " + type, e);
  +            }
  +            RefAdapter refAdapter = (RefAdapter) refAdapterMap.get(name);
  +            try {
  +                builder.addResourceRef(name, iface, refAdapter);
  +            } catch (NamingException e) {
  +                throw new DeploymentException("Invalid env-entry definition for name: "
+ name, e);
  +            }
  +        }
       }
   }
  
  
  

Mime
View raw message