Author: thomas.diesler(a)jboss.com
Date: 2008-03-13 04:42:17 -0400 (Thu, 13 Mar 2008)
New Revision: 5953
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
Modified:
stack/native/trunk/src/main/etc/component-info.xml
stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
Log:
[JBWS-925] Add support for FastInfoset
Modified: stack/native/trunk/src/main/etc/component-info.xml
===================================================================
--- stack/native/trunk/src/main/etc/component-info.xml 2008-03-13 08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/etc/component-info.xml 2008-03-13 08:42:17 UTC (rev 5953)
@@ -63,6 +63,9 @@
<import componentref="stax-api">
<compatible version="@stax-api@"/>
</import>
+ <import componentref="sun-fi">
+ <compatible version="@sun-fi@"/>
+ </import>
<import componentref="sun-jaxb">
<compatible version="@sun-jaxb@"/>
</import>
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-13
08:33:10 UTC (rev 5952)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -30,7 +30,7 @@
import javax.xml.ws.WebServiceFeature;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FeatureResolver;
+import org.jboss.ws.metadata.umdm.FeatureSet;
/** A wrapper object that associates the target address with some metadata
*
@@ -41,11 +41,11 @@
{
private String targetAddress;
private Map<String, Object> properties;
- private FeatureResolver features;
+ private FeatureSet features;
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String,
Object> callProps)
{
- this.features = epMetaData.getFeatureResolver();
+ this.features = epMetaData.getFeatures();
this.targetAddress = targetAddress;
this.properties = callProps;
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -28,7 +28,6 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.logging.Logger;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.invocation.OnewayInvocation;
import org.jboss.remoting.marshal.Marshaller;
@@ -41,9 +40,6 @@
*/
public class FastInfosetMarshaller implements Marshaller
{
- // Provide logging
- private static Logger log = Logger.getLogger(FastInfosetMarshaller.class);
-
/**
* Marshaller will need to take the dataObject and convert
* into primitive java data types and write to the
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -38,7 +38,7 @@
MessageFactoryImpl factory = super.getMessageFactory();
if (epMetaData != null)
- factory.setFeatureResolver(epMetaData.getFeatureResolver());
+ factory.setFeatures(epMetaData.getFeatures());
return factory;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -47,7 +47,7 @@
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
import org.jboss.ws.feature.FastInfosetFeature;
-import org.jboss.ws.metadata.umdm.FeatureResolver;
+import org.jboss.ws.metadata.umdm.FeatureSet;
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.spi.util.ServiceLoader;
@@ -68,7 +68,7 @@
// The style used by this MessageFactory
private Style style;
// The features used by this MessageFactory
- private FeatureResolver features = new FeatureResolver();
+ private FeatureSet features = new FeatureSet();
// Used if the style is dynamic
private boolean dynamic;
@@ -142,7 +142,7 @@
this.features.addFeature(feature);
}
- public void setFeatureResolver(FeatureResolver features)
+ public void setFeatures(FeatureSet features)
{
this.features = features;
}
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -151,7 +151,7 @@
// All of the registered types
private List<Class> registeredTypes = new ArrayList<Class>();
// The features defined for this endpoint
- private FeatureResolver features = new FeatureResolver();
+ private FeatureSet features = new FeatureSet();
// The documentation edfined through the @Documentation annotation
private String documentation;
@@ -374,7 +374,7 @@
return features.isFeatureEnabled(key);
}
- public FeatureResolver getFeatureResolver()
+ public FeatureSet getFeatures()
{
return features;
}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.ws.metadata.umdm;
-
-// $Id$
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * A component that maintains a set of web service features
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2005
- */
-public class FeatureResolver
-{
- // The features defined for this endpoint
- private Set<WebServiceFeature> features = new
HashSet<WebServiceFeature>();
-
- public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
- {
- return getFeature(key) != null;
- }
-
- public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T>
key)
- {
- T feature = getFeature(key);
- return (feature != null ? feature.isEnabled() : false);
- }
-
- public <T extends WebServiceFeature> T getFeature(Class<T> key)
- {
- for (WebServiceFeature feature : features)
- {
- if (key == feature.getClass())
- return (T)feature;
- }
- return null;
- }
-
- public void addFeature(WebServiceFeature feature)
- {
- this.features.add(feature);
- }
-
-}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java (from
rev 5951,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java
(rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureSet.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ws.metadata.umdm;
+
+// $Id$
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A component that maintains a set of web service features
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2005
+ */
+public class FeatureSet
+{
+ // The features defined for this endpoint
+ private Set<WebServiceFeature> features = new
HashSet<WebServiceFeature>();
+
+ public <T extends WebServiceFeature> boolean hasFeature(Class<T> key)
+ {
+ return getFeature(key) != null;
+ }
+
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T>
key)
+ {
+ T feature = getFeature(key);
+ return (feature != null ? feature.isEnabled() : false);
+ }
+
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
+ {
+ for (WebServiceFeature feature : features)
+ {
+ if (key == feature.getClass())
+ return (T)feature;
+ }
+ return null;
+ }
+
+ public void addFeature(WebServiceFeature feature)
+ {
+ this.features.add(feature);
+ }
+
+}
Modified:
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-13
08:33:10 UTC (rev 5952)
+++
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-13
08:42:17 UTC (rev 5953)
@@ -354,13 +354,18 @@
if (wsaTo != null)
{
log.debug("Sending response to addressing destination: " + wsaTo);
- new SOAPConnectionImpl().callOneWay((SOAPMessage)resMessage, wsaTo);
+ SOAPMessage soapMessage = (SOAPMessage)resMessage;
+ new SOAPConnectionImpl().callOneWay(soapMessage, wsaTo);
}
else
{
if (epMetaData.isFeatureEnabled(FastInfosetFeature.class) && resMessage
instanceof SOAPMessage)
{
- SOAPEnvelope soapEnv =
((SOAPMessage)resMessage).getSOAPPart().getEnvelope();
+ SOAPMessage soapMessage = (SOAPMessage)resMessage;
+ if (soapMessage.getAttachments().hasNext())
+ throw new IllegalStateException("Attachments not supported with
FastInfoset");
+
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
DOMDocumentSerializer serializer = new DOMDocumentSerializer();
serializer.setOutputStream(output);
serializer.serialize(soapEnv);
@@ -413,7 +418,7 @@
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
- msgFactory.setFeatureResolver(sepMetaData.getFeatureResolver());
+ msgFactory.setFeatures(sepMetaData.getFeatures());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers,
inputStream);
}