Author: richard.opalka(a)jboss.com
Date: 2011-05-05 07:34:27 -0400 (Thu, 05 May 2011)
New Revision: 14255
Added:
api/trunk/src/main/java/org/jboss/ws/
api/trunk/src/main/java/org/jboss/ws/api/
api/trunk/src/main/java/org/jboss/ws/api/addressing/
api/trunk/src/main/java/org/jboss/ws/api/addressing/AddressingConstants.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAP.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilder.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilderFactory.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPConstants.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPEndpoint.java
api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPRelatesTo.java
api/trunk/src/main/java/org/jboss/ws/api/handler/
api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java
api/trunk/src/main/java/org/jboss/ws/api/handler/GenericLogicalHandler.java
api/trunk/src/main/java/org/jboss/ws/api/handler/GenericSOAPHandler.java
Removed:
api/trunk/src/main/java/org/jboss/wsf/common/
Log:
[JBWS-3289] refactoring packages - org.jboss.wsf.common.handler ->
org.jboss.ws.api.handler; org.jboss.wsf.common.addressing ->
org.jboss.ws.api.addressing
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/AddressingConstants.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/AddressingConstants.java
(rev 0)
+++
api/trunk/src/main/java/org/jboss/ws/api/addressing/AddressingConstants.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -0,0 +1,272 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.api.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * TODO: see javax.xml.ws.addressing - merge it properly
+ * Addressing constants.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class AddressingConstants
+{
+ /**
+ * Constructor.
+ */
+ private AddressingConstants()
+ {
+ // forbidden inheritance
+ }
+
+ /**
+ * <a
href="http://www.w3.org/2005/08/addressing">WSA</a>
constants.
+ */
+ public static final class Core
+ {
+ /**
+ * Constructor.
+ */
+ private Core()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA namespace
+ public static final String NS = "http://www.w3.org/2005/08/addressing";
+
+ // WSA prefix
+ public static final String NS_PREFIX = "wsa";
+
+ public static final class Elements
+ {
+ /**
+ * Constructor.
+ */
+ private Elements()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'EndpointReference' element
+ public static final String ENDPOINTREFERENCE = "EndpointReference";
+ public static final QName ENDPOINTREFERENCE_QNAME = new QName(NS,
ENDPOINTREFERENCE, NS_PREFIX);
+
+ // WSA 'ReferenceParameters' element
+ public static final String REFERENCEPARAMETERS =
"ReferenceParameters";
+ public static final QName REFERENCEPARAMETERS_QNAME = new QName(NS,
REFERENCEPARAMETERS, NS_PREFIX);
+
+ // WSA 'Metadata' element
+ public static final String METADATA = "Metadata";
+ public static final QName METADATA_QNAME = new QName(NS, METADATA, NS_PREFIX);
+
+ // WSA 'Address' element
+ public static final String ADDRESS = "Address";
+ public static final QName ADDRESS_QNAME = new QName(NS, ADDRESS, NS_PREFIX);
+
+ // WSA 'MessageID' element
+ public static final String MESSAGEID = "MessageID";
+ public static final QName MESSAGEID_QNAME = new QName(NS, MESSAGEID, NS_PREFIX);
+
+ // WSA 'RelatesTo' element
+ public static final String RELATESTO = "RelatesTo";
+ public static final QName RELATESTO_QNAME = new QName(NS, RELATESTO, NS_PREFIX);
+
+ // WSA 'ReplyTo' element
+ public static final String REPLYTO = "ReplyTo";
+ public static final QName REPLYTO_QNAME = new QName(NS, REPLYTO, NS_PREFIX);
+
+ // WSA 'From' element
+ public static final String FROM = "From";
+ public static final QName FROM_QNAME = new QName(NS, FROM, NS_PREFIX);
+
+ // WSA 'FaultTo' element
+ public static final String FAULTTO = "FaultTo";
+ public static final QName FAULTTO_QNAME = new QName(NS, FAULTTO, NS_PREFIX);
+
+ // WSA 'To' element
+ public static final String TO = "To";
+ public static final QName TO_QNAME = new QName(NS, TO, NS_PREFIX);
+
+ // WSA 'Action' element
+ public static final String ACTION = "Action";
+ public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
+
+ // WSA 'RetryAfter' element
+ public static final String RETRYAFTER = "RetryAfter";
+ public static final QName RETRYAFTER_QNAME = new QName(NS, RETRYAFTER,
NS_PREFIX);
+
+ // WSA 'ProblemHeaderQName' element
+ public static final String PROBLEMHEADERQNAME = "ProblemHeaderQName";
+ public static final QName PROBLEMHEADERQNAME_QNAME = new QName(NS,
PROBLEMHEADERQNAME, NS_PREFIX);
+
+ // WSA 'ProblemIRI' element
+ public static final String PROBLEMIRI = "ProblemIRI";
+ public static final QName PROBLEMIRI_QNAME = new QName(NS, PROBLEMIRI,
NS_PREFIX);
+
+ // WSA 'ProblemAction' element
+ public static final String PROBLEMACTION = "ProblemAction";
+ public static final QName PROBLEMACTION_QNAME = new QName(NS, PROBLEMACTION,
NS_PREFIX);
+
+ // WSA 'SoapAction' element
+ public static final String SOAPACTION = "SoapAction";
+ public static final QName SOAPACTION_QNAME = new QName(NS, SOAPACTION,
NS_PREFIX);
+ }
+
+ public static final class Attributes
+ {
+ /**
+ * Constructor.
+ */
+ private Attributes()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'RelationshipType' attribute
+ public static final String RELATIONSHIPTYPE = "RelationshipType";
+ public static final QName RELATIONSHIPTYPE_QNAME = new QName(NS,
RELATIONSHIPTYPE, NS_PREFIX);
+
+ // WSA 'IsReferenceParameter' attribute
+ public static final String ISREFERENCEPARAMETER =
"IsReferenceParameter";
+ public static final QName ISREFERENCEPARAMETER_QNAME = new QName(NS,
ISREFERENCEPARAMETER, NS_PREFIX);
+
+ }
+
+ public static final class Faults
+ {
+ /**
+ * Constructor.
+ */
+ private Faults()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'InvalidAddressingHeader' fault
+ public static final QName INVALIDADDRESSINGHEADER_QNAME = new QName(NS,
"InvalidAddressingHeader", NS_PREFIX);
+
+ // WSA 'InvalidAddress' fault
+ public static final QName INVALIDADDRESS_QNAME = new QName(NS,
"InvalidAddress", NS_PREFIX);
+
+ // WSA 'InvalidEPR' fault
+ public static final QName INVALIDEPR_QNAME = new QName(NS,
"InvalidEPR", NS_PREFIX);
+
+ // WSA 'InvalidCardinality' fault
+ public static final QName INVALIDCARDINALITY_QNAME = new QName(NS,
"InvalidCardinality", NS_PREFIX);
+
+ // WSA 'MissingAddressInEPR' fault
+ public static final QName MISSINGADDRESSINEPR_QNAME = new QName(NS,
"MissingAddressInEPR", NS_PREFIX);
+
+ // WSA 'DuplicateMessageID' fault
+ public static final QName DUPLICATEMESSAGEID_QNAME = new QName(NS,
"DuplicateMessageID", NS_PREFIX);
+
+ // WSA 'ActionMismatch' fault
+ public static final QName ACTIONMISMATCH_QNAME = new QName(NS,
"ActionMismatch", NS_PREFIX);
+
+ // WSA 'MessageAddressingHeaderRequired' fault
+ public static final QName MESSAGEADDRESSINGHEADERREQUIRED_QNAME = new QName(NS,
"MessageAddressingHeaderRequired", NS_PREFIX);
+
+ // WSA 'DestinationUnreachable' fault
+ public static final QName DESTINATIONUNREACHABLE_QNAME = new QName(NS,
"DestinationUnreachable", NS_PREFIX);
+
+ // WSA 'ActionNotSupported' fault
+ public static final QName ACTIONNOTSUPPORTED_QNAME = new QName(NS,
"ActionNotSupported", NS_PREFIX);
+
+ // WSA 'EndpointUnavailable' fault
+ public static final QName ENDPOINTUNAVAILABLE_QNAME = new QName(NS,
"EndpointUnavailable", NS_PREFIX);
+ }
+ }
+
+ /**
+ * <a
href="http://www.w3.org/2007/05/addressing/metadata">WSAM<...
constants.
+ */
+ public static final class Metadata
+ {
+ /**
+ * Constructor.
+ */
+ private Metadata()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM namespace
+ public static final String NS =
"http://www.w3.org/2007/05/addressing/metadata";
+
+ // WSAM prefix
+ public static final String NS_PREFIX = "wsam";
+
+ public static final class Elements
+ {
+ /**
+ * Constructor.
+ */
+ private Elements()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM 'ServiceName' element
+ public static final String SERVICENAME = "ServiceName";
+ public static final QName SERVICENAME_QNAME = new QName(NS, SERVICENAME,
NS_PREFIX);
+
+ // WSAM 'InterfaceName' element
+ public static final String INTERFACENAME = "InterfaceName";
+ public static final QName INTERFACENAME_QNAME = new QName(NS, INTERFACENAME,
NS_PREFIX);
+
+ // WSAM 'Addressing' element
+ public static final String ADDRESSING = "Addressing";
+ public static final QName ADDRESSING_QNAME = new QName(NS, ADDRESSING,
NS_PREFIX);
+
+ // WSAM 'AnonymousResponses' element
+ public static final String ANONYMOUSRESPONSES = "AnonymousResponses";
+ public static final QName ANONYMOUSRESPONSES_QNAME = new QName(NS,
ANONYMOUSRESPONSES, NS_PREFIX);
+
+ // WSAM 'NonAnonymousResponses' element
+ public static final String NONANONYMOUSRESPONSES =
"NonAnonymousResponses";
+ public static final QName NONANONYMOUSRESPONSES_QNAME = new QName(NS,
NONANONYMOUSRESPONSES, NS_PREFIX);
+ }
+
+ public static final class Attributes
+ {
+ /**
+ * Constructor.
+ */
+ private Attributes()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM 'EndpointName' attribute
+ public static final String ENDPOINTNAME = "EndpointName";
+ public static final QName ENDPOINTNAME_QNAME = new QName(NS, ENDPOINTNAME,
NS_PREFIX);
+
+ // WSAM 'Action' attribute
+ public static final String ACTION = "Action";
+ public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
+
+ }
+ }
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAP.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAP.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAP.java 2011-05-05 11:34:27 UTC
(rev 14255)
@@ -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.ws.api.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<Object> getReferenceParameters();
+
+ public void initializeAsDestination(MAPEndpoint epref);
+
+ public void installOutboundMapOnServerSide(Map<String, Object> requestContext,
MAP map);
+
+ public void installOutboundMapOnClientSide(Map<String, Object> requestContext,
MAP map);
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilder.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilder.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilder.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -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.api.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(Map<String, Object> 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);
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilderFactory.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilderFactory.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPBuilderFactory.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.api.addressing;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+/**
+ * Factory for MAPBuilder; to be used to get an instance of the proper MAPBuilder
+ * implementation which depends on the jbossws stack in use.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public abstract class MAPBuilderFactory
+{
+ private static final String CLASSLOADER_PROVIDER =
"org.jboss.wsf.spi.classloading.ClassLoaderProvider";
+ private static final String CLASSLOADER_PROVIDER_GET_METHOD =
"getDefaultProvider";
+ private static final String CLASSLOADER_PROVIDER_GET_CL_METHOD =
"getServerIntegrationClassLoader";
+ private static final String JBOSSWS_SPI_MODULE = "org.jboss.ws.spi";
+
+ /**
+ * Get the proper MAPBuilderFactory instance according to stack in use;
+ * this uses the ws server integration modular classloader if available
+ * (alternatively the current thread context classloader is used) for
+ * looking up the factory name.
+ *
+ * @return
+ */
+ public static MAPBuilderFactory getInstance()
+ {
+ return getInstance(getServerIntegrationClassLoader());
+ }
+
+ /**
+ * The same as getInstance() except the provided ClassLoader instance
+ * is used to lookup the factory name.
+ *
+ * @param loader
+ * @return
+ */
+ public static MAPBuilderFactory getInstance(ClassLoader loader)
+ {
+ return
(MAPBuilderFactory)ServiceLoader.loadService(MAPBuilderFactory.class.getName(), null,
loader);
+ }
+
+ public abstract MAPBuilder getBuilderInstance();
+
+ private static ClassLoader getServerIntegrationClassLoader()
+ {
+ ClassLoader cl = null;
+ try
+ {
+ //if jboss-modules is available (i.e. AS7 in-container) we get the
org.jboss.ws.spi:main module first,
+ //the we use the ClassLoaderProvider facilities for getting the integration
classloader.
+ //The reason for going this way is in not exposing the ClassLoaderProvider to
the public API,
+ //while MAPBuilderFactory needs to work automatically (no need to specify the
loader to use)
+ final ClassLoader spiLoader = getSPIClassLoader();
+ if (spiLoader != null)
+ {
+ final Class<?> clazz = spiLoader.loadClass(CLASSLOADER_PROVIDER);
+ final Object clProvider =
clazz.getMethod(CLASSLOADER_PROVIDER_GET_METHOD).invoke(null);
+ cl =
(ClassLoader)clazz.getMethod(CLASSLOADER_PROVIDER_GET_CL_METHOD).invoke(clProvider);
+ }
+ }
+ catch (RuntimeException re)
+ {
+ throw re;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return (cl != null) ? cl : getContextClassLoader();
+ }
+
+ private static ClassLoader getSPIClassLoader()
+ {
+ ClassLoader moduleClassLoader = null;
+ try {
+ Class<?> moduleClass =
Class.forName("org.jboss.modules.Module");
+ Class<?> moduleIdentifierClass =
Class.forName("org.jboss.modules.ModuleIdentifier");
+ Class<?> moduleLoaderClass =
Class.forName("org.jboss.modules.ModuleLoader");
+ Object moduleLoader =
moduleClass.getMethod("getBootModuleLoader").invoke(null);
+ Object moduleIdentifier = moduleIdentifierClass.getMethod("create",
String.class).invoke(null, JBOSSWS_SPI_MODULE);
+ Object module = moduleLoaderClass.getMethod("loadModule",
moduleIdentifierClass).invoke(moduleLoader, moduleIdentifier);
+ moduleClassLoader =
(ClassLoader)moduleClass.getMethod("getClassLoader").invoke(module);
+ } catch (Exception e) {
+ //ignore, JBoss Modules might not be available at all
+ Logger log = Logger.getLogger(MAPBuilderFactory.class);
+ if (log.isTraceEnabled())
+ {
+ log.trace("Could not get " + JBOSSWS_SPI_MODULE + " module
classloader: ", e);
+ }
+ }
+ return moduleClassLoader;
+ }
+
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPConstants.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPConstants.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPConstants.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -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.ws.api.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();
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPEndpoint.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPEndpoint.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPEndpoint.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -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.ws.api.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<Object> getReferenceParameters();
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPRelatesTo.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPRelatesTo.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/addressing/MAPRelatesTo.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -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.ws.api.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);
+
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -0,0 +1,79 @@
+/*
+ * 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.api.handler;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * A generic jaxws handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericHandler implements Handler
+{
+ private String handlerName;
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerName(String handlerName)
+ {
+ this.handlerName = handlerName;
+ }
+
+ public boolean handleMessage(MessageContext msgContext)
+ {
+ Boolean outbound =
(Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (outbound == null)
+ throw new IllegalStateException("Cannot obtain required property: " +
MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ public boolean handleFault(MessageContext messagecontext)
+ {
+ return true;
+ }
+
+ public void close(MessageContext messageContext)
+ {
+ }
+
+ public String toString()
+ {
+ return (handlerName != null ? handlerName : super.toString());
+ }
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/handler/GenericLogicalHandler.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/handler/GenericLogicalHandler.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/handler/GenericLogicalHandler.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -0,0 +1,35 @@
+/*
+ * 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.api.handler;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+
+/**
+ * A generic jaxws logical handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public class GenericLogicalHandler<C extends LogicalMessageContext> extends
GenericHandler implements LogicalHandler
+{
+}
Added: api/trunk/src/main/java/org/jboss/ws/api/handler/GenericSOAPHandler.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/handler/GenericSOAPHandler.java
(rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/handler/GenericSOAPHandler.java 2011-05-05
11:34:27 UTC (rev 14255)
@@ -0,0 +1,55 @@
+/*
+ * 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.api.handler;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+
+/**
+ * A generic jaxws soap handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends
GenericHandler implements SOAPHandler
+{
+ // The header blocks that can be processed by this Handler instance
+ private Set<QName> headers = new HashSet<QName>();
+
+ /** Gets the header blocks that can be processed by this Handler instance.
+ */
+ public Set<QName> getHeaders()
+ {
+ return headers;
+ }
+
+ /** Sets the header blocks that can be processed by this Handler instance.
+ */
+ public void setHeaders(Set<QName> headers)
+ {
+ this.headers = headers;
+ }
+}