JBossWS SVN: r8789 - in stack/metro/trunk: modules/client/src/main/java/org/jboss/wsf/stack/metro/client and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-26 05:45:05 -0500 (Wed, 26 Nov 2008)
New Revision: 8789
Added:
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/HandlerResolverImpl.java
Modified:
stack/metro/trunk/.classpath
stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java
Log:
[JBWS-2300] fix last TCK5 jaxws failures (ee/w2j/rpc/literal/handlertest/* and api/javax_xml_ws/LogicalMessage/*)
Modified: stack/metro/trunk/.classpath
===================================================================
--- stack/metro/trunk/.classpath 2008-11-25 20:31:33 UTC (rev 8788)
+++ stack/metro/trunk/.classpath 2008-11-26 10:45:05 UTC (rev 8789)
@@ -9,7 +9,8 @@
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-common"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-framework"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-spi"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.0.CR2"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/junit"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Metro-Integration-Libraries"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.0.GA"/>
<classpathentry kind="output" path="target/eclipse-classes"/>
</classpath>
Added: stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/HandlerResolverImpl.java
===================================================================
--- stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/HandlerResolverImpl.java (rev 0)
+++ stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/HandlerResolverImpl.java 2008-11-26 10:45:05 UTC (rev 8789)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.metro.client;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.handler.PortInfo;
+
+import org.jboss.logging.Logger;
+
+import com.sun.xml.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.ws.handler.HandlerChainsModel;
+import com.sun.xml.ws.streaming.XMLStreamReaderUtil;
+
+/**
+ * Handler resolver for Metro integration
+ * @author richard.opalka(a)jboss.com
+ */
+public final class HandlerResolverImpl implements HandlerResolver
+{
+ private static final Logger log = Logger.getLogger(HandlerResolverImpl.class);
+ private final String handlerFile;
+ private final Class<?> clazz;
+ private HandlerChainsModel handlerChainsModel;
+
+ HandlerResolverImpl(String handlerFile, Class<?> clazz)
+ {
+ super();
+ this.handlerFile = handlerFile;
+ this.clazz = clazz;
+ this.init();
+ }
+
+ public List<Handler> getHandlerChain(PortInfo portInfo)
+ {
+ return this.handlerChainsModel.getHandlersForPortInfo(portInfo).getHandlers();
+ }
+
+ private void init()
+ {
+ final InputStream is = this.getInputStream(this.handlerFile, this.clazz);
+ this.handlerChainsModel = this.buildHandlerChainsModel(is, clazz);
+ }
+
+ private InputStream getInputStream(String filename, Class<?> wsClass)
+ {
+ URL fileURL = null;
+ log.debug("processHandlerChain [" + filename + "] on: " + wsClass.getName());
+
+ // Try the filename as URL
+ try
+ {
+ fileURL = new URL(filename);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (fileURL == null)
+ {
+ try
+ {
+ File file = new File(filename);
+ if (file.exists())
+ fileURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (fileURL == null)
+ {
+ log.debug(wsClass.getProtectionDomain().getCodeSource());
+ log.debug(wsClass.getClassLoader());
+ fileURL = wsClass.getClassLoader().getResource(filename);
+ }
+
+ // Try the filename relative to class
+ if (fileURL == null)
+ {
+ String filepath = filename;
+ String packagePath = wsClass.getPackage().getName().replace('.', '/');
+ String resourcePath = packagePath + "/" + filepath;
+ while (filepath.startsWith("../"))
+ {
+ packagePath = packagePath.substring(0, packagePath.lastIndexOf("/"));
+ filepath = filepath.substring(3);
+ resourcePath = packagePath + "/" + filepath;
+ }
+ fileURL = wsClass.getClassLoader().getResource(resourcePath);
+ }
+
+ if (fileURL == null)
+ throw new WebServiceException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
+
+ try
+ {
+ return fileURL.openStream();
+ }
+ catch (IOException ioe)
+ {
+ throw new WebServiceException(ioe);
+ }
+ }
+
+ private HandlerChainsModel buildHandlerChainsModel(InputStream is, Class<?> target)
+ {
+ XMLStreamReader reader = XMLStreamReaderFactory.create(null, is, true);
+ XMLStreamReaderUtil.nextElementContent(reader);
+ HandlerChainsModel handlerChainsModel = HandlerChainsModel.parseHandlerConfigFile(target, reader);
+ try
+ {
+ reader.close();
+ is.close();
+ }
+ catch (XMLStreamException e)
+ {
+ e.printStackTrace();
+ throw new WebServiceException(e.getMessage());
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ throw new WebServiceException(e.getMessage());
+ }
+ return handlerChainsModel;
+ }
+
+}
Modified: stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java
===================================================================
--- stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java 2008-11-25 20:31:33 UTC (rev 8788)
+++ stack/metro/trunk/modules/client/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java 2008-11-26 10:45:05 UTC (rev 8789)
@@ -41,6 +41,9 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import com.sun.xml.ws.api.client.ServiceInterceptorFactory;
@@ -188,6 +191,11 @@
ServiceInterceptorFactory.unregisterForThread(serviceInterceptorFactory);
}
+ if ((serviceRef.getHandlerChain() != null) && (target instanceof Service))
+ {
+ ((Service)target).setHandlerResolver(new HandlerResolverImpl(serviceRef.getHandlerChain(), target.getClass()));
+ }
+
return target;
}
catch (Throwable ex)
16 years, 1 month
JBossWS SVN: r8788 - in container/jboss50: trunk and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:31:33 -0500 (Tue, 25 Nov 2008)
New Revision: 8788
Modified:
container/jboss50/branches/jboss500CR2/pom.xml
container/jboss50/trunk/pom.xml
Log:
use new parent
Modified: container/jboss50/branches/jboss500CR2/pom.xml
===================================================================
--- container/jboss50/branches/jboss500CR2/pom.xml 2008-11-25 20:31:12 UTC (rev 8787)
+++ container/jboss50/branches/jboss500CR2/pom.xml 2008-11-25 20:31:33 UTC (rev 8788)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
Modified: container/jboss50/trunk/pom.xml
===================================================================
--- container/jboss50/trunk/pom.xml 2008-11-25 20:31:12 UTC (rev 8787)
+++ container/jboss50/trunk/pom.xml 2008-11-25 20:31:33 UTC (rev 8788)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8787 - in container/jboss42: branches/jboss423 and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:31:12 -0500 (Tue, 25 Nov 2008)
New Revision: 8787
Modified:
container/jboss42/branches/jboss422/pom.xml
container/jboss42/branches/jboss423/pom.xml
container/jboss42/trunk/pom.xml
Log:
use new parent
Modified: container/jboss42/branches/jboss422/pom.xml
===================================================================
--- container/jboss42/branches/jboss422/pom.xml 2008-11-25 20:28:26 UTC (rev 8786)
+++ container/jboss42/branches/jboss422/pom.xml 2008-11-25 20:31:12 UTC (rev 8787)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
Modified: container/jboss42/branches/jboss423/pom.xml
===================================================================
--- container/jboss42/branches/jboss423/pom.xml 2008-11-25 20:28:26 UTC (rev 8786)
+++ container/jboss42/branches/jboss423/pom.xml 2008-11-25 20:31:12 UTC (rev 8787)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
Modified: container/jboss42/trunk/pom.xml
===================================================================
--- container/jboss42/trunk/pom.xml 2008-11-25 20:28:26 UTC (rev 8786)
+++ container/jboss42/trunk/pom.xml 2008-11-25 20:31:12 UTC (rev 8787)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8786 - common/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:28:26 -0500 (Tue, 25 Nov 2008)
New Revision: 8786
Modified:
common/trunk/pom.xml
Log:
use new parent
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2008-11-25 20:28:00 UTC (rev 8785)
+++ common/trunk/pom.xml 2008-11-25 20:28:26 UTC (rev 8786)
@@ -15,7 +15,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8785 - spi/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:28:00 -0500 (Tue, 25 Nov 2008)
New Revision: 8785
Modified:
spi/trunk/pom.xml
Log:
use new parent
Modified: spi/trunk/pom.xml
===================================================================
--- spi/trunk/pom.xml 2008-11-25 20:27:44 UTC (rev 8784)
+++ spi/trunk/pom.xml 2008-11-25 20:28:00 UTC (rev 8785)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8784 - framework/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:27:44 -0500 (Tue, 25 Nov 2008)
New Revision: 8784
Modified:
framework/trunk/pom.xml
Log:
use new parent
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2008-11-25 20:27:01 UTC (rev 8783)
+++ framework/trunk/pom.xml 2008-11-25 20:27:44 UTC (rev 8784)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8783 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:27:01 -0500 (Tue, 25 Nov 2008)
New Revision: 8783
Modified:
stack/native/trunk/pom.xml
Log:
use new parent
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2008-11-25 20:26:38 UTC (rev 8782)
+++ stack/native/trunk/pom.xml 2008-11-25 20:27:01 UTC (rev 8783)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8782 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:26:38 -0500 (Tue, 25 Nov 2008)
New Revision: 8782
Modified:
stack/cxf/trunk/pom.xml
Log:
use new parent
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2008-11-25 20:25:49 UTC (rev 8781)
+++ stack/cxf/trunk/pom.xml 2008-11-25 20:26:38 UTC (rev 8782)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8781 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:25:49 -0500 (Tue, 25 Nov 2008)
New Revision: 8781
Modified:
stack/metro/trunk/pom.xml
Log:
use new parent
Modified: stack/metro/trunk/pom.xml
===================================================================
--- stack/metro/trunk/pom.xml 2008-11-25 20:24:36 UTC (rev 8780)
+++ stack/metro/trunk/pom.xml 2008-11-25 20:25:49 UTC (rev 8781)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Source Control Management -->
16 years, 1 month
JBossWS SVN: r8780 - maven/parent/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-11-25 15:24:36 -0500 (Tue, 25 Nov 2008)
New Revision: 8780
Modified:
maven/parent/trunk/pom.xml
Log:
always download sources - can be disabled by setting -Dskip-download-sources=true java property
Modified: maven/parent/trunk/pom.xml
===================================================================
--- maven/parent/trunk/pom.xml 2008-11-24 14:55:17 UTC (rev 8779)
+++ maven/parent/trunk/pom.xml 2008-11-25 20:24:36 UTC (rev 8780)
@@ -166,4 +166,36 @@
<url>dav:https://snapshots.jboss.org/maven2</url>
</snapshotRepository>
</distributionManagement>
+
+ <profiles>
+ <profile>
+ <id>download-sources</id>
+ <activation>
+ <property>
+ <name>!skip-download-sources</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>download-sources</id>
+ <goals>
+ <goal>sources</goal>
+ </goals>
+ <configuration>
+ <silent>true</silent>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
16 years, 1 month