Author: thomas.diesler(a)jboss.com
Date: 2008-03-12 13:37:07 -0400 (Wed, 12 Mar 2008)
New Revision: 5946
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
Removed:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java
Modified:
stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
Log:
More on FastInfoset
Modified: stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml 2008-03-12
16:13:36 UTC (rev 5945)
+++ stack/native/branches/tdiesler/trunk/ant-import/build-thirdparty.xml 2008-03-12
17:37:07 UTC (rev 5946)
@@ -135,13 +135,14 @@
<target name="thirdparty-classpath"
depends="thirdparty-get">
<!-- The compile classpath for jbossws core -->
- <path id="thirdparty.classpath">
+ <path id="thirdparty.classpath">
<!-- A stack MUST NOT have a compile time dependency on jbossws-framework.jar
-->
<pathelement location="${thirdparty.dir}/jbossws-common.jar"/>
<pathelement location="${thirdparty.dir}/jbossws-spi.jar"/>
-
- <pathelement location="${thirdparty.dir}/ant.jar"/>
- <pathelement location="${thirdparty.dir}/activation.jar"/>
+
+ <pathelement location="${thirdparty.dir}/FastInfoset.jar"/>
+ <pathelement location="${thirdparty.dir}/ant.jar"/>
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/dom4j.jar"/>
<pathelement location="${thirdparty.dir}/getopt.jar"/>
<pathelement location="${thirdparty.dir}/javassist.jar"/>
@@ -154,6 +155,7 @@
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
<pathelement location="${thirdparty.dir}/jboss-javaee.jar"/>
+ <pathelement
location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
<pathelement
location="${thirdparty.dir}/jboss-logging-spi.jar"/>
<pathelement
location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
@@ -168,8 +170,7 @@
<pathelement location="${thirdparty.dir}/xalan.jar"/>
<pathelement location="${thirdparty.dir}/xmlsec.jar"/>
<pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-jaxb-intros.jar"/>
- </path>
+ </path>
</target>
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A endpoint feature meta annotation
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.ANNOTATION_TYPE })
+public @interface EndpointFeature {
+
+ /**
+ * The id of this endpoint feature
+ */
+ String id() default "";
+
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/EndpointFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.ws.feature.FastInfosetFeature;
+
+/**
+ * This feature represents the use of FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 29-Feb-2008
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = FastInfosetFeature.ID)
+public @interface FastInfoset {
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/FastInfoset.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/SchemaValidation.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -29,6 +29,7 @@
import java.lang.annotation.Target;
import org.jboss.ws.extensions.validation.StrictlyValidErrorHandler;
+import org.jboss.ws.feature.SchemaValidationFeature;
/**
* This feature represents the use of schema validation with a
@@ -39,6 +40,7 @@
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = { ElementType.TYPE })
+@EndpointFeature( id = SchemaValidationFeature.ID)
public @interface SchemaValidation
{
/**
@@ -54,4 +56,9 @@
* If this is not specified the @{ValidationErrorHandler} will be used.
*/
Class errorHandler() default StrictlyValidErrorHandler.class;
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ boolean enabled() default true;
}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/EndpointInfo.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -27,7 +27,10 @@
import java.util.Map;
import java.util.Properties;
+import javax.xml.ws.WebServiceFeature;
+
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FeatureResolver;
/** A wrapper object that associates the target address with some metadata
*
@@ -38,9 +41,11 @@
{
private String targetAddress;
private Map<String, Object> properties;
+ private FeatureResolver features;
public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String,
Object> callProps)
{
+ this.features = epMetaData.getFeatureResolver();
this.targetAddress = targetAddress;
this.properties = callProps;
@@ -81,6 +86,11 @@
return targetAddress;
}
+ public <T extends WebServiceFeature> boolean isFeatureEnabled(Class<T>
key)
+ {
+ return features.isFeatureEnabled(key);
+ }
+
public boolean equals(Object obj)
{
if (!(obj instanceof EndpointInfo))
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,48 @@
+/*
+ * 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.core.client;
+
+// $Id$
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.soap.FastInfosetMarshaller;
+import org.jboss.ws.core.soap.FastInfosetUnMarshaller;
+
+/**
+ * SOAPConnection implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetConnectionHTTP extends SOAPProtocolConnectionHTTP
+{
+ public UnMarshaller getUnmarshaller()
+ {
+ return new FastInfosetUnMarshaller();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/FastInfosetConnectionHTTP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core.client;
+import org.jboss.ws.feature.FastInfosetFeature;
import org.jboss.wsf.spi.util.ServiceLoader;
// $Id$
@@ -48,6 +49,9 @@
if (key == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for:
" + targetAddress);
+ if (epInfo.isFeatureEnabled(FastInfosetFeature.class))
+ key += ".fastinfoset";
+
RemoteConnection con = (RemoteConnection)ServiceLoader.loadService(key, null);
if (con == null)
throw new IllegalArgumentException("Cannot obtain remote connetion for:
" + key);
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -24,18 +24,15 @@
// $Id$
import java.io.IOException;
-import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
-import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.WSException;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
@@ -46,7 +43,6 @@
*
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T.
Greene</a>
- *
* @since 02-Apr-2007
*/
public class SOAPProtocolConnectionHTTP extends HTTPRemotingConnection
@@ -87,9 +83,9 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String,
Object> metadata)
{
super.populateHeaders(reqMessage, metadata);
-
+
Properties props = (Properties)metadata.get("HEADER");
-
+
// R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
// with a quoted value equal to the value of the soapAction attribute of
// soapbind:operation, if present in the corresponding WSDL description.
@@ -115,6 +111,6 @@
{
props.put("SOAPAction", "\"\"");
}
-
+
}
}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -560,12 +560,11 @@
{
if (features != null)
{
- Set<WebServiceFeature> featureSet = new
HashSet<WebServiceFeature>();
- for (WebServiceFeature feature : features)
- featureSet.add(feature);
-
EndpointMetaData epMetaData = ((StubExt)stub).getEndpointMetaData();
- epMetaData.setWebServiceFeatures(featureSet);
+ for (WebServiceFeature feature : features)
+ {
+ epMetaData.addFeature(feature);
+ }
}
}
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,81 @@
+/*
+ * 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.core.soap;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonSOAPFaultException;
+import org.jboss.wsf.common.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
+
+/**
+ * A SOAPEnvelope builder for FastInfoset
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class FastInfosetEnvelopeBuilder extends EnvelopeBuilderDOM
+{
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, InputStream ins, boolean
ignoreParseError) throws IOException, SOAPException
+ {
+ // Parse the XML input stream
+ Element domEnv = null;
+ try
+ {
+ DOMDocumentParser parser = new DOMDocumentParser();
+ Document resDoc = DOMUtils.getDocumentBuilder().newDocument();
+ parser.parse(resDoc, ins);
+ }
+ catch (Exception ex)
+ {
+ if (ignoreParseError)
+ {
+ return null;
+ }
+ QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
+ throw new CommonSOAPFaultException(faultCode, ex.getMessage());
+ }
+
+ return build(soapMessage, domEnv);
+ }
+
+ @Override
+ public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean
ignoreParseError) throws IOException, SOAPException
+ {
+ throw new NotImplementedException();
+ }
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetEnvelopeBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,90 @@
+/*
+ * 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.core.soap;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.xml.soap.SOAPEnvelope;
+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;
+
+import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+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
+ * given output.
+ *
+ * @param dataObject Object to be writen to output
+ * @param output The data output to write the object
+ * data to.
+ */
+ public void write(Object dataObject, OutputStream output) throws IOException
+ {
+ if (dataObject instanceof InvocationRequest)
+ dataObject = ((InvocationRequest)dataObject).getParameter();
+
+ if (dataObject instanceof OnewayInvocation)
+ dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
+
+ if ((dataObject instanceof SOAPMessage) == false)
+ throw new IllegalArgumentException("Not a SOAPMessage: " +
dataObject);
+
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
+ if (soapMessage.getAttachments().next() != null)
+ throw new IllegalStateException("Attachments not supported with
FastInfoset");
+
+ try
+ {
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+ DOMDocumentSerializer serializer = new DOMDocumentSerializer();
+ serializer.setOutputStream(output);
+ serializer.serialize(soapEnv);
+ }
+ catch (SOAPException ex)
+ {
+ IOException ioex = new IOException("Cannot serialize SOAP Envelope");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Marshaller cloneMarshaller() throws CloneNotSupportedException
+ {
+ return new FastInfosetMarshaller();
+ }
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,46 @@
+/*
+ * 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.core.soap;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Mar-2008
+ */
+public class FastInfosetUnMarshaller extends SOAPMessageUnMarshallerHTTP
+{
+ @Override
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ CommonMessageContext context = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = context != null ? context.getEndpointMetaData() :
null;
+
+ MessageFactoryImpl factory = super.getMessageFactory();
+ if (epMetaData != null)
+ factory.setFeatureResolver(epMetaData.getFeatureResolver());
+
+ return factory;
+ }
+
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/FastInfosetUnMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -45,6 +45,8 @@
import org.jboss.ws.core.CommonMessageContext;
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.wsf.common.IOUtils;
import org.jboss.wsf.spi.util.ServiceLoader;
@@ -64,21 +66,18 @@
private Mode serviceMode;
// The style used by this MessageFactory
private Style style;
+ // The features used by this MessageFactory
+ private FeatureResolver features = new FeatureResolver();
// Used if the style is dynamic
private boolean dynamic;
- private EnvelopeBuilder envelopeBuilder;
-
public MessageFactoryImpl()
{
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
- envelopeBuilder =
(EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(),
EnvelopeBuilderDOM.class.getName());
}
public MessageFactoryImpl(String protocol) throws SOAPException
{
- envelopeBuilder =
(EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(),
EnvelopeBuilderDOM.class.getName());
-
if (SOAPConstants.SOAP_1_1_PROTOCOL.equals(protocol) ||
SOAPConstants.DEFAULT_SOAP_PROTOCOL.equals(protocol))
envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
@@ -137,6 +136,11 @@
this.serviceMode = serviceMode;
}
+ public void setFeatureResolver(FeatureResolver features)
+ {
+ this.features = features;
+ }
+
/**
* Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope,
* SOAPBody, and SOAPHeader objects. Profile-specific message factories can
@@ -255,11 +259,19 @@
soapMessage.setAttachments(attachments);
// Get the SOAPEnvelope builder
+ EnvelopeBuilder envBuilder;
+ if (features.isFeatureEnabled(FastInfosetFeature.class))
+ {
+ envBuilder = new FastInfosetEnvelopeBuilder();
+ }
+ else
+ {
+ envBuilder =
(EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
+ }
- envelopeBuilder.setStyle(getStyle());
-
// Build the payload
- envelopeBuilder.build(soapMessage, inputStream, ignoreParseError);
+ envBuilder.setStyle(getStyle());
+ envBuilder.build(soapMessage, inputStream, ignoreParseError);
}
return soapMessage;
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -100,7 +100,7 @@
{
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- feature = epMetaData.getWebServiceFeature(SchemaValidationFeature.class);
+ feature = epMetaData.getFeature(SchemaValidationFeature.class);
URL xsdURL = feature.getSchemaLocation() != null ? new
URL(feature.getSchemaLocation()) : null;
if (xsdURL == null)
{
@@ -139,7 +139,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null)
- feature =
msgContext.getEndpointMetaData().getWebServiceFeature(SchemaValidationFeature.class);
+ feature =
msgContext.getEndpointMetaData().getFeature(SchemaValidationFeature.class);
return feature != null ? feature.isEnabled() : false;
}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -49,7 +49,7 @@
try
{
- SOAPMessage soapMsg = new MessageFactoryImpl().createMessage(null, inputStream,
true);
+ SOAPMessage soapMsg = getMessageFactory().createMessage(null, inputStream,
true);
return soapMsg;
}
@@ -62,6 +62,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
public void setClassLoader(ClassLoader classloader)
{
}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -81,7 +81,7 @@
if (resCode != HttpServletResponse.SC_NO_CONTENT)
{
MimeHeaders mimeHeaders = getMimeHeaders(metadata);
- soapMsg = new MessageFactoryImpl().createMessage(mimeHeaders, inputStream,
true);
+ soapMsg = getMessageFactory().createMessage(mimeHeaders, inputStream, true);
}
return soapMsg;
@@ -95,6 +95,11 @@
}
}
+ protected MessageFactoryImpl getMessageFactory()
+ {
+ return new MessageFactoryImpl();
+ }
+
/**
* Set the class loader to use for unmarhsalling. This may
* be needed when need to have access to class definitions that
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1,108 @@
+/*
+ * 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.builder.jaxws;
+
+// $Id$
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.annotation.FastInfoset;
+import org.jboss.ws.annotation.SchemaValidation;
+import org.jboss.ws.feature.FastInfosetFeature;
+import org.jboss.ws.feature.SchemaValidationFeature;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.xml.sax.ErrorHandler;
+
+/**
+ * Process EndpointFeature annotations
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 12-Mar-2008
+ */
+public class EndpointFeatureProcessor
+{
+ protected void processEndpointFeatures(Deployment dep, ServerEndpointMetaData
sepMetaData, Class<?> sepClass)
+ {
+ for (Annotation an : sepClass.getAnnotations())
+ {
+ if (an.annotationType() == SchemaValidation.class)
+ {
+ processSchemaValidation(dep, sepMetaData, sepClass);
+ }
+ else if (an.annotationType() == FastInfoset.class)
+ {
+ processFastInfoset(dep, sepMetaData, sepClass);
+ }
+ }
+ }
+
+ private void processFastInfoset(Deployment dep, ServerEndpointMetaData sepMetaData,
Class<?> sepClass)
+ {
+ FastInfoset anFeature = sepClass.getAnnotation(FastInfoset.class);
+ FastInfosetFeature feature = new FastInfosetFeature(anFeature.enabled());
+ sepMetaData.addFeature(feature);
+ }
+
+ private void processSchemaValidation(Deployment dep, ServerEndpointMetaData
sepMetaData, Class<?> sepClass)
+ {
+ SchemaValidation anFeature = sepClass.getAnnotation(SchemaValidation.class);
+ SchemaValidationFeature feature = new
SchemaValidationFeature(anFeature.enabled());
+
+ String xsdLoc = anFeature.schemaLocation();
+ if (xsdLoc.length() > 0)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ try
+ {
+ URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
+ xsdLoc = xsdURL.toExternalForm();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot load schema: " + xsdLoc, ex);
+ }
+ }
+ feature.setSchemaLocation(xsdLoc);
+ }
+
+ Class handlerClass = anFeature.errorHandler();
+ if (handlerClass != null)
+ {
+ try
+ {
+ ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
+ feature.setErrorHandler(errorHandler);
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot instanciate error handler: " +
handlerClass, ex);
+ }
+ }
+ sepMetaData.addFeature(feature);
+ }
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/EndpointFeatureProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -24,7 +24,6 @@
// $Id$
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -60,7 +59,6 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.annotation.Documentation;
-import org.jboss.ws.annotation.SchemaValidation;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.JAXBContextFactory;
import org.jboss.ws.core.jaxws.WrapperGenerator;
@@ -72,7 +70,6 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-import org.jboss.ws.feature.SchemaValidationFeature;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -91,8 +88,6 @@
import org.jboss.ws.metadata.wsdl.WSDLMIMEPart;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
@@ -102,7 +97,6 @@
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.ErrorHandler;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
@@ -554,10 +548,10 @@
String tns = epMetaData.getPortName().getNamespaceURI();
String portTypeName = epMetaData.getPortName().getLocalPart();
String opName = opMetaData.getQName().getLocalPart();
- addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
opName + "Request");
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/" +
opName + "Request");
if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/"
+ opName + "Response");
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/"
+ opName + "Response");
}
opMetaData.addExtension(addrExt);
@@ -598,7 +592,7 @@
throw new IllegalArgumentException("@SOAPBinding must be specified using
DOCUMENT style when placed on a method");
opMetaData.setParameterStyle(anBinding.parameterStyle());
}
-
+
if (method.isAnnotationPresent(Documentation.class))
{
opMetaData.setDocumentation(method.getAnnotation(Documentation.class).content());
@@ -1040,46 +1034,4 @@
{
this.wrapperGenerator = wrapperGenerator;
}
-
- protected void processWebServiceFeatures(Deployment dep, ServerEndpointMetaData
sepMetaData, Class<?> sepClass)
- {
- if (sepClass.isAnnotationPresent(SchemaValidation.class))
- {
- SchemaValidation anValidation = sepClass.getAnnotation(SchemaValidation.class);
- SchemaValidationFeature feature = new SchemaValidationFeature();
-
- String xsdLoc = anValidation.schemaLocation();
- if (xsdLoc.length() > 0)
- {
- if (dep instanceof ArchiveDeployment)
- {
- try
- {
- URL xsdURL = ((ArchiveDeployment)dep).getMetaDataFileURL(xsdLoc);
- xsdLoc = xsdURL.toExternalForm();
- }
- catch (IOException ex)
- {
- throw new WSException("Cannot load schema: " + xsdLoc, ex);
- }
- }
- feature.setSchemaLocation(xsdLoc);
- }
-
- Class handlerClass = anValidation.errorHandler();
- if (handlerClass != null)
- {
- try
- {
- ErrorHandler errorHandler = (ErrorHandler)handlerClass.newInstance();
- feature.setErrorHandler(errorHandler);
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot instanciate error handler: " +
handlerClass, ex);
- }
- }
- sepMetaData.addWebServiceFeature(feature);
- }
- }
}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -139,7 +139,8 @@
processEndpointConfig(dep, sepMetaData, sepClass, linkName);
// process web service features
- processWebServiceFeatures(dep, sepMetaData, sepClass);
+ EndpointFeatureProcessor epFeatureProcessor = new EndpointFeatureProcessor();
+ epFeatureProcessor.processEndpointFeatures(dep, sepMetaData, sepClass);
// Process endpoint documentation
if (seiClass.isAnnotationPresent(Documentation.class))
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -150,7 +150,7 @@
// All of the registered types
private List<Class> registeredTypes = new ArrayList<Class>();
// The features defined for this endpoint
- private Set<WebServiceFeature> features = new
HashSet<WebServiceFeature>();
+ private FeatureResolver features = new FeatureResolver();
// The documentation edfined through the @Documentation annotation
private String documentation;
@@ -363,31 +363,21 @@
this.properties = properties;
}
- public <T extends WebServiceFeature> T getWebServiceFeature(Class<T> key)
+ public <T extends WebServiceFeature> T getFeature(Class<T> key)
{
- for (WebServiceFeature feature : features)
- {
- if (key == feature.getClass())
- return (T)feature;
- }
- return null;
+ return features.getFeature(key);
}
- public Set<WebServiceFeature> getWebServiceFeatures()
+ public FeatureResolver getFeatureResolver()
{
return features;
}
- public void addWebServiceFeature(WebServiceFeature feature)
+ public void addFeature(WebServiceFeature feature)
{
- this.features.add(feature);
+ this.features.addFeature(feature);
}
- public void setWebServiceFeatures(Set<WebServiceFeature> features)
- {
- this.features = features;
- }
-
public String getDocumentation()
{
return documentation;
Added:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -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 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);
+ }
+
+}
Property changes on:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/umdm/FeatureResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionFactoryImpl.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -1,66 +0,0 @@
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (
http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Axis" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache(a)apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <
http://www.apache.org/>.
- */
-package org.jboss.ws.soap;
-
-// $Id$
-
-
-/**
- * Included for backwards compatibility
- * @deprecated
- */
-public class SOAPConnectionFactoryImpl extends
org.jboss.ws.core.soap.SOAPConnectionFactoryImpl
-{
-}
Modified:
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -397,6 +397,7 @@
msgFactory.setServiceMode(sepMetaData.getServiceMode());
msgFactory.setStyle(sepMetaData.getStyle());
+ msgFactory.setFeatureResolver(sepMetaData.getFeatureResolver());
reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers,
inputStream);
}
Added:
stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
===================================================================
---
stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset
(rev 0)
+++
stack/native/branches/tdiesler/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http.fastinfoset 2008-03-12
17:37:07 UTC (rev 5946)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.FastInfosetConnectionHTTP
\ No newline at end of file
Modified:
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java
===================================================================
---
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12
16:13:36 UTC (rev 5945)
+++
stack/native/branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetEndpoint.java 2008-03-12
17:37:07 UTC (rev 5946)
@@ -26,9 +26,11 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.FastInfoset;
@WebService(targetNamespace = "http://org.jboss.ws/fastinfoset")
@SOAPBinding(style = SOAPBinding.Style.RPC)
+@FastInfoset
public class FastInfosetEndpoint
{
// provide logging