geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1127408 - in /geronimo/server/trunk/plugins: axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/ axis2/geronimo-axis2/src/main/java/org/apache/geronimo...
Date Wed, 25 May 2011 07:18:19 GMT
Author: xuhaihong
Date: Wed May 25 07:18:18 2011
New Revision: 1127408

URL: http://svn.apache.org/viewvc?rev=1127408&view=rev
Log:
1. Use the new unmarshall method to parsing handler configuration files
2. Use Info style serializable objects to hold the handler info, and avoid unwanted marshall/unmarshall

Added:
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainFinder.java
      - copied, changed from r1126467, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/HandlerChainsInfoBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainInfo.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainsInfo.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerInfo.java
Removed:
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/HandlerChainsUtils.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainBuilder.java
Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AbstractWARWebServiceFinder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AdvancedWARWebServiceFinder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java Wed May 25 07:18:18 2011
@@ -21,7 +21,6 @@ import java.net.URI;
 import java.util.Collections;
 import java.util.Map;
 
-import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.axis2.client.Axis2ConfigGBean;
@@ -41,6 +40,7 @@ import org.apache.geronimo.jaxws.builder
 import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceRefBuilder;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -81,17 +81,14 @@ public class Axis2ServiceRefBuilder exte
         serviceQName = builder.getServiceQName();
         Map<Object, EndpointInfo> seiInfoMap = builder.getEndpointInfo();
 
