geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r515457 - in /geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf: CXFCatalogUtils.java ejb/EJBWebServiceGBean.java pojo/POJOWebServiceContainerFactoryGBean.java
Date Wed, 07 Mar 2007 04:57:38 GMT
Author: gawor
Date: Tue Mar  6 20:57:37 2007
New Revision: 515457

URL: http://svn.apache.org/viewvc?view=rev&rev=515457
Log:
enable oasis catalog resolution for wsdl and xsd for cxf

Added:
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFCatalogUtils.java
Modified:
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFCatalogUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFCatalogUtils.java?view=auto&rev=515457
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFCatalogUtils.java
(added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFCatalogUtils.java
Tue Mar  6 20:57:37 2007
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.cxf;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.Bus;
+import org.apache.cxf.catalog.OASISCatalogManager;
+import org.apache.xml.resolver.Catalog;
+
+public class CXFCatalogUtils {
+    
+    private static final Log LOG = LogFactory.getLog(CXFCatalogUtils.class);
+        
+    private CXFCatalogUtils() {        
+    }
+    
+    public static void loadOASISCatalog(Bus bus, URL baseURL, String catalogName) {
+        URL catalogURL = null;
+        try {
+            catalogURL = new URL(baseURL, catalogName);
+            LOG.debug("Checking for " + catalogURL + " catalog.");            
+            catalogURL.openStream().close();
+            loadOASISCatalog(bus, catalogURL);            
+        } catch (MalformedURLException e) {
+            LOG.warn("Error constructing catalog URL: " + baseURL + " " + catalogName);
+        } catch (FileNotFoundException e) {
+            LOG.debug("Catalog " + catalogURL + " is not present in the module");
+        } catch (IOException e) {
+            LOG.warn("Failed to load catalog file: " + catalogURL, e);
+        }
+    }
+    
+    private static void loadOASISCatalog(Bus bus, URL catalogURL) {
+        OASISCatalogManager catalog = new OASISCatalogManager();
+        try {
+            catalog.loadCatalog(catalogURL);
+            LOG.debug("Loaded " + catalogURL + " catalog.");
+            bus.setExtension(catalog.getCatalog(), Catalog.class);
+        } catch (IOException e) {
+            LOG.warn("Failed to load catalog file: " + catalogURL, e);
+        }        
+    }
+}

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java?view=diff&rev=515457&r1=515456&r2=515457
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
Tue Mar  6 20:57:37 2007
@@ -22,6 +22,7 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.geronimo.cxf.CXFCatalogUtils;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -64,6 +65,10 @@
         bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
         bus.setExtension(portInfo, PortInfo.class);  
         bus.setExtension(ejbDeploymentContext.getDeploymentInfo(), DeploymentInfo.class);
+        
+        CXFCatalogUtils.loadOASISCatalog(bus, 
+                                         configurationBaseUrl, 
+                                         "META-INF/jax-ws-catalog.xml");
         
         EJBWebServiceContainer container = 
             new EJBWebServiceContainer(bus, configurationBaseUrl, beanClass);

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java?view=diff&rev=515457&r1=515456&r2=515457
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
Tue Mar  6 20:57:37 2007
@@ -28,6 +28,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.geronimo.cxf.CXFCatalogUtils;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -52,12 +53,12 @@
     private final URL configurationBaseUrl;
 
     public POJOWebServiceContainerFactoryGBean(PortInfo portInfo,
-                                              String endpointClassName,
-                                              ClassLoader classLoader,
-                                              Map componentContext,
-                                              Kernel kernel,
-                                              TransactionManager transactionManager,
-                                              URL configurationBaseUrl)
+                                               String endpointClassName,
+                                               ClassLoader classLoader,
+                                               Map componentContext,
+                                               Kernel kernel,
+                                               TransactionManager transactionManager,
+                                               URL configurationBaseUrl)
             throws ClassNotFoundException, 
                    IllegalAccessException,
                    InstantiationException {
@@ -83,7 +84,11 @@
         this.endpointInstance = endpointClass.newInstance();
         
         this.bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
-        this.bus.setExtension(portInfo, PortInfo.class);        
+        this.bus.setExtension(portInfo, PortInfo.class);   
+        
+        CXFCatalogUtils.loadOASISCatalog(this.bus, 
+                                         this.configurationBaseUrl, 
+                                         "WEB-INF/jax-ws-catalog.xml");
     }
 
     public WebServiceContainer getWebServiceContainer() {



Mime
View raw message