JBossWS SVN: r10119 - in stack/cxf/trunk/modules: client/src/main/java/org/jboss/wsf/stack/cxf/extensions and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-27 05:53:36 -0400 (Wed, 27 May 2009)
New Revision: 10119
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilderFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPConstants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPEndpoint.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPRelatesTo.java
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
Log:
[JBWS-2106] Adding CXF impl of common JSR-261 API
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,306 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.ReferenceParametersType;
+import org.apache.cxf.ws.addressing.RelatesToType;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.addressing.MAP;
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+import org.w3c.dom.Element;
+
+/**
+ * Message Addressing Properties is a wrapper for the stack-specific addressing properties
+ * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
+ * stack. This is the JBossWS CXF specific implementation.
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAP implements MAP
+{
+ private static final Logger log = Logger.getLogger(CXFMAP.class);
+
+ /**
+ * the wrapped instance which this class delegates to
+ */
+ private AddressingProperties implementation;
+
+ /**
+ * JBossWS Native specific constructor
+ * @param implementation
+ */
+ CXFMAP(AddressingProperties implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getTo()
+ {
+ AttributedURIType to = implementation.getTo();
+ return (to != null ? to.getValue() : null);
+ }
+
+ public MAPEndpoint getFrom()
+ {
+ EndpointReferenceType from = implementation.getFrom();
+ return (from != null ? new CXFMAPEndpoint(from) : null);
+ }
+
+ public String getMessageID()
+ {
+ AttributedURIType messageId = implementation.getMessageID();
+ return (messageId != null ? messageId.getValue() : null);
+ }
+
+ public String getAction()
+ {
+ AttributedURIType action = implementation.getAction();
+ return (action != null ? action.getValue() : null);
+ }
+
+ public MAPEndpoint getFaultTo()
+ {
+ EndpointReferenceType faultTo = implementation.getFaultTo();
+ return (faultTo != null ? new CXFMAPEndpoint(faultTo) : null);
+ }
+
+ public MAPEndpoint getReplyTo()
+ {
+ EndpointReferenceType replyTo = implementation.getReplyTo();
+ return (replyTo != null ? new CXFMAPEndpoint(replyTo) : null);
+ }
+
+ public MAPRelatesTo getRelatesTo()
+ {
+ MAPBuilder builder = CXFMAPBuilder.getBuilder();
+ RelatesToType relatesTo = implementation.getRelatesTo();
+ if (relatesTo != null)
+ {
+ String type = relatesTo.getRelationshipType();
+ int index = type.indexOf("}");
+ String ns = type.substring(1, index + 1);
+ String name = type.substring(index + 1);
+ return builder.newRelatesTo(relatesTo.getValue(), new QName(ns, name));
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setTo(String address)
+ {
+ if (address != null)
+ {
+ EndpointReferenceType epref = new EndpointReferenceType();
+ AttributedURIType uri = new AttributedURIType();
+ uri.setValue(address);
+ epref.setAddress(uri);
+ implementation.setTo(epref);
+ }
+ else
+ {
+ implementation.setTo(null);
+ }
+ }
+
+ public void setFrom(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof CXFMAPEndpoint)
+ {
+ implementation.setFrom(((CXFMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFrom(null);
+ }
+ }
+
+ public void setMessageID(String messageID)
+ {
+ if (messageID != null)
+ {
+ AttributedURIType uri = new AttributedURIType();
+ uri.setValue(messageID);
+ implementation.setMessageID(uri);
+ }
+ else
+ {
+ implementation.setMessageID(null);
+ }
+ }
+
+ public void setAction(String action)
+ {
+ if (action != null)
+ {
+ AttributedURIType uri = new AttributedURIType();
+ uri.setValue(action);
+ implementation.setAction(uri);
+ }
+ else
+ {
+ implementation.setAction(null);
+ }
+ }
+
+ public void setReplyTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof CXFMAPEndpoint)
+ {
+ implementation.setReplyTo(((CXFMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setReplyTo(null);
+ }
+ }
+
+ public void setFaultTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof CXFMAPEndpoint)
+ {
+ implementation.setFaultTo(((CXFMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFaultTo(null);
+ }
+ }
+
+ public void setRelatesTo(MAPRelatesTo relatesTo)
+ {
+ if (relatesTo != null)
+ {
+ RelatesToType relatesToImpl = new RelatesToType();
+ relatesToImpl.setValue(relatesTo.getRelatesTo());
+ relatesToImpl.setRelationshipType(relatesTo.getType().toString());
+ implementation.setRelatesTo(relatesToImpl);
+ }
+ else
+ {
+ implementation.setRelatesTo(null);
+ }
+ }
+
+ public void addReferenceParameter(Element refParam)
+ {
+ EndpointReferenceType eprt = implementation.getToEndpointReference();
+ ReferenceParametersType refParams = eprt.getReferenceParameters();
+ if (refParams == null)
+ {
+ refParams = new ReferenceParametersType();
+ eprt.setReferenceParameters(refParams);
+ }
+ eprt.getReferenceParameters().getAny().add(refParam);
+ //implementation.getToEndpointReference().getReferenceParameters().getAny().add(refParam);
+ }
+
+ public void initializeAsDestination(MAPEndpoint epref)
+ {
+ if (epref == null)
+ throw new IllegalArgumentException("Invalid null endpoint reference");
+
+ if (epref instanceof CXFMAPEndpoint)
+ {
+ implementation.setTo(((CXFMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+
+ public List<Object> getReferenceParameters()
+ {
+ List<Object> list = new LinkedList<Object>();
+ ReferenceParametersType refParams = implementation.getToEndpointReference().getReferenceParameters();
+ if (refParams != null)
+ {
+ List<Object> any = refParams.getAny();
+ if (any != null)
+ {
+ list.addAll(any);
+ }
+ }
+ return list;
+ }
+
+ public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map)
+ {
+ if (!(map instanceof CXFMAP))
+ {
+ throw new IllegalArgumentException("Unsupported MAP: " + map);
+ }
+ AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
+
+ requestContext.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+ requestContext.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+ }
+
+ public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map)
+ {
+ if (!(map instanceof CXFMAP))
+ {
+ throw new IllegalArgumentException("Unsupported MAP: " + map);
+ }
+ AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
+
+ requestContext.put(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+import org.apache.cxf.ws.addressing.AddressingBuilder;
+import org.apache.cxf.ws.addressing.AddressingConstants;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.jboss.wsf.common.addressing.MAP;
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPConstants;
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+
+/**
+ * MAPBuilder is a helper used to create objects used with class MAP. This is the JBossWS CXF
+ * implementation.
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAPBuilder implements MAPBuilder
+{
+ private AddressingBuilder addressingBuilder;
+
+ private static MAPBuilder theBuilder = new CXFMAPBuilder();
+
+ public static MAPBuilder getBuilder()
+ {
+ return theBuilder;
+ }
+
+ private CXFMAPBuilder()
+ {
+ AddressingBuilder implementation = AddressingBuilder.getAddressingBuilder();
+ this.addressingBuilder = implementation;
+ }
+
+ public MAP newMap()
+ {
+ AddressingProperties implementation = addressingBuilder.newAddressingProperties();
+ return new CXFMAP(implementation);
+ }
+
+ /**
+ * retrieve the inbound server message address properties attached to a message context
+ * @param ctx the server message context
+ * @return
+ */
+ public MAP inboundMap(Map<String, Object> ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ return newMap(implementation);
+ }
+
+ /**
+ * retrieve the outbound client message address properties attached to a message request map
+ * @param ctx the client request properties map
+ * @return
+ */
+ public MAP outboundMap(Map<String, Object> ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ if (implementation == null)
+ {
+ implementation = addressingBuilder.newAddressingProperties();
+ ctx.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES, implementation);
+ ctx.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, implementation);
+ }
+ return newMap(implementation);
+ }
+
+ // n.b. this is package public only!
+ MAP newMap(AddressingProperties implementation)
+ {
+ return new CXFMAP(implementation);
+ }
+
+ public MAPConstants newConstants()
+ {
+ AddressingConstants implementation = addressingBuilder.newAddressingConstants();
+ return new CXFMAPConstants(implementation);
+ }
+
+ public MAPEndpoint newEndpoint(String address)
+ {
+ EndpointReferenceType implementation = new EndpointReferenceType();
+ AttributedURIType uri = new AttributedURIType();
+ uri.setValue(address);
+ implementation.setAddress(uri);
+ return new CXFMAPEndpoint(implementation);
+ }
+
+ public MAPRelatesTo newRelatesTo(String id, QName type)
+ {
+ return new CXFMAPRelatesTo(id, type);
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilderFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilderFactory.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilderFactory.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPBuilderFactory;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAPBuilderFactory extends MAPBuilderFactory
+{
+ public MAPBuilder getBuilderInstance()
+ {
+ return CXFMAPBuilder.getBuilder();
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPConstants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPConstants.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPConstants.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import org.apache.cxf.ws.addressing.AddressingConstants;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
+import org.jboss.wsf.common.addressing.MAPConstants;
+
+/**
+ * MAPConstants is a wrapper which works with class MAP. This is the JBossWS CXF version.
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAPConstants implements MAPConstants
+{
+ public static final String CLIENT_ADDRESSING_PROPERTIES = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+ private AddressingConstants implementation;
+
+
+ CXFMAPConstants(AddressingConstants implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getClientAddressingProperties()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES;
+ }
+
+ public String getClientAddressingPropertiesInbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getClientAddressingPropertiesOutbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+ public String getNoneURI()
+ {
+ return implementation.getNoneURI();
+ }
+
+ public String getAnonymousURI()
+ {
+ return implementation.getAnonymousURI();
+ }
+
+ public String getServerAddressingPropertiesInbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getServerAddressingPropertiesOutbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPEndpoint.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPEndpoint.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPEndpoint.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.ReferenceParametersType;
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.w3c.dom.Element;
+
+/**
+ * MAPEndpoint is a wrapper which works with class MAP. This is the JBossWS CXF implementation.
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAPEndpoint implements MAPEndpoint
+{
+ private EndpointReferenceType implementation;
+
+ CXFMAPEndpoint(EndpointReferenceType implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getAddress()
+ {
+ return implementation.getAddress().getValue();
+ }
+
+ public void addReferenceParameter(Element element)
+ {
+ ReferenceParametersType refParams = implementation.getReferenceParameters();
+ if (refParams == null)
+ {
+ refParams = new ReferenceParametersType();
+ implementation.setReferenceParameters(refParams);
+ }
+ refParams.getAny().add(element);
+ }
+
+ EndpointReferenceType getImplementation()
+ {
+ return implementation;
+ }
+
+ public List<Object> getReferenceParameters()
+ {
+ List<Object> list = new LinkedList<Object>();
+ ReferenceParametersType refParams = implementation.getReferenceParameters();
+ if (refParams != null)
+ {
+ List<Object> any = refParams.getAny();
+ if (any != null)
+ {
+ list.addAll(any);
+ }
+ }
+ return list;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPRelatesTo.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPRelatesTo.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPRelatesTo.java 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.cxf.extensions.addressing.map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+
+/**
+ * MAPRelationship is a wrapper class which works with class MAP. This is the JBossWS CXF implementation.
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class CXFMAPRelatesTo implements MAPRelatesTo
+{
+ private String relatesTo;
+ private QName type;
+
+ CXFMAPRelatesTo(String relatesTo, QName type)
+ {
+ this.relatesTo = relatesTo;
+ this.type = type;
+ }
+
+ public String getRelatesTo()
+ {
+ return relatesTo;
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPRelatesTo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.extensions.addressing.map.CXFMAPBuilderFactory
\ No newline at end of file
Added: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory 2009-05-27 09:53:36 UTC (rev 10119)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.extensions.addressing.map.CXFMAPBuilderFactory
\ No newline at end of file
15 years, 7 months
JBossWS SVN: r10118 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-27 05:51:13 -0400 (Wed, 27 May 2009)
New Revision: 10118
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java
Log:
[JBWS-2106]
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java 2009-05-27 09:49:19 UTC (rev 10117)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java 2009-05-27 09:51:13 UTC (rev 10118)
@@ -264,12 +264,12 @@
implementation.getReferenceParameters().addElement(refParam);
}
- public List<Element> getReferenceParameters()
+ public List<Object> getReferenceParameters()
{
- List<Element> list = new LinkedList<Element>();
- for (Object obj : implementation.getReferenceParameters().getElements())
+ List<Object> list = new LinkedList<Object>();
+ if (implementation.getReferenceParameters() != null)
{
- list.add((Element)obj);
+ list.addAll(implementation.getReferenceParameters().getElements());
}
return list;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java 2009-05-27 09:49:19 UTC (rev 10117)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java 2009-05-27 09:51:13 UTC (rev 10118)
@@ -73,7 +73,7 @@
* @param ctx the server message context
* @return
*/
- public MAP inboundMap(MessageContext ctx)
+ public MAP inboundMap(Map<String, Object> ctx)
{
AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
return newMap(implementation);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java 2009-05-27 09:49:19 UTC (rev 10117)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java 2009-05-27 09:51:13 UTC (rev 10118)
@@ -55,12 +55,12 @@
implementation.getReferenceParameters().addElement(element);
}
- public List<Element> getReferenceParameters()
+ public List<Object> getReferenceParameters()
{
- List<Element> list = new LinkedList<Element>();
- for (Object obj : implementation.getReferenceParameters().getElements())
+ List<Object> list = new LinkedList<Object>();
+ if (implementation.getReferenceParameters() != null)
{
- list.add((Element)obj);
+ list.addAll(implementation.getReferenceParameters().getElements());
}
return list;
}
15 years, 7 months
JBossWS SVN: r10117 - common/trunk/src/main/java/org/jboss/wsf/common/addressing.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-27 05:49:19 -0400 (Wed, 27 May 2009)
New Revision: 10117
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
Log:
[JBWS-2106] Changes on API to make it more generic
Modified: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2009-05-27 09:45:40 UTC (rev 10116)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2009-05-27 09:49:19 UTC (rev 10117)
@@ -67,7 +67,7 @@
public void addReferenceParameter(Element refParam);
- public List<Element> getReferenceParameters();
+ public List<Object> getReferenceParameters();
public void initializeAsDestination(MAPEndpoint epref);
Modified: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2009-05-27 09:45:40 UTC (rev 10116)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2009-05-27 09:49:19 UTC (rev 10117)
@@ -42,7 +42,7 @@
* @param ctx the server message context
* @return
*/
- public MAP inboundMap(MessageContext ctx);
+ public MAP inboundMap(Map<String, Object> ctx);
/**
* retrieve the outbound client message address properties attached to a message request map
Modified: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2009-05-27 09:45:40 UTC (rev 10116)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2009-05-27 09:49:19 UTC (rev 10117)
@@ -38,6 +38,6 @@
public void addReferenceParameter(Element element);
- public List<Element> getReferenceParameters();
+ public List<Object> getReferenceParameters();
}
15 years, 7 months
JBossWS SVN: r10116 - in common/trunk/src/main/java/org/jboss/wsf: test and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-27 05:45:40 -0400 (Wed, 27 May 2009)
New Revision: 10116
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
Log:
- Small improvement to DOMUtils
- making Logger attribute in JBossWSTest static
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-05-26 15:46:19 UTC (rev 10115)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-05-27 09:45:40 UTC (rev 10116)
@@ -296,6 +296,11 @@
nsElement = getParentElement(nsElement);
}
}
+
+ if (namespaceURI.equals("") && el.getNamespaceURI() != null)
+ {
+ namespaceURI = el.getNamespaceURI();
+ }
if (namespaceURI.equals(""))
throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
Modified: common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2009-05-26 15:46:19 UTC (rev 10115)
+++ common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2009-05-27 09:45:40 UTC (rev 10116)
@@ -57,7 +57,7 @@
*/
public abstract class JBossWSTest extends TestCase
{
- protected Logger log = Logger.getLogger(getClass().getName());
+ protected static Logger log = Logger.getLogger(JBossWSTest.class.getName());
private JBossWSTestHelper delegate = new JBossWSTestHelper();
public JBossWSTest()
15 years, 7 months
JBossWS SVN: r10115 - stack/native/trunk/modules/core/src/main/resources/META-INF/services.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-26 11:46:19 -0400 (Tue, 26 May 2009)
New Revision: 10115
Added:
stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
Log:
[JBWS-2106] Adding MAPBuilderFactory service file
Added: stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory
===================================================================
--- stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory (rev 0)
+++ stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.common.addressing.MAPBuilderFactory 2009-05-26 15:46:19 UTC (rev 10115)
@@ -0,0 +1 @@
+org.jboss.ws.extensions.addressing.map.NativeMAPBuilderFactory
\ No newline at end of file
15 years, 7 months
JBossWS SVN: r10114 - framework/trunk/src/main/java/org/jboss/wsf/framework.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-26 11:04:48 -0400 (Tue, 26 May 2009)
New Revision: 10114
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
Log:
Move comment
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2009-05-26 14:54:45 UTC (rev 10113)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2009-05-26 15:04:48 UTC (rev 10114)
@@ -109,6 +109,9 @@
{
returnType = (T)loadService(spiType, DefaultServiceRefMetaDataParserFactory.class.getName());
}
+
+ // SPI provided by either container or stack integration
+
else if (StackConfigFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
@@ -117,9 +120,6 @@
{
returnType = (T)loadService(spiType, ServerConfigFactoryImpl.class.getName());
}
-
- // SPI provided by either container or stack integration
-
else if (EndpointRegistryFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
15 years, 7 months
JBossWS SVN: r10113 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/extensions/addressing/map and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-26 10:54:45 -0400 (Tue, 26 May 2009)
New Revision: 10113
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilderFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPConstants.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPRelatesTo.java
Removed:
stack/native/trunk/modules/jaxws-ext/src/main/java/org/
Modified:
stack/native/trunk/modules/jaxws-ext/pom.xml
Log:
[JBWS-2106] Moving native impl of common JSR-261 api to native-core (it can't live in jaxws-ext for classloading reasons)
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,311 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Relationship;
+
+import org.jboss.wsf.common.addressing.MAP;
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAP implements MAP
+{
+ /**
+ * the wrapped instance which this class delegates to
+ */
+ private AddressingProperties implementation;
+
+ /**
+ * JBossWS Native specific constructor
+ * @param implementation
+ */
+ NativeMAP(AddressingProperties implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getTo()
+ {
+ AttributedURI to = implementation.getTo();
+ return (to != null ? to.getURI().toString() : null);
+ }
+
+ public MAPEndpoint getFrom()
+ {
+ EndpointReference from = implementation.getFrom();
+ return (from != null ? new NativeMAPEndpoint(from) : null);
+ }
+
+ public String getMessageID()
+ {
+ AttributedURI messageId = implementation.getMessageID();
+ return (messageId != null ? messageId.getURI().toString() : null);
+ }
+
+ public String getAction()
+ {
+ AttributedURI action = implementation.getAction();
+ return (action != null ? action.getURI().toString() : null);
+ }
+
+ public MAPEndpoint getFaultTo()
+ {
+ EndpointReference faultTo = implementation.getFaultTo();
+ return (faultTo != null ? new NativeMAPEndpoint(faultTo) : null);
+ }
+
+ public MAPEndpoint getReplyTo()
+ {
+ EndpointReference replyTo = implementation.getReplyTo();
+ return (replyTo != null ? new NativeMAPEndpoint(replyTo) : null);
+ }
+
+ public MAPRelatesTo getRelatesTo()
+ {
+ MAPBuilder builder = NativeMAPBuilder.getBuilder();
+ Relationship[] relationship = implementation.getRelatesTo();
+ if (relationship != null)
+ {
+ Relationship relatesTo = relationship[0];
+ return builder.newRelatesTo(relatesTo.getID().toString(), relatesTo.getType());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setTo(String address)
+ {
+ if (address != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(address);
+ implementation.setTo(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setTo(null);
+ }
+ }
+
+ public void setFrom(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setFrom(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFrom(null);
+ }
+ }
+
+ public void setMessageID(String messageID)
+ {
+ if (messageID != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(messageID);
+ implementation.setMessageID(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setMessageID(null);
+ }
+ }
+
+ public void setAction(String action)
+ {
+ if (action != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(action);
+ implementation.setAction(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setAction(null);
+ }
+ }
+
+ public void setReplyTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setReplyTo(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setReplyTo(null);
+ }
+ }
+
+ public void setFaultTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setFaultTo(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFaultTo(null);
+ }
+ }
+
+ public void setRelatesTo(MAPRelatesTo relatesTo)
+ {
+ if (relatesTo != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ Relationship[] relationships = new Relationship[1];
+ String relatesToId = relatesTo.getRelatesTo();
+ URI uri = new URI(relatesToId);
+ Relationship relationship = builder.newRelationship(uri);
+ relationship.setType(relatesTo.getType());
+ relationships[0] = relationship;
+ implementation.setRelatesTo(relationships);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setRelatesTo(null);
+ }
+ }
+
+ public void addReferenceParameter(Element refParam)
+ {
+ implementation.getReferenceParameters().addElement(refParam);
+ }
+
+ public List<Element> getReferenceParameters()
+ {
+ List<Element> list = new LinkedList<Element>();
+ for (Object obj : implementation.getReferenceParameters().getElements())
+ {
+ list.add((Element)obj);
+ }
+ return list;
+ }
+
+ public void initializeAsDestination(MAPEndpoint epref)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.initializeAsDestination(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+
+ public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map)
+ {
+ if (!(map instanceof NativeMAP))
+ {
+ throw new IllegalArgumentException("Unsupported MAP: " + map);
+ }
+ AddressingProperties addressingProperties = ((NativeMAP)map).implementation;
+
+ requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+ requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+ }
+
+ public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map)
+ {
+ if (!(map instanceof NativeMAP))
+ {
+ throw new IllegalArgumentException("Unsupported MAP: " + map);
+ }
+ AddressingProperties addressingProperties = ((NativeMAP)map).implementation;
+
+ requestContext.put(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+ }
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.wsf.common.addressing.MAP;
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPConstants;
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPBuilder implements MAPBuilder
+{
+ private AddressingBuilder addressingBuilder;
+
+ private static MAPBuilder theBuilder = new NativeMAPBuilder();
+
+ private NativeMAPBuilder()
+ {
+ AddressingBuilder implementation = AddressingBuilder.getAddressingBuilder();
+ this.addressingBuilder = implementation;
+ }
+
+ public static MAPBuilder getBuilder()
+ {
+ return theBuilder;
+ }
+
+ public MAP newMap()
+ {
+ AddressingProperties implementation = addressingBuilder.newAddressingProperties();
+ return new NativeMAP(implementation);
+ }
+
+ /**
+ * retrieve the inbound server message address properties attached to a message context
+ * @param ctx the server message context
+ * @return
+ */
+ public MAP inboundMap(MessageContext ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ return newMap(implementation);
+ }
+
+ /**
+ * retrieve the outbound client message address properties attached to a message request map
+ * @param ctx the client request properties map
+ * @return
+ */
+ public MAP outboundMap(Map<String, Object> ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ return newMap(implementation);
+ }
+
+ // n.b. this is package public only!
+ MAP newMap(AddressingProperties implementation)
+ {
+ return new NativeMAP(implementation);
+ }
+
+ public MAPConstants newConstants()
+ {
+ AddressingConstants implementation = addressingBuilder.newAddressingConstants();
+ return new NativeMAPConstants(implementation);
+ }
+
+ public MAPEndpoint newEndpoint(String address)
+ {
+ try
+ {
+ URI uri = new URI(address);
+ EndpointReference implementation = addressingBuilder.newEndpointReference(uri);
+ return new NativeMAPEndpoint(implementation);
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ }
+
+ public MAPRelatesTo newRelatesTo(String id, QName type)
+ {
+ return new NativeMAPRelatesTo(id, type);
+ }
+
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilderFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilderFactory.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilderFactory.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import org.jboss.wsf.common.addressing.MAPBuilder;
+import org.jboss.wsf.common.addressing.MAPBuilderFactory;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-May-2009
+ *
+ */
+public class NativeMAPBuilderFactory extends MAPBuilderFactory
+{
+ public MAPBuilder getBuilderInstance()
+ {
+ return NativeMAPBuilder.getBuilder();
+ }
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPConstants.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPConstants.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPConstants.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.wsf.common.addressing.MAPConstants;
+
+public class NativeMAPConstants implements MAPConstants
+{
+ private AddressingConstants implementation;
+
+ public static final String CLIENT_ADDRESSING_PROPERTIES = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+
+ NativeMAPConstants(AddressingConstants implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getClientAddressingProperties()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES;
+ }
+
+ public String getClientAddressingPropertiesInbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getClientAddressingPropertiesOutbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+ public String getNoneURI()
+ {
+ return implementation.getNoneURI();
+ }
+
+ public String getAnonymousURI()
+ {
+ return implementation.getAnonymousURI();
+ }
+
+ public String getServerAddressingPropertiesInbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getServerAddressingPropertiesOutbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.ws.addressing.EndpointReference;
+
+import org.jboss.wsf.common.addressing.MAPEndpoint;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPEndpoint implements MAPEndpoint
+{
+ private EndpointReference implementation;
+
+ NativeMAPEndpoint(EndpointReference implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getAddress()
+ {
+ return implementation.getAddress().getURI().toString();
+ }
+
+ public void addReferenceParameter(Element element)
+ {
+ implementation.getReferenceParameters().addElement(element);
+ }
+
+ public List<Element> getReferenceParameters()
+ {
+ List<Element> list = new LinkedList<Element>();
+ for (Object obj : implementation.getReferenceParameters().getElements())
+ {
+ list.add((Element)obj);
+ }
+ return list;
+ }
+
+ EndpointReference getImplementation()
+ {
+ return implementation;
+ }
+
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPRelatesTo.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPRelatesTo.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPRelatesTo.java 2009-05-26 14:54:45 UTC (rev 10113)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.extensions.addressing.map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.common.addressing.MAPRelatesTo;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPRelatesTo implements MAPRelatesTo
+{
+ private String relatesTo;
+ private QName type;
+
+ NativeMAPRelatesTo(String relatesTo, QName type)
+ {
+ this.relatesTo = relatesTo;
+ this.type = type;
+ }
+
+ public String getRelatesTo()
+ {
+ return relatesTo;
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ }
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/map/NativeMAPRelatesTo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/modules/jaxws-ext/pom.xml
===================================================================
--- stack/native/trunk/modules/jaxws-ext/pom.xml 2009-05-26 14:52:41 UTC (rev 10112)
+++ stack/native/trunk/modules/jaxws-ext/pom.xml 2009-05-26 14:54:45 UTC (rev 10113)
@@ -16,10 +16,6 @@
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-spi</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-jaxws</artifactId>
<version>${version}</version>
15 years, 7 months
JBossWS SVN: r10112 - in common/trunk/src/main/java/org/jboss/wsf/common: addressing and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-26 10:52:41 -0400 (Tue, 26 May 2009)
New Revision: 10112
Added:
common/trunk/src/main/java/org/jboss/wsf/common/addressing/
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
Log:
[JBWS-2106] Moving common JSR-261 API to jbossws-common
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+/**
+ * Message Addressing Properties is a wrapper for the stack-specific JSR-261 addressing properties
+ * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
+ * stack.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAP
+{
+ public String getTo();
+
+ public MAPEndpoint getFrom();
+
+ public String getMessageID();
+
+ public String getAction();
+
+ public MAPEndpoint getFaultTo();
+
+ public MAPEndpoint getReplyTo();
+
+ public MAPRelatesTo getRelatesTo();
+
+ public void setTo(String address);
+
+ public void setFrom(MAPEndpoint epref);
+
+ public void setMessageID(String messageID);
+
+ public void setAction(String action);
+
+ public void setReplyTo(MAPEndpoint epref);
+
+ public void setFaultTo(MAPEndpoint epref);
+
+ public void setRelatesTo(MAPRelatesTo relatesTo);
+
+ public void addReferenceParameter(Element refParam);
+
+ public List<Element> getReferenceParameters();
+
+ public void initializeAsDestination(MAPEndpoint epref);
+
+ public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map);
+
+ public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map);
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * MAPBuilder is a helper used to create objects used with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPBuilder
+{
+ public MAP newMap();
+
+ /**
+ * retrieve the inbound server message address properties attached to a message context
+ * @param ctx the server message context
+ * @return
+ */
+ public MAP inboundMap(MessageContext ctx);
+
+ /**
+ * retrieve the outbound client message address properties attached to a message request map
+ * @param ctx the client request properties map
+ * @return
+ */
+ public MAP outboundMap(Map<String, Object> ctx);
+
+ public MAPConstants newConstants();
+
+ public MAPEndpoint newEndpoint(String address);
+
+ public MAPRelatesTo newRelatesTo(String id, QName type);
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public abstract class MAPBuilderFactory
+{
+ public static MAPBuilderFactory getInstance()
+ {
+ return (MAPBuilderFactory)ServiceLoader.loadService(MAPBuilderFactory.class.getName(), null);
+ }
+
+ public abstract MAPBuilder getBuilderInstance();
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+/**
+ * MAPConstants is a wrapper which works with class MAP
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPConstants
+{
+ public String getAnonymousURI();
+
+ public String getNoneURI();
+
+ public String getClientAddressingProperties();
+
+ public String getClientAddressingPropertiesInbound();
+
+ public String getClientAddressingPropertiesOutbound();
+
+ public String getServerAddressingPropertiesInbound();
+
+ public String getServerAddressingPropertiesOutbound();
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * MAPEndpoint is a wrapper which works with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPEndpoint
+{
+ public String getAddress();
+
+ public void addReferenceParameter(Element element);
+
+ public List<Element> getReferenceParameters();
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2009-05-26 14:52:41 UTC (rev 10112)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.common.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * MAPRelationship is a wrapper which works with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPRelatesTo
+{
+ public String getRelatesTo();
+
+ public QName getType();
+
+ public void setType(QName type);
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 7 months
JBossWS SVN: r10111 - spi/trunk/src/main/java/org/jboss/wsf/spi.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-26 10:52:14 -0400 (Tue, 26 May 2009)
New Revision: 10111
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/addressing/
Log:
[JBWS-2106] Moving common JSR-261 API to jbossws-common
15 years, 7 months
JBossWS SVN: r10110 - in stack/native/trunk/modules/jaxws-ext: src/main/java and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-05-25 14:11:59 -0400 (Mon, 25 May 2009)
New Revision: 10110
Added:
stack/native/trunk/modules/jaxws-ext/src/main/java/org/
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAP.java
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPBuilder.java
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPConstants.java
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPEndpoint.java
stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPRelatesTo.java
Modified:
stack/native/trunk/modules/jaxws-ext/pom.xml
Log:
[JBWS-2106] First cut of common addressing api impl
Modified: stack/native/trunk/modules/jaxws-ext/pom.xml
===================================================================
--- stack/native/trunk/modules/jaxws-ext/pom.xml 2009-05-25 18:09:46 UTC (rev 10109)
+++ stack/native/trunk/modules/jaxws-ext/pom.xml 2009-05-25 18:11:59 UTC (rev 10110)
@@ -16,6 +16,10 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-jaxws</artifactId>
<version>${version}</version>
Added: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAP.java
===================================================================
--- stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAP.java (rev 0)
+++ stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAP.java 2009-05-25 18:11:59 UTC (rev 10110)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.addressing;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Relationship;
+
+import org.jboss.wsf.spi.addressing.MAP;
+import org.jboss.wsf.spi.addressing.MAPBuilder;
+import org.jboss.wsf.spi.addressing.MAPEndpoint;
+import org.jboss.wsf.spi.addressing.MAPRelatesTo;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAP implements MAP
+{
+ /**
+ * the wrapped instance which this class delegates to
+ */
+ private AddressingProperties implementation;
+
+ /**
+ * JBossWS Native specific constructor
+ * @param implementation
+ */
+ NativeMAP(AddressingProperties implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getTo()
+ {
+ AttributedURI to = implementation.getTo();
+ return (to != null ? to.getURI().toString() : null);
+ }
+
+ public MAPEndpoint getFrom()
+ {
+ EndpointReference from = implementation.getFrom();
+ return (from != null ? new NativeMAPEndpoint(from) : null);
+ }
+
+ public String getMessageID()
+ {
+ AttributedURI messageId = implementation.getMessageID();
+ return (messageId != null ? messageId.getURI().toString() : null);
+ }
+
+ public String getAction()
+ {
+ AttributedURI action = implementation.getAction();
+ return (action != null ? action.getURI().toString() : null);
+ }
+
+ public MAPEndpoint getFaultTo()
+ {
+ EndpointReference faultTo = implementation.getFaultTo();
+ return (faultTo != null ? new NativeMAPEndpoint(faultTo) : null);
+ }
+
+ public MAPEndpoint getReplyTo()
+ {
+ EndpointReference replyTo = implementation.getReplyTo();
+ return (replyTo != null ? new NativeMAPEndpoint(replyTo) : null);
+ }
+
+ public MAPRelatesTo getRelatesTo()
+ {
+ MAPBuilder builder = NativeMAPBuilder.getBuilder();
+ Relationship[] relationship = implementation.getRelatesTo();
+ if (relationship != null)
+ {
+ Relationship relatesTo = relationship[0];
+ return builder.newRelatesTo(relatesTo.getID().toString(), relatesTo.getType());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setTo(String address)
+ {
+ if (address != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(address);
+ implementation.setTo(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setTo(null);
+ }
+ }
+
+ public void setFrom(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setFrom(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFrom(null);
+ }
+ }
+
+ public void setMessageID(String messageID)
+ {
+ if (messageID != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(messageID);
+ implementation.setMessageID(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setMessageID(null);
+ }
+ }
+
+ public void setAction(String action)
+ {
+ if (action != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AttributedURI uri = builder.newURI(action);
+ implementation.setAction(uri);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setAction(null);
+ }
+ }
+
+ public void setReplyTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setReplyTo(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setReplyTo(null);
+ }
+ }
+
+ public void setFaultTo(MAPEndpoint epref)
+ {
+ if (epref != null)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.setFaultTo(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+ else
+ {
+ implementation.setFaultTo(null);
+ }
+ }
+
+ public void setRelatesTo(MAPRelatesTo relatesTo)
+ {
+ if (relatesTo != null)
+ {
+ try
+ {
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ Relationship[] relationships = new Relationship[1];
+ String relatesToId = relatesTo.getRelatesTo();
+ URI uri = new URI(relatesToId);
+ Relationship relationship = builder.newRelationship(uri);
+ relationship.setType(relatesTo.getType());
+ relationships[0] = relationship;
+ implementation.setRelatesTo(relationships);
+ }
+ catch (URISyntaxException e)
+ {
+ // should not happen
+ }
+ }
+ else
+ {
+ implementation.setRelatesTo(null);
+ }
+ }
+
+ public void addReferenceParameter(Element refParam)
+ {
+ implementation.getReferenceParameters().addElement(refParam);
+ }
+
+ public List<Element> getReferenceParameters()
+ {
+ List<Element> list = new LinkedList<Element>();
+ for (Object obj : implementation.getReferenceParameters().getElements())
+ {
+ list.add((Element)obj);
+ }
+ return list;
+ }
+
+ public void initializeAsDestination(MAPEndpoint epref)
+ {
+ if (epref instanceof NativeMAPEndpoint)
+ {
+ implementation.initializeAsDestination(((NativeMAPEndpoint)epref).getImplementation());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ }
+ }
+
+ public void installOutboundMap(Map<String, Object> requestContext, MAP map)
+ {
+ if (!(map instanceof NativeMAP))
+ {
+ throw new IllegalArgumentException("Unsupported MAP: " + map);
+ }
+ AddressingProperties addressingProperties = ((NativeMAP)map).implementation;
+
+ requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+ requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+ }
+}
Property changes on: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPBuilder.java
===================================================================
--- stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPBuilder.java (rev 0)
+++ stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPBuilder.java 2009-05-25 18:11:59 UTC (rev 10110)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.addressing;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.wsf.spi.addressing.MAP;
+import org.jboss.wsf.spi.addressing.MAPBuilder;
+import org.jboss.wsf.spi.addressing.MAPConstants;
+import org.jboss.wsf.spi.addressing.MAPEndpoint;
+import org.jboss.wsf.spi.addressing.MAPRelatesTo;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPBuilder implements MAPBuilder
+{
+ private AddressingBuilder addressingBuilder;
+
+ private static MAPBuilder theBuilder = new NativeMAPBuilder();
+
+ public static MAPBuilder getBuilder()
+ {
+ return theBuilder;
+ }
+
+ public MAP newMap()
+ {
+ AddressingProperties implementation = addressingBuilder.newAddressingProperties();
+ return new NativeMAP(implementation);
+ }
+
+ /**
+ * retrieve the inbound server message address properties attached to a message context
+ * @param ctx the server message context
+ * @return
+ */
+ public MAP inboundMap(MessageContext ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ return newMap(implementation);
+ }
+
+ /**
+ * retrieve the outbound client message address properties attached to a message request map
+ * @param ctx the client request properties map
+ * @return
+ */
+ public MAP outboundMap(Map<String, Object> ctx)
+ {
+ AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ return newMap(implementation);
+ }
+
+ // n.b. this is package public only!
+ MAP newMap(AddressingProperties implementation)
+ {
+ return new NativeMAP(implementation);
+ }
+
+ public MAPConstants newConstants()
+ {
+ AddressingConstants implementation = addressingBuilder.newAddressingConstants();
+ return new NativeMAPConstants(implementation);
+ }
+
+ public MAPEndpoint newEndpoint(String address)
+ {
+ try
+ {
+ URI uri = new URI(address);
+ EndpointReference implementation = addressingBuilder.newEndpointReference(uri);
+ return new NativeMAPEndpoint(implementation);
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ }
+
+ public MAPRelatesTo newRelatesTo(String id, QName type)
+ {
+ return new NativeMAPRelatesTo(id, type);
+ }
+
+ private NativeMAPBuilder()
+ {
+ AddressingBuilder implementation = AddressingBuilder.getAddressingBuilder();
+ this.addressingBuilder = implementation;
+ }
+
+}
Property changes on: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPConstants.java
===================================================================
--- stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPConstants.java (rev 0)
+++ stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPConstants.java 2009-05-25 18:11:59 UTC (rev 10110)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.addressing;
+
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.wsf.spi.addressing.MAPConstants;
+
+public class NativeMAPConstants implements MAPConstants
+{
+ private AddressingConstants implementation;
+
+ public static final String CLIENT_ADDRESSING_PROPERTIES = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String CLIENT_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+
+ NativeMAPConstants(AddressingConstants implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getClientAddressingProperties()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES;
+ }
+
+ public String getClientAddressingPropertiesInbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getClientAddressingPropertiesOutbound()
+ {
+ return CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+ public String getNoneURI()
+ {
+ return implementation.getNoneURI();
+ }
+
+ public String getAnonymousURI()
+ {
+ return implementation.getAnonymousURI();
+ }
+
+ public String getServerAddressingPropertiesInbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_INBOUND;
+ }
+
+ public String getServerAddressingPropertiesOutbound()
+ {
+ return SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+ }
+
+}
Property changes on: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPEndpoint.java
===================================================================
--- stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPEndpoint.java (rev 0)
+++ stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPEndpoint.java 2009-05-25 18:11:59 UTC (rev 10110)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.addressing;
+
+import javax.xml.ws.addressing.EndpointReference;
+
+import org.jboss.wsf.spi.addressing.MAPEndpoint;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPEndpoint implements MAPEndpoint
+{
+ private EndpointReference implementation;
+
+ NativeMAPEndpoint(EndpointReference implementation)
+ {
+ this.implementation = implementation;
+ }
+
+ public String getAddress()
+ {
+ return implementation.getAddress().getURI().toString();
+ }
+
+ public void addReferenceParameter(Element element)
+ {
+ implementation.getReferenceParameters().addElement(element);
+ }
+
+ EndpointReference getImplementation()
+ {
+ return implementation;
+ }
+
+}
Property changes on: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPRelatesTo.java
===================================================================
--- stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPRelatesTo.java (rev 0)
+++ stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPRelatesTo.java 2009-05-25 18:11:59 UTC (rev 10110)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.addressing;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.addressing.MAPRelatesTo;
+
+/**
+ *
+ * @author Andrew Dinn - adinn(a)redhat.com
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public class NativeMAPRelatesTo implements MAPRelatesTo
+{
+ private String relatesTo;
+ private QName type;
+
+ NativeMAPRelatesTo(String relatesTo, QName type)
+ {
+ this.relatesTo = relatesTo;
+ this.type = type;
+ }
+
+ public String getRelatesTo()
+ {
+ return relatesTo;
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ }
+}
Property changes on: stack/native/trunk/modules/jaxws-ext/src/main/java/org/jboss/wsf/stack/addressing/NativeMAPRelatesTo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 7 months