-        String handlerChainsXML = null;
-        try {
-            handlerChainsXML = getHandlerChainAsString(serviceRef.getHandlerChains());
-        } catch (JAXBException e) {
-            // this should not happen
-            log.warn("Failed to serialize handler chains", e);
+        HandlerChainsInfo handlerChainsInfo = null;
+        if(serviceRef.getHandlerChains() != null) {
+            handlerChainsInfo = handlerChainsInfoBuilder.build(serviceRef.getHandlerChains());
         }
 
         String serviceReferenceName = (serviceReferenceType == null) ? null : serviceReferenceType.getName();
 
-        return new Axis2ServiceReference(serviceInterfaceClass.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
+        return new Axis2ServiceReference(serviceInterfaceClass.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsInfo, seiInfoMap);
     }
 
     private void registerConfigGBean(Module module) throws DeploymentException {

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java Wed May 25 07:18:18 2011
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.axis2;
 
-import java.io.ByteArrayInputStream;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.URI;
@@ -56,6 +55,7 @@ import org.apache.axis2.jaxws.addressing
 import org.apache.axis2.jaxws.binding.BindingUtils;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.impl.DescriptionUtils;
+import org.apache.axis2.jaxws.description.xml.handler.FullyQualifiedClassType;
 import org.apache.axis2.jaxws.description.xml.handler.HandlerChainType;
 import org.apache.axis2.jaxws.description.xml.handler.HandlerChainsType;
 import org.apache.axis2.jaxws.description.xml.handler.HandlerType;
@@ -80,6 +80,9 @@ import org.apache.geronimo.jaxws.JNDIRes
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.jaxws.ServerJNDIResolver;
 import org.apache.geronimo.jaxws.annotations.AnnotationException;
+import org.apache.geronimo.jaxws.info.HandlerChainInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
+import org.apache.geronimo.jaxws.info.HandlerInfo;
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.geronimo.webservices.saaj.SAAJUniverse;
 import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
@@ -487,13 +490,9 @@ public abstract class Axis2WebServiceCon
      */
     protected void configureHandlers() throws Exception {
         EndpointDescription desc = AxisServiceGenerator.getEndpointDescription(this.service);
-
-        String xml = this.portInfo.getHandlersAsXML();
-        HandlerChainsType handlerChains = null;
-        if (xml != null) {
-            ByteArrayInputStream in = new ByteArrayInputStream(xml.getBytes("UTF-8"));
-            handlerChains = DescriptionUtils.loadHandlerChains(in, null);
-            desc.setHandlerChain(handlerChains);
+        
+        if(portInfo.getHandlerChainsInfo() != null) {
+            desc.setHandlerChain(toAxis2HandlerChainsType(portInfo.getHandlerChainsInfo()));
         }
 
         if (LOG.isDebugEnabled()) {
@@ -504,7 +503,29 @@ public abstract class Axis2WebServiceCon
 
         DescriptionUtils.registerHandlerHeaders(desc.getAxisService(), this.binding.getHandlerChain());
     }
-
+    
+    private HandlerChainsType toAxis2HandlerChainsType(HandlerChainsInfo handlerChainsInfo) {
+        HandlerChainsType handlerChains = new HandlerChainsType();
+        for (HandlerChainInfo handlerChainInfo : handlerChainsInfo.handleChains) {
+            HandlerChainType handlerChain = new HandlerChainType();
+            handlerChain.setPortNamePattern(handlerChainInfo.portNamePattern);
+            handlerChain.setServiceNamePattern(handlerChainInfo.serviceNamePattern);
+            handlerChain.getProtocolBindings().addAll(handlerChainInfo.protocolBindings);
+            for (HandlerInfo handlerInfo : handlerChainInfo.handlers) {
+                HandlerType handler = new HandlerType();
+                FullyQualifiedClassType classType = new FullyQualifiedClassType();
+                classType.setValue(handlerInfo.handlerClass);
+                handler.setHandlerClass(classType);
+                org.apache.axis2.jaxws.description.xml.handler.String nameType = new org.apache.axis2.jaxws.description.xml.handler.String();
+                nameType.setValue(handlerInfo.handlerName);
+                handler.setHandlerName(nameType);
+                handlerChain.getHandler().add(handler);
+            }
+            handlerChains.getHandlerChain().add(handlerChain);
+        }
+        return handlerChains;
+    }
+    
     private void logHandlers(HandlerChainsType handlerChains) {
         if (handlerChains == null || handlerChains.getHandlerChain() == null || handlerChains.getHandlerChain().isEmpty()) {
             LOG.debug("No handlers");

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java Wed May 25 07:18:18 2011
@@ -30,14 +30,13 @@ import org.apache.axis2.jaxws.context.We
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
 import org.apache.axis2.jaxws.spi.ServiceDelegate;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.jaxws.HandlerChainsUtils;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JNDIResolver;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.jaxws.client.JAXWSServiceReference;
 import org.apache.geronimo.jaxws.client.PortMethodInterceptor;
 import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver;
-import org.apache.openejb.jee.HandlerChains;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,9 +52,9 @@ public class Axis2ServiceReference exten
                                  URI wsdlURI,
                                  QName serviceQName,
                                  AbstractName name,
-                                 String handlerChainsXML,
+                                 HandlerChainsInfo handlerChainsInfo,
                                  Map<Object, EndpointInfo> seiInfoMap) {
-        super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
+        super(handlerChainsInfo, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
     }
 
     @Override
@@ -78,21 +77,11 @@ public class Axis2ServiceReference exten
         }
     }
 
-    protected HandlerChains getHandlerChains() {
-        HandlerChains types = null;
-        try {
-            types = HandlerChainsUtils.toHandlerChains(this.handlerChainsXML, HandlerChains.class);
-        } catch (Exception e) {
-            LOG.warn("Failed to deserialize handler chains", e);
-        }
-        return types;
-    }
-
     protected HandlerResolver getHandlerResolver(Class serviceClass) {
         JAXWSAnnotationProcessor annotationProcessor =
                 new JAXWSAnnotationProcessor(new JNDIResolver(), new WebServiceContextImpl());
         GeronimoHandlerResolver handlerResolver =
-                new GeronimoHandlerResolver(bundle, serviceClass, getHandlerChains(), annotationProcessor);
+                new GeronimoHandlerResolver(bundle, serviceClass, handlerChainsInfo, annotationProcessor);
         return handlerResolver;
     }
 

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java Wed May 25 07:18:18 2011
@@ -20,7 +20,6 @@ package org.apache.geronimo.cxf.builder;
 import java.net.URI;
 import java.util.Map;
 
-import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -33,6 +32,7 @@ import org.apache.geronimo.jaxws.builder
 import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceRefBuilder;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
 import org.apache.geronimo.naming.reference.JndiReference;
@@ -74,17 +74,12 @@ public class CXFServiceRefBuilder extend
         serviceQName = builder.getServiceQName();
         Map<Object, EndpointInfo> seiInfoMap = builder.getEndpointInfo();
 
-        String handlerChainsXML = null;
-        try {
-            handlerChainsXML = getHandlerChainAsString(serviceRef.getHandlerChains());
-        } catch (JAXBException e) {
-            // this should not happen
-            LOG.warn("Failed to serialize handler chains", e);
+        HandlerChainsInfo handlerChainsInfo = null;
+        if(serviceRef.getHandlerChains() != null) {
+            handlerChainsInfo = handlerChainsInfoBuilder.build(serviceRef.getHandlerChains());
         }
-
         String serviceReferenceName = (serviceReference == null) ? null : serviceReference.getName();
-
-        return new CXFServiceReference(serviceInterface.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
+        return new CXFServiceReference(serviceInterface.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsInfo, seiInfoMap);
     }
 
     public static final GBeanInfo GBEAN_INFO;

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java Wed May 25 07:18:18 2011
@@ -39,12 +39,10 @@ import org.apache.cxf.jaxws.support.JaxW
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.geronimo.jaxws.HandlerChainsUtils;
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.jaxws.annotations.AnnotationException;
 import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
 import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver;
-import org.apache.openejb.jee.HandlerChains;
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.osgi.framework.Bundle;
 
@@ -195,16 +193,11 @@ public abstract class CXFEndpoint {
      * Set appropriate handlers for the port/service/bindings.
      */
     protected void initHandlers() throws Exception {
-        HandlerChains handlerChains =
-            HandlerChainsUtils.toHandlerChains(this.portInfo.getHandlersAsXML(), HandlerChains.class);
-        GeronimoHandlerResolver handlerResolver = new GeronimoHandlerResolver(bundle, getImplementorClass(), handlerChains, null);
-
+        GeronimoHandlerResolver handlerResolver = new GeronimoHandlerResolver(bundle, getImplementorClass(), portInfo.getHandlerChainsInfo(), null);
         PortInfoImpl portInfo = new PortInfoImpl(implInfo.getBindingType(),
                                                  serviceFactory.getEndpointName(),
                                                  service.getName());
-
         List<Handler> chain = handlerResolver.getHandlerChain(portInfo);
-
         getBinding().setHandlerChain(chain);
     }
 

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java Wed May 25 07:18:18 2011
@@ -31,14 +31,13 @@ import org.apache.cxf.jaxws.context.WebS
 import org.apache.geronimo.cxf.CXFCatalogUtils;
 import org.apache.geronimo.cxf.CXFWebServiceContainer;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.jaxws.HandlerChainsUtils;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JNDIResolver;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.jaxws.client.JAXWSServiceReference;
 import org.apache.geronimo.jaxws.client.PortMethodInterceptor;
 import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver;
-import org.apache.openejb.jee.HandlerChains;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,9 +50,9 @@ public class CXFServiceReference extends
                                URI wsdlURI,
                                QName serviceQName,
                                AbstractName name,
-                               String handlerChainsXML,
+                               HandlerChainsInfo handlerChainsInfo,
                                Map<Object, EndpointInfo> seiInfoMap) {
-        super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
+        super(handlerChainsInfo, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
     }
 
     @Override
@@ -77,21 +76,11 @@ public class CXFServiceReference extends
         }
     }
 
-    protected HandlerChains getHandlerChains() {
-        HandlerChains types = null;
-        try {
-            types = HandlerChainsUtils.toHandlerChains(this.handlerChainsXML, HandlerChains.class);
-        } catch (Exception e) {
-            LOG.warn("Failed to deserialize handler chains", e);
-        }
-        return types;
-    }
-
     protected HandlerResolver getHandlerResolver(Class serviceClass) {
         JAXWSAnnotationProcessor annotationProcessor =
                 new JAXWSAnnotationProcessor(new JNDIResolver(), new WebServiceContextImpl());
         GeronimoHandlerResolver handlerResolver =
-                new GeronimoHandlerResolver(bundle, serviceClass, getHandlerChains(), annotationProcessor);
+                new GeronimoHandlerResolver(bundle, serviceClass, handlerChainsInfo, annotationProcessor);
         return handlerResolver;
     }
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java Wed May 25 07:18:18 2011
@@ -90,8 +90,9 @@ public final class HandlerChainAnnotatio
      * @throws DeploymentException if parsing or validation error
      */
     private static void processHandlerChain(JndiConsumer annotatedApp, AbstractFinder classFinder) throws DeploymentException {
-        log.debug("processHandlerChain(): Entry: AnnotatedApp: " + annotatedApp.toString());
-
+        if (log.isDebugEnabled()) {
+            log.debug("processHandlerChain(): Entry: AnnotatedApp: " + annotatedApp.toString());
+        }
         List<Method> methodswithHandlerChain = classFinder.findAnnotatedMethods(HandlerChain.class);
         List<Field> fieldswithHandlerChain = classFinder.findAnnotatedFields(HandlerChain.class);
 
@@ -114,8 +115,9 @@ public final class HandlerChainAnnotatio
 
         // Validate deployment descriptor to ensure it's still okay
 //        validateDD(annotatedApp);
-
-        log.debug("processHandlerChain(): Exit: AnnotatedApp: " + annotatedApp.toString());
+        if (log.isDebugEnabled()) {
+            log.debug("processHandlerChain(): Exit: AnnotatedApp: " + annotatedApp.toString());
+        }
     }
 
 
@@ -142,12 +144,13 @@ public final class HandlerChainAnnotatio
      * @param field      Field name with the @HandlerChain annotation
      */
     private static void addHandlerChain(JndiConsumer annotatedApp, final HandlerChain annotation, Class cls, Method method, Field field) {
-        log.debug("addHandlerChain( [annotatedApp] " + annotatedApp.toString() + "," + '\n' +
-                "[annotation] " + annotation.toString() + "," + '\n' +
-                "[cls] " + (cls != null ? cls.getName() : null) + "," + '\n' +
-                "[method] " + (method != null ? method.getName() : null) + "," + '\n' +
-                "[field] " + (field != null ? field.getName() : null) + " ): Entry");
-
+        if(log.isDebugEnabled()) {
+            log.debug("addHandlerChain( [annotatedApp] " + annotatedApp.toString() + "," + '\n' +
+                    "[annotation] " + annotation.toString() + "," + '\n' +
+                    "[cls] " + (cls != null ? cls.getName() : null) + "," + '\n' +
+                    "[method] " + (method != null ? method.getName() : null) + "," + '\n' +
+                    "[field] " + (field != null ? field.getName() : null) + " ): Entry");
+        }
         //------------------------------------------------------------------------------------------
         // HandlerChain members:
         // -- name: Deprecated -- must be empty string
@@ -155,8 +158,9 @@ public final class HandlerChainAnnotatio
         //          from the class file. Cannot be emptry string.
         //------------------------------------------------------------------------------------------
         String handlerChainFile = annotation.file();
-        log.debug("addHandlerChain(): handlerChainFile: " + handlerChainFile);
-
+        if (log.isDebugEnabled()) {
+            log.debug("addHandlerChain(): handlerChainFile: " + handlerChainFile);
+        }
         // Determine ServiceRef name
         String serviceRefName;
         WebServiceRef webServiceRef = null;
@@ -176,8 +180,10 @@ public final class HandlerChainAnnotatio
         if ( serviceRefName.equals("") ) {
             serviceRefName = getInjectionJavaType(method, field);
         }
-        log.debug("addHandlerChain().serviceRefName : " + serviceRefName);
 
+        if (log.isDebugEnabled()) {
+            log.debug("addHandlerChain().serviceRefName : " + serviceRefName);
+        }
         if (!serviceRefName.equals("") && !handlerChainFile.equals("")) {
             try {
                 // Locate the handler chain XML file
@@ -187,8 +193,9 @@ public final class HandlerChainAnnotatio
                     url = new URL(handlerChainFile);
                 }
                 catch (MalformedURLException mfe) {
-                    log.debug("addHandlerChain().MalformedURLException" );
-
+                    if (log.isDebugEnabled()) {
+                        log.debug("addHandlerChain().MalformedURLException", mfe);
+                    }
                     // Not URL format -- see if it's relative to the annotated class
                     if (cls != null) {
                         url = getURL(cls.getClass(), handlerChainFile);
@@ -213,27 +220,38 @@ public final class HandlerChainAnnotatio
                         }
                     }
                     if (exists) {
-                        log.debug("HandlerChainAnnotationHelper: <service-ref> entry found: " + serviceRefName);
+                        if (log.isDebugEnabled()) {
+                            log.debug("HandlerChainAnnotationHelper: <service-ref> entry found: " + serviceRefName);
+                        }
                     }
                     else {
-                        log.debug("HandlerChainAnnotationHelper: <service-ref> entry NOT found: " + serviceRefName);
+                        if (log.isDebugEnabled()) {
+                            log.debug("HandlerChainAnnotationHelper: <service-ref> entry NOT found: " + serviceRefName);
+                        }
                     }
                 }
                 else {
-                    log.debug("HandlerChainAnnotationHelper: Handler chain file NOT found: " + handlerChainFile );
+                    if (log.isDebugEnabled()) {
+                        log.debug("HandlerChainAnnotationHelper: Handler chain file NOT found: " + handlerChainFile);
+                    }
                 }
             }
             catch ( Exception anyException ) {
-                log.debug("HandlerChainAnnotationHelper: Exception caught while processing <handler-chain>");
+                if(log.isDebugEnabled()) {
+                    log.debug("HandlerChainAnnotationHelper: Exception caught while processing <handler-chain>", anyException);
+                }
             }
         }
-        log.debug("addHandlerChain(): Exit");
+        if (log.isDebugEnabled()) {
+            log.debug("addHandlerChain(): Exit");
+        }
     }
 
 
     private static URL getURL(Class clazz, String file) {
-        log.debug("getURL( " + clazz.getName() + ", " + file + " ): Entry");
-
+        if (log.isDebugEnabled()) {
+            log.debug("getURL( " + clazz.getName() + ", " + file + " ): Entry");
+        }
         URL url = clazz.getResource(file);
         if (url == null) {
             url = Thread.currentThread().getContextClassLoader().getResource(file);
@@ -242,14 +260,17 @@ public final class HandlerChainAnnotatio
             String loc= clazz.getPackage().getName().replace('.', '/') + "/" + file;
             url = Thread.currentThread().getContextClassLoader().getResource(loc);
         }
-
-        log.debug("getURL(): Exit: url: " + (url != null ? url.toString() : null) );
+        if (log.isDebugEnabled()) {
+            log.debug("getURL(): Exit: url: " + (url != null ? url.toString() : null));
+        }
         return url;
     }
-    
+
     public static void insertHandlers(ServiceRef serviceRef, HandlerChain annotation, Class clazz) {
         String handlerChainFile = annotation.file();
-        log.debug("handlerChainFile: " + handlerChainFile);
+        if (log.isDebugEnabled()) {
+            log.debug("handlerChainFile: " + handlerChainFile);
+        }
         if (handlerChainFile == null || handlerChainFile.trim().length() == 0) {
             return;
         }
@@ -265,16 +286,18 @@ public final class HandlerChainAnnotatio
             try {
                 insertHandlers(serviceRef, url);
             } catch (Exception e) {
-                log.debug("Error while processing <handler-chain>", e);
+                if (log.isDebugEnabled()) {
+                    log.debug("Error while processing <handler-chain>", e);
+                }
             }
         }
     }
-    
+
     public static void insertHandlers(ServiceRef serviceRef, URL url) throws Exception {
         HandlerChains handlerChains;
         InputStream in = url.openStream();
         try {
-            handlerChains = (HandlerChains) JaxbJavaee.unmarshalJavaee(HandlerChains.class, in);
+            handlerChains = (HandlerChains) JaxbJavaee.unmarshalHandlerChains(HandlerChains.class, in);
          } finally {
             in.close();
         }

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AbstractWARWebServiceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AbstractWARWebServiceFinder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AbstractWARWebServiceFinder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AbstractWARWebServiceFinder.java Wed May 25 07:18:18 2011
@@ -40,6 +40,7 @@ import org.apache.geronimo.deployment.De
 import org.apache.geronimo.deployment.DeployableJarFile;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.jaxws.handler.AnnotationHandlerChainFinder;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.util.FileUtils;
 import org.apache.geronimo.kernel.util.JarUtils;
@@ -61,6 +62,8 @@ public abstract class AbstractWARWebServ
 
     private static final Logger logger = LoggerFactory.getLogger(AbstractWARWebServiceFinder.class);
 
+    protected AnnotationHandlerChainFinder annotationHandlerChainFinder = new AnnotationHandlerChainFinder();
+
     protected Set<String> getEJBWebServiceClassNames(Module module) {
         if (module.getModules().size() == 0) {
             return Collections.<String> emptySet();

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AdvancedWARWebServiceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AdvancedWARWebServiceFinder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AdvancedWARWebServiceFinder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/AdvancedWARWebServiceFinder.java Wed May 25 07:18:18 2011
@@ -18,20 +18,15 @@
 package org.apache.geronimo.jaxws.builder;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.PortInfo;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.openejb.jee.Servlet;
 import org.apache.openejb.jee.ServletMapping;
 import org.apache.openejb.jee.WebApp;
@@ -116,12 +111,13 @@ public class AdvancedWARWebServiceFinder
                     } else {
                         // weird, there was no servlet entry for this class but
                         // servlet-mapping exists
-                        LOG.warn("Found <servlet-mapping> but corresponding <servlet> was not defined");
+                        LOG.warn("Found <servlet-mapping> {} but corresponding <servlet> {}  was not defined", location, service.getName());
                     }
 
                     // map service
                     PortInfo portInfo = new PortInfo();
                     portInfo.setLocation(contextRoot + location);
+                    portInfo.setHandlerChainsInfo(annotationHandlerChainFinder.buildHandlerChainFromClass(service));
                     servletNamePortInfoMap.put(service.getName(), portInfo);
                 } else {
                     // found at least one mapped <servlet/> entry
@@ -161,6 +157,7 @@ public class AdvancedWARWebServiceFinder
                 if (JAXWSUtils.isWebService(servletClass)) {
                     String servletName = servletType.getServletName().trim();
                     portInfo = createPortInfo(servletName, portLocations);
+                    portInfo.setHandlerChainsInfo(annotationHandlerChainFinder.buildHandlerChainFromClass(servletClass));
                 }
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("Failed to load servlet class " + servletClassName, e);

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java Wed May 25 07:18:18 2011
@@ -44,12 +44,12 @@ import org.apache.geronimo.jaxws.annotat
 import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
 import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
 import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
+import org.apache.geronimo.jaxws.handler.HandlerChainsInfoBuilder;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.util.IOUtils;
 import org.apache.openejb.jee.Addressing;
-import org.apache.openejb.jee.HandlerChains;
 import org.apache.openejb.jee.JaxbJavaee;
 import org.apache.openejb.jee.PortComponent;
 import org.apache.openejb.jee.ServiceImplBean;
@@ -60,8 +60,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public abstract class JAXWSServiceBuilder implements WebServiceBuilder {
+
     private static final Logger LOG = LoggerFactory.getLogger(JAXWSServiceBuilder.class);
 
+    private HandlerChainsInfoBuilder handlerChainsInfoBuilder = new HandlerChainsInfoBuilder();
+
     protected final Environment defaultEnvironment;
     protected WebServiceFinder webServiceFinder;
 
@@ -132,8 +135,7 @@ public abstract class JAXWSServiceBuilde
                         }
 
                         if (port.getHandlerChains() != null) {
-                            String handlerChains = JaxbJavaee.marshal(HandlerChains.class, port.getHandlerChains());
-                            portInfo.setHandlersAsXML(handlerChains);
+                            portInfo.setHandlerChainsInfo(handlerChainsInfoBuilder.build(port.getHandlerChains()));
                         }
 
                         if (port.getWsdlPort() != null) {

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java Wed May 25 07:18:18 2011
@@ -22,13 +22,13 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 import javax.xml.ws.handler.Handler;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.jaxws.handler.HandlerChainsInfoBuilder;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
@@ -36,7 +36,6 @@ import org.apache.geronimo.xbeans.geroni
 import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
 import org.apache.openejb.jee.HandlerChain;
 import org.apache.openejb.jee.HandlerChains;
-import org.apache.openejb.jee.JaxbJavaee;
 import org.apache.openejb.jee.JndiConsumer;
 import org.apache.openejb.jee.PortComponentRef;
 import org.apache.openejb.jee.ServiceRef;
@@ -57,6 +56,8 @@ public abstract class JAXWSServiceRefBui
 
     private final QNameSet serviceRefQNameSet;
 
+    protected HandlerChainsInfoBuilder handlerChainsInfoBuilder = new HandlerChainsInfoBuilder();
+
     public JAXWSServiceRefBuilder(Environment defaultEnvironment, String[] eeNamespaces) {
         super(defaultEnvironment);
         serviceRefQNameSet = buildQNameSet(eeNamespaces, "service-ref");
@@ -179,11 +180,4 @@ public abstract class JAXWSServiceRefBui
     public QNameSet getPlanQNameSet() {
         return GER_SERVICE_REF_QNAME_SET;
     }
-
-    public static String getHandlerChainAsString(HandlerChains handlerChains) throws JAXBException {
-        if (handlerChains != null) {
-            return JaxbJavaee.marshal(HandlerChains.class, handlerChains);
-        }
-        return null;
-    }
 }

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/pom.xml Wed May 25 07:18:18 2011
@@ -110,7 +110,7 @@
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.xmlbeans</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-kernel</artifactId>
@@ -118,7 +118,6 @@
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
-
     </dependencies>
 
 </project>

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java Wed May 25 07:18:18 2011
@@ -27,6 +27,7 @@ import javax.xml.namespace.QName;
 import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
 import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
 import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 
 public class PortInfo implements Serializable {
 
@@ -40,7 +41,7 @@ public class PortInfo implements Seriali
 
     private String servletLink;
 
-    private String handlersAsXML;
+    private HandlerChainsInfo handlerChainsInfo;
 
     private String binding;
 
@@ -104,33 +105,6 @@ public class PortInfo implements Seriali
         return binding;
     }
 
-    /*
-     * This is a bit tricky here since JAXB generated classes are not serializable,
-     * so serialize the handler chain to XML and pass it as a String.
-     */
-
-    public void setHandlers(Class type, Object handlerChain) throws Exception {
-        if (handlerChain == null) {
-            return;
-        }
-
-        JAXBContext ctx = JAXBContext.newInstance(type);
-        Marshaller m = ctx.createMarshaller();
-        StringWriter writer = new StringWriter();
-        /*
-         * Since HandlerChainsType is a type, have to wrap it into some element
-         */
-        JAXBElement element =
-            new JAXBElement(HandlerChainsUtils.HANDLER_CHAINS_QNAME, type, handlerChain);
-        m.marshal(element, writer);
-
-        this.handlersAsXML = writer.toString();
-    }
-
-    public <T>T getHandlers(Class<T> type) throws Exception {
-        return HandlerChainsUtils.toHandlerChains(this.handlersAsXML, type);
-    }
-
     public QName getWsdlPort() {
         return wsdlPort;
     }
@@ -179,18 +153,18 @@ public class PortInfo implements Seriali
         this.respectBindingFeatureInfo = respectBindingFeatureInfo;
     }
 
-    public String getHandlersAsXML() {
-        return handlersAsXML;
+    public HandlerChainsInfo getHandlerChainsInfo() {
+        return handlerChainsInfo;
     }
 
-    public void setHandlersAsXML(String handlersAsXML) {
-        this.handlersAsXML = handlersAsXML;
+    public void setHandlerChainsInfo(HandlerChainsInfo handlerChainsInfo) {
+        this.handlerChainsInfo = handlerChainsInfo;
     }
 
     @Override
     public String toString() {
         return "PortInfo [serviceName=" + serviceName + ", portName=" + portName + ", seiInterfaceName=" + seiInterfaceName + ", wsdlFile=" + wsdlFile + ", servletLink=" + servletLink
-                + ", handlersAsXML=" + handlersAsXML + ", binding=" + binding + ", wsdlPort=" + wsdlPort + ", wsdlService=" + wsdlService + ", location=" + location + ", mtomFeatureInfo="
+                +  ", binding=" + binding + ", wsdlPort=" + wsdlPort + ", wsdlService=" + wsdlService + ", location=" + location + ", mtomFeatureInfo="
                 + mtomFeatureInfo + ", addressingFeatureInfo=" + addressingFeatureInfo + ", respectBindingFeatureInfo=" + respectBindingFeatureInfo + "]";
     }
 

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java Wed May 25 07:18:18 2011
@@ -40,6 +40,7 @@ import net.sf.cglib.reflect.FastConstruc
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.apache.geronimo.naming.reference.BundleAwareReference;
 import org.apache.geronimo.naming.reference.SimpleReference;
 import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
@@ -59,7 +60,7 @@ public abstract class JAXWSServiceRefere
     protected AbstractName moduleName;
     protected URI wsdlURI;
     protected QName serviceQName;
-    protected String handlerChainsXML;
+    protected HandlerChainsInfo handlerChainsInfo;
     protected Map<Object, EndpointInfo> seiInfoMap;
     protected String referenceClassName;
 
@@ -68,8 +69,8 @@ public abstract class JAXWSServiceRefere
     protected FastConstructor serviceConstructor;
 
 
-    public JAXWSServiceReference(String handlerChainsXML, Map<Object, EndpointInfo> seiInfoMap, AbstractName name, QName serviceQName, URI wsdlURI, String referenceClassName, String serviceClassName) {
-        this.handlerChainsXML = handlerChainsXML;
+    public JAXWSServiceReference(HandlerChainsInfo handlerChainsInfo, Map<Object, EndpointInfo> seiInfoMap, AbstractName name, QName serviceQName, URI wsdlURI, String referenceClassName, String serviceClassName) {
+        this.handlerChainsInfo = handlerChainsInfo;
         this.seiInfoMap = seiInfoMap;
         this.moduleName = name;
         this.serviceQName = serviceQName;

Copied: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainFinder.java (from r1126467, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainFinder.java?p2=geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainFinder.java&p1=geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainBuilder.java&r1=1126467&r2=1127408&rev=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/AnnotationHandlerChainFinder.java Wed May 25 07:18:18 2011
@@ -19,15 +19,13 @@ package org.apache.geronimo.jaxws.handle
 
 import java.io.InputStream;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
 
 import javax.jws.HandlerChain;
 import javax.jws.WebService;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.LogicalHandler;
 
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
+import org.apache.geronimo.kernel.util.IOUtils;
 import org.apache.openejb.jee.HandlerChains;
 import org.apache.openejb.jee.JaxbJavaee;
 import org.slf4j.Logger;
@@ -36,60 +34,60 @@ import org.slf4j.LoggerFactory;
 /**
  * @version $Rev$ $Date$
  */
-public class AnnotationHandlerChainBuilder
+public class AnnotationHandlerChainFinder
 {
-    private static final Logger log = LoggerFactory.getLogger(AnnotationHandlerChainBuilder.class);
+    private static final Logger log = LoggerFactory.getLogger(AnnotationHandlerChainFinder.class);
 
-    public AnnotationHandlerChainBuilder() {
-    }
+    private HandlerChainsInfoBuilder handlerChainsInfoBuilder = new HandlerChainsInfoBuilder();
 
     /**
      * @param clz
      * @param existingHandlers
      * @return
      */
-    public List<Handler> buildHandlerChainFromClass(Class<?> clz, List<Handler> existingHandlers) {
-        log.debug("building handler chain");
+    public HandlerChainsInfo buildHandlerChainFromClass(Class<?> clz, HandlerChainsInfo existingHandlerChainsInfo) {
+        if (log.isDebugEnabled()) {
+            log.debug("building handler chain on class " + clz.getName());
+        }
+        HandlerChainsInfo handlerChainsInfo = null;
         HandlerChainAnnotation hcAnn = findHandlerChainAnnotation(clz, true);
-        List<Handler> chain = null;
         if (hcAnn == null) {
-            log.debug("no HandlerChain annotation on " + clz);
-            chain = new ArrayList<Handler>();
+            if (log.isDebugEnabled()) {
+                log.debug("no HandlerChain annotation on " + clz);
+            }
+            handlerChainsInfo = new HandlerChainsInfo();
         } else {
             hcAnn.validate();
 
             try {
                 URL handlerFileURL = clz.getResource(hcAnn.getFileName());
-                InputStream in = handlerFileURL.openStream();
                 HandlerChains handlerChainsType;
+                InputStream in = null;
                 try {
-                    handlerChainsType = (HandlerChains) JaxbJavaee.unmarshalJavaee(HandlerChains.class, in);
+                    in = handlerFileURL.openStream();
+                    handlerChainsType = (HandlerChains) JaxbJavaee.unmarshalHandlerChains(HandlerChains.class, in);
                 } finally {
-                    in.close();
+                    IOUtils.close(in);
                 }
 
                 if (null == handlerChainsType || handlerChainsType.getHandlerChain().isEmpty()) {
-                    throw new WebServiceException("Chain not specified");
+                    throw new WebServiceException("Chain not specified for class " + clz.getName());
                 }
 
-                chain = new ArrayList<Handler>();
-                for (org.apache.openejb.jee.HandlerChain hc : handlerChainsType.getHandlerChain()) {
-                    chain.addAll(buildHandlerChain(hc, clz.getClassLoader()));
-                }
+                handlerChainsInfo = handlerChainsInfoBuilder.build(handlerChainsType);
 
             } catch (Exception e) {
                 throw new WebServiceException("Chain not specified", e);
             }
         }
 
-        assert chain != null;
-        if (existingHandlers != null) {
-            chain.addAll(existingHandlers);
+        if (existingHandlerChainsInfo != null) {
+            handlerChainsInfo.handleChains.addAll(existingHandlerChainsInfo.handleChains);
         }
-        return sortHandlers(chain);
+        return handlerChainsInfo;
     }
 
-    public List<Handler> buildHandlerChainFromClass(Class<?> clz) {
+    public HandlerChainsInfo buildHandlerChainFromClass(Class<?> clz) {
         return buildHandlerChainFromClass(clz, null);
     }
 
@@ -140,56 +138,6 @@ public class AnnotationHandlerChainBuild
         return hcAnn;
     }
 
-    protected List<Handler> buildHandlerChain(org.apache.openejb.jee.HandlerChain hc, ClassLoader classLoader) {
-        List<Handler> handlerChain = new ArrayList<Handler>();
-        for (org.apache.openejb.jee.Handler ht : hc.getHandler()) {
-            try {
-                log.debug("loading handler :" + trimString(ht.getHandlerName()));
-
-                Class<? extends Handler> handlerClass = Class.forName(
-                        trimString(ht.getHandlerClass()), true, classLoader)
-                        .asSubclass(Handler.class);
-
-                Handler handler = handlerClass.newInstance();
-                log.debug("adding handler to chain: " + handler);
-                handlerChain.add(handler);
-            } catch (Exception e) {
-                throw new WebServiceException("Failed to instantiate handler", e);
-            }
-        }
-        return handlerChain;
-    }
-
-    private String trimString(String str) {
-        return str != null ? str.trim() : null;
-    }
-
-    /**
-     * sorts the handlers into correct order. All of the logical handlers first
-     * followed by the protocol handlers
-     *
-     * @param handlers
-     * @return sorted list of handlers
-     */
-    public List<Handler> sortHandlers(List<Handler> handlers) {
-
-        List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
-        List<Handler> protocolHandlers = new ArrayList<Handler>();
-
-        for (Handler handler : handlers) {
-            if (handler instanceof LogicalHandler) {
-                logicalHandlers.add((LogicalHandler) handler);
-            } else {
-                protocolHandlers.add(handler);
-            }
-        }
-
-        List<Handler> sortedHandlers = new ArrayList<Handler>();
-        sortedHandlers.addAll(logicalHandlers);
-        sortedHandlers.addAll(protocolHandlers);
-        return sortedHandlers;
-    }
-
     private static class HandlerChainAnnotation {
         private final Class<?> declaringClass;
         private final HandlerChain ann;
@@ -208,7 +156,7 @@ public class AnnotationHandlerChainBuild
         }
 
         public void validate() {
-            if (null == ann.file() || "".equals(ann.file())) {
+            if (null == ann.file() || ann.file().isEmpty()) {
                 throw new WebServiceException("@HandlerChain annotation does not contain a file name or url.");
             }
         }

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerChainBuilder.java Wed May 25 07:18:18 2011
@@ -17,24 +17,32 @@
 
 package org.apache.geronimo.jaxws.handler;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
 import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
 import javax.xml.ws.handler.PortInfo;
+
 import org.apache.geronimo.jaxws.JAXWSUtils;
-import org.apache.openejb.jee.HandlerChain;
+import org.apache.geronimo.jaxws.info.HandlerChainInfo;
+import org.apache.geronimo.jaxws.info.HandlerInfo;
 import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
 import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
-public class GeronimoHandlerChainBuilder extends AnnotationHandlerChainBuilder {
+public class GeronimoHandlerChainBuilder {
 
+    private static final Logger logger = LoggerFactory.getLogger(GeronimoHandlerChainBuilder.class);
     private Bundle bundle = null;
     private PortInfo portInfo;
 
@@ -48,39 +56,61 @@ public class GeronimoHandlerChainBuilder
         return bundle;
     }
 
-    protected List<Handler> buildHandlerChain(HandlerChain hc,
+    protected List<Handler> buildHandlerChain(HandlerChainInfo hc,
                                               Bundle bundle) {
         if (matchServiceName(portInfo, hc)
                 && matchPortName(portInfo, hc)
                 && matchBinding(portInfo, hc)) {
-            return super.buildHandlerChain(hc, new BundleClassLoader(bundle));
+            return buildHandlerChain(hc, new BundleClassLoader(bundle));
         } else {
             return Collections.emptyList();
         }
     }
 
-    private boolean matchServiceName(PortInfo info, HandlerChain hc) {
-        if (hc.getServiceNamePattern() != null) {
+    protected List<Handler> buildHandlerChain(HandlerChainInfo handlerChainInfo, ClassLoader classLoader) {
+        List<Handler> handlerChain = new ArrayList<Handler>(handlerChainInfo.handlers.size());
+        for (HandlerInfo handlerInfo : handlerChainInfo.handlers) {
+            try {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("loading handler :" + trimString(handlerInfo.handlerName));
+                }
+                Class<? extends Handler> handlerClass = Class.forName(
+                        trimString(handlerInfo.handlerClass), true, classLoader)
+                        .asSubclass(Handler.class);
+                Handler handler = handlerClass.newInstance();
+                if (logger.isDebugEnabled()) {
+                    logger.debug("adding handler to chain: " + handler);
+                }
+                handlerChain.add(handler);
+            } catch (Exception e) {
+                throw new WebServiceException("Failed to instantiate handler", e);
+            }
+        }
+        return handlerChain;
+    }
+    
+    private boolean matchServiceName(PortInfo info, HandlerChainInfo hc) {
+        if (hc.serviceNamePattern != null) {
             QName serviceName = (info == null) ? null : info.getServiceName();
-            return match(serviceName, hc.getServiceNamePattern());
+            return match(serviceName, hc.serviceNamePattern);
         } else {
             // handler matches since no service-name-pattern
             return true;
         }
     }
 
-    private boolean matchPortName(PortInfo info, HandlerChain hc) {
-        if (hc.getPortNamePattern() != null) {
+    private boolean matchPortName(PortInfo info, HandlerChainInfo hc) {
+        if (hc.portNamePattern != null) {
             QName portName = (info == null) ? null : info.getPortName();
-            return match(portName, hc.getPortNamePattern());
+            return match(portName, hc.portNamePattern);
         } else {
             // handler maches no port-name-pattern
             return true;
         }
     }
 
-    private boolean matchBinding(PortInfo info, HandlerChain hc) {
-        return match((info == null ? null : info.getBindingID()), hc.getProtocolBindings());
+    private boolean matchBinding(PortInfo info, HandlerChainInfo hc) {
+        return match((info == null ? null : info.getBindingID()), hc.protocolBindings);
     }
 
     private boolean match(String binding, List<String> bindings) {
@@ -102,13 +132,43 @@ public class GeronimoHandlerChainBuilder
         }
     }
 
-    public List<Handler> buildHandlerChainFromConfiguration(HandlerChain hc) {
-        if (null == hc) {
+    public List<Handler> buildHandlerChainFromConfiguration(HandlerChainInfo handlerChainInfo) {
+        if (handlerChainInfo == null) {
             return null;
         }
-        return sortHandlers(buildHandlerChain(hc, getHandlerBundle()));
+        return sortHandlers(buildHandlerChain(handlerChainInfo, getHandlerBundle()));
+    }
+
+    private String trimString(String str) {
+        return str != null ? str.trim() : null;
     }
 
+    /**
+     * sorts the handlers into correct order. All of the logical handlers first
+     * followed by the protocol handlers
+     *
+     * @param handlers
+     * @return sorted list of handlers
+     */
+    public List<Handler> sortHandlers(List<Handler> handlers) {
+
+        List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
+        List<Handler> protocolHandlers = new ArrayList<Handler>();
+
+        for (Handler handler : handlers) {
+            if (handler instanceof LogicalHandler) {
+                logicalHandlers.add((LogicalHandler) handler);
+            } else {
+                protocolHandlers.add(handler);
+            }
+        }
+
+        List<Handler> sortedHandlers = new ArrayList<Handler>();
+        sortedHandlers.addAll(logicalHandlers);
+        sortedHandlers.addAll(protocolHandlers);
+        return sortedHandlers;
+    }
+    
     /*
      * Performs basic localName matching, namespaces are not checked!
      */

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolver.java Wed May 25 07:18:18 2011
@@ -18,6 +18,7 @@
 package org.apache.geronimo.jaxws.handler;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import javax.xml.ws.WebServiceException;
@@ -26,8 +27,8 @@ import javax.xml.ws.handler.HandlerResol
 
 import org.apache.geronimo.jaxws.annotations.AnnotationException;
 import org.apache.geronimo.jaxws.annotations.AnnotationProcessor;
-import org.apache.openejb.jee.HandlerChain;
-import org.apache.openejb.jee.HandlerChains;
+import org.apache.geronimo.jaxws.info.HandlerChainInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.osgi.framework.Bundle;
 
 /**
@@ -35,7 +36,7 @@ import org.osgi.framework.Bundle;
  */
 public class GeronimoHandlerResolver implements HandlerResolver {
 
-    private HandlerChains handlerChains;
+    private HandlerChainsInfo handlerChainsInfo;
 
     private Bundle bundle;
 
@@ -45,11 +46,11 @@ public class GeronimoHandlerResolver imp
 
     public GeronimoHandlerResolver(Bundle bundle,
                                    Class serviceClass,
-                                   HandlerChains handlerChains,
+                                   HandlerChainsInfo handlerChainsInfo,
                                    AnnotationProcessor annotationProcessor) {
         this.bundle = bundle;
         this.serviceClass = serviceClass;
-        this.handlerChains = handlerChains;
+        this.handlerChainsInfo = handlerChainsInfo;
         this.annotationProcessor = annotationProcessor;
     }
 
@@ -58,17 +59,24 @@ public class GeronimoHandlerResolver imp
         GeronimoHandlerChainBuilder builder =
                 new GeronimoHandlerChainBuilder(bundle, portInfo);
 
-        List<Handler> handlers = null;
-        if (this.handlerChains == null) {
-            handlers = builder.buildHandlerChainFromClass(this.serviceClass);
-        } else {
-            handlers = new ArrayList<Handler>();
-            for (HandlerChain handlerChain : this.handlerChains.getHandlerChain()) {
-                handlers.addAll(builder.buildHandlerChainFromConfiguration(handlerChain));
-            }
-            handlers = builder.sortHandlers(handlers);
+        if (this.handlerChainsInfo == null) {
+            /*handlers = builder.buildHandlerChainFromClass(this.serviceClass);*/
+            /* Since we run here, the HandlerChain from the class annotation should have been considered in the WebServiceRefBuilder (client side)
+             * or WebServiceFinder (server side)
+             * */
+            AnnotationHandlerChainFinder annotationHandlerChainFinder = new AnnotationHandlerChainFinder();
+            handlerChainsInfo = annotationHandlerChainFinder.buildHandlerChainFromClass(serviceClass);
+        }
+
+        if (handlerChainsInfo == null || handlerChainsInfo.handleChains.size() == 0) {
+            return Collections.<Handler> emptyList();
         }
 
+        List<Handler> handlers = new ArrayList<Handler>();
+        for (HandlerChainInfo handlerChain : handlerChainsInfo.handleChains) {
+            handlers.addAll(builder.buildHandlerChainFromConfiguration(handlerChain));
+        }
+        handlers = builder.sortHandlers(handlers);
         if (this.annotationProcessor != null) {
             try {
                 for (Handler handler : handlers) {

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/HandlerChainsInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/HandlerChainsInfoBuilder.java?rev=1127408&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/HandlerChainsInfoBuilder.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/handler/HandlerChainsInfoBuilder.java Wed May 25 07:18:18 2011
@@ -0,0 +1,56 @@
+/**
+ *  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.jaxws.handler;
+
+import org.apache.geronimo.jaxws.info.HandlerChainInfo;
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
+import org.apache.geronimo.jaxws.info.HandlerInfo;
+import org.apache.openejb.jee.Handler;
+import org.apache.openejb.jee.HandlerChain;
+import org.apache.openejb.jee.HandlerChains;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class HandlerChainsInfoBuilder {
+
+    public HandlerChainsInfo build(HandlerChains handlerChains) {
+        HandlerChainsInfo handlerChainsInfo = new HandlerChainsInfo();
+        for (HandlerChain handlerChain : handlerChains.getHandlerChain()) {
+            HandlerChainInfo handlerChainInfo = new HandlerChainInfo();
+            if (handlerChain.getServiceNamePattern() != null) {
+                handlerChainInfo.serviceNamePattern = handlerChain.getServiceNamePattern();
+            } else if (handlerChain.getPortNamePattern() != null) {
+                handlerChainInfo.portNamePattern = handlerChain.getPortNamePattern();
+            } else if (handlerChain.getProtocolBindings() != null) {
+                handlerChainInfo.protocolBindings.addAll(handlerChain.getProtocolBindings());
+            }
+            for (Handler handler : handlerChain.getHandler()) {
+                HandlerInfo handlerInfo = new HandlerInfo();
+                handlerInfo.handlerName = handler.getHandlerName();
+                handlerInfo.handlerClass = handler.getHandlerClass();
+                if (handler.getSoapRole() != null) {
+                    handlerInfo.soapRoles.addAll(handler.getSoapRole());
+                }
+                handlerChainInfo.handlers.add(handlerInfo);
+            }
+            handlerChainsInfo.handleChains.add(handlerChainInfo);
+        }
+        return handlerChainsInfo;
+    }
+}

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainInfo.java?rev=1127408&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainInfo.java Wed May 25 07:18:18 2011
@@ -0,0 +1,38 @@
+/**
+ *  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.jaxws.info;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class HandlerChainInfo implements Serializable {
+
+    public QName serviceNamePattern;
+
+    public QName portNamePattern;
+
+    public final List<String> protocolBindings = new ArrayList<String>();
+
+    public final List<HandlerInfo> handlers = new ArrayList<HandlerInfo>();
+}

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainsInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainsInfo.java?rev=1127408&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainsInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerChainsInfo.java Wed May 25 07:18:18 2011
@@ -0,0 +1,30 @@
+/**
+ *  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.jaxws.info;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class HandlerChainsInfo implements Serializable {
+
+    public final List<HandlerChainInfo> handleChains = new ArrayList<HandlerChainInfo>();
+}

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerInfo.java?rev=1127408&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/info/HandlerInfo.java Wed May 25 07:18:18 2011
@@ -0,0 +1,34 @@
+/**
+ *  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.jaxws.info;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class HandlerInfo implements Serializable{
+
+    public String handlerName;
+
+    public String handlerClass;
+
+    public final List<String> soapRoles = new ArrayList<String>();
+}

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java?rev=1127408&r1=1127407&r2=1127408&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/test/java/org/apache/geronimo/jaxws/handler/GeronimoHandlerResolverTest.java Wed May 25 07:18:18 2011
@@ -23,6 +23,7 @@ import javax.xml.namespace.QName;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.PortInfo;
 
+import org.apache.geronimo.jaxws.info.HandlerChainsInfo;
 import org.apache.geronimo.kernel.osgi.MockBundle;
 import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.openejb.jee.HandlerChains;
@@ -30,11 +31,13 @@ import org.apache.openejb.jee.JaxbJavaee
 
 public class GeronimoHandlerResolverTest extends TestSupport {
 
+    private HandlerChainsInfoBuilder handlerChainsInfoBuilder = new HandlerChainsInfoBuilder();
+
     public void testBasic() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers.xml");
         assertTrue(in != null);
-        HandlerChains handlerChains = toHandlerChains(in);
-        assertEquals(3, handlerChains.getHandlerChain().size());
+        HandlerChainsInfo handlerChains = toHandlerChains(in);
+        assertEquals(3, handlerChains.handleChains.size());
 
         GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
@@ -47,8 +50,8 @@ public class GeronimoHandlerResolverTest
     public void testServiceMatching() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers_service.xml");
         assertTrue(in != null);
-        HandlerChains handlerChains = toHandlerChains(in);
-        assertEquals(4, handlerChains.getHandlerChain().size());
+        HandlerChainsInfo handlerChains = toHandlerChains(in);
+        assertEquals(4, handlerChains.handleChains.size());
 
         GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
@@ -81,8 +84,8 @@ public class GeronimoHandlerResolverTest
     public void testBindingMatching() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers_bindings.xml");
         assertTrue(in != null);
-        HandlerChains handlerChains = toHandlerChains(in);
-        assertEquals(4, handlerChains.getHandlerChain().size());
+        HandlerChainsInfo handlerChains = toHandlerChains(in);
+        assertEquals(4, handlerChains.handleChains.size());
 
         GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
         List<Handler> handlers = null;
@@ -112,8 +115,8 @@ public class GeronimoHandlerResolverTest
     public void testPortMatching() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers_port.xml");
         assertTrue(in != null);
-        HandlerChains handlerChains = toHandlerChains(in);
-        assertEquals(4, handlerChains.getHandlerChain().size());
+        HandlerChainsInfo handlerChains = toHandlerChains(in);
+        assertEquals(4, handlerChains.handleChains.size());
 
         GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
@@ -146,8 +149,8 @@ public class GeronimoHandlerResolverTest
     public void testMixedMatching() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers_mixed.xml");
         assertTrue(in != null);
-        HandlerChains handlerChains = toHandlerChains(in);
-        assertEquals(3, handlerChains.getHandlerChain().size());
+        HandlerChainsInfo handlerChains = toHandlerChains(in);
+        assertEquals(3, handlerChains.handleChains.size());
 
         GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
 
@@ -172,8 +175,8 @@ public class GeronimoHandlerResolverTest
         assertEquals(1, handlers.size());
     }
 
-    private static HandlerChains toHandlerChains(InputStream input) throws Exception {
-        return (HandlerChains) JaxbJavaee.unmarshalJavaee(HandlerChains.class, input);
+    private HandlerChainsInfo toHandlerChains(InputStream input) throws Exception {
+        return handlerChainsInfoBuilder.build((HandlerChains) JaxbJavaee.unmarshalHandlerChains(HandlerChains.class, input));
     }
 
     private static class TestPortInfo implements PortInfo {



Mime
View raw message