JBossWS SVN: r2629 - in trunk/jbossws-core/src/java/org/jboss/ws: core/jaxrpc and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-03-16 03:19:47 -0400 (Fri, 16 Mar 2007)
New Revision: 2629
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/MimeHeaderSource.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java
Removed:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/HeaderSource.java
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP12Binding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletHeaderSource.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/Constants.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
Log:
refactor mustUnderstand processing on the client
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -28,7 +28,7 @@
import javax.xml.namespace.QName;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -55,5 +55,5 @@
/** bind an exception to a fault message */
Object bindFaultMessage(Exception ex);
- void setHandlerDelegate(HandlerDelegate delegate);
+ void setHeaderSource(HeaderSource source);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -71,7 +71,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 10-Oct-2004
*/
-public abstract class CommonClient implements StubExt
+public abstract class CommonClient implements StubExt, HeaderSource
{
// provide logging
private static Logger log = Logger.getLogger(CommonClient.class);
@@ -258,6 +258,7 @@
{
// Get the binding from the provider
CommonBinding binding = (CommonBinding)getCommonBindingProvider().getCommonBinding();
+ binding.setHeaderSource(this);
// Create the invocation and sync the input parameters
epInv = new EndpointInvocation(opMetaData);
@@ -330,6 +331,10 @@
Object retObj = null;
if (oneway == false && handlerPass)
{
+ // Verify
+ if (binding instanceof CommonSOAPBinding)
+ ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
+
// Call the response handlers
handlerPass = callResponseHandlerChain(portName, HandlerType.POST);
@@ -344,10 +349,6 @@
handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.ENDPOINT);
handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.PRE);
- // BP-1.0 R1027
- if (handlerPass)
- HandlerChainBaseImpl.checkMustUnderstand(reqContext, new String[] {});
-
// Check if protocol handlers modified the payload
if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -76,7 +76,7 @@
Set<String> roles = getRoles();
boolean isActor = actor == null || actor.length() == 0 || Constants.URI_SOAP11_NEXT_ACTOR.equals(actor) || roles.contains(actor);
- if (isActor && !handlerDelegate.getHeaders().contains(name))
+ if (isActor && !headerSource.getHeaders().contains(name))
{
QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
String faultString = "Unprocessed 'mustUnderstand' header element: " + element.getElementName();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP12Binding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP12Binding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP12Binding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -69,7 +69,7 @@
Set<String> roles = getRoles();
boolean isActor = actor == null || actor.length() == 0 || Constants.URI_SOAP11_NEXT_ACTOR.equals(actor) || roles.contains(actor);
- if (isActor && !handlerDelegate.getHeaders().contains(name))
+ if (isActor && !headerSource.getHeaders().contains(name))
{
// How do we pass NotUnderstood blocks? They are not in the fault element
QName faultCode = SOAPConstants.SOAP_MUSTUNDERSTAND_FAULT;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -56,7 +56,7 @@
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
@@ -95,7 +95,7 @@
private boolean mtomEnabled;
- protected HandlerDelegate handlerDelegate;
+ protected HeaderSource headerSource;
/** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
@@ -837,9 +837,9 @@
}
}
- public void setHandlerDelegate(HandlerDelegate delegate)
+ public void setHeaderSource(HeaderSource source)
{
- handlerDelegate = delegate;
+ headerSource = source;
}
private void handleException(Exception ex) throws BindingException
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -25,14 +25,10 @@
import java.util.Set;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.Constants;
import org.jboss.ws.core.CommonSOAP11Binding;
+import org.jboss.ws.core.RoleSource;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -71,9 +67,9 @@
@Override
public Set<String> getRoles()
{
- if (!(handlerDelegate instanceof HandlerDelegateJAXRPC))
- throw new IllegalStateException("HandlerDelegateJAXRPC was not available");
+ if (!(headerSource instanceof RoleSource))
+ throw new IllegalStateException("RoleSource was not available");
- return ((HandlerDelegateJAXRPC)handlerDelegate).getRoles();
+ return ((RoleSource)headerSource).getRoles();
}
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -28,6 +28,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.core.CommonSOAP12Binding;
+import org.jboss.ws.core.RoleSource;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -61,10 +62,10 @@
@Override
public Set<String> getRoles()
{
- if (!(handlerDelegate instanceof HandlerDelegateJAXRPC))
- throw new IllegalStateException("HandlerDelegateJAXRPC was not available");
+ if (!(headerSource instanceof RoleSource))
+ throw new IllegalStateException("RoleSource was not available");
- return ((HandlerDelegateJAXRPC)handlerDelegate).getRoles();
+ return ((RoleSource)headerSource).getRoles();
}
protected void throwFaultException(SOAPFaultImpl fault) throws Exception
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -26,6 +26,7 @@
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -48,6 +49,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.CommonClient;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.RoleSource;
import org.jboss.ws.core.WSTimeoutException;
import org.jboss.ws.core.jaxrpc.SchemaGenerator;
import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
@@ -76,7 +78,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 10-Oct-2004
*/
-public class CallImpl extends CommonClient implements Call
+public class CallImpl extends CommonClient implements Call, RoleSource
{
// provide logging
private static Logger log = Logger.getLogger(CallImpl.class);
@@ -650,4 +652,23 @@
// Reinitialize the client handler chain
jaxrpcService.setupHandlerChain(epMetaData);
}
-}
+
+ public Set<QName> getHeaders()
+ {
+ HandlerChainBaseImpl handlerChain = (HandlerChainBaseImpl)jaxrpcService.getHandlerChain(epMetaData.getPortName());
+
+ return (handlerChain != null) ? handlerChain.getHeaders() : new HashSet<QName>();
+ }
+
+ public Set<String> getRoles()
+ {
+ HandlerChainBaseImpl handlerChain = (HandlerChainBaseImpl)jaxrpcService.getHandlerChain(epMetaData.getPortName());
+
+ Set<String> set = new HashSet<String>();
+ String[] roles = handlerChain.getRoles();
+ if (roles != null)
+ Collections.addAll(set, roles);
+
+ return set;
+ }
+}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -117,6 +117,13 @@
Collections.addAll(headers, handlerHeaders);
}
}
+
+ public Set<QName> getHeaders()
+ {
+ HashSet<QName> set = new HashSet<QName>();
+ pullHeaders(set);
+ return set;
+ }
/**
* Initialize the a handler chain with the given handlers infos
@@ -521,70 +528,6 @@
}
/**
- * R1027 A RECEIVER MUST generate a "soap:MustUnderstand" fault when a
- * message contains a mandatory header block (i.e., one that has a
- * soap:mustUnderstand attribute with the value "1") targeted at the
- * receiver (via soap:actor) that the receiver does not understand.
- */
- public static void checkMustUnderstand(CommonMessageContext msgContext, String[] roles)
- {
- SOAPHeaderElement mustUnderstandHeaderElement = null;
- List roleList = (roles != null ? Arrays.asList(roles) : new ArrayList());
- try
- {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
-
- // A SOAPHeaderElement is possibly bound to the endpoint operation
- // in order to check that we need a the opMetaData
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- if (opMetaData == null)
- {
- // The security handler must have decrypted the incomming message
- // before the dispatch target operation can be known
- EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
- }
-
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- if (soapEnvelope != null && soapEnvelope.getHeader() != null)
- {
- Iterator it = soapEnvelope.getHeader().examineAllHeaderElements();
- while (it.hasNext() && mustUnderstandHeaderElement == null)
- {
- SOAPHeaderElement soapHeaderElement = (SOAPHeaderElement)it.next();
- Name name = soapHeaderElement.getElementName();
- QName xmlName = new QName(name.getURI(), name.getLocalName());
-
- ParameterMetaData paramMetaData = (opMetaData != null ? opMetaData.getParameter(xmlName) : null);
- boolean isBoundHeader = (paramMetaData != null && paramMetaData.isInHeader());
-
- if (soapHeaderElement.getMustUnderstand() && isBoundHeader == false)
- {
- String actor = soapHeaderElement.getActor();
- boolean noActor = (actor == null || actor.length() == 0);
- boolean nextActor = Constants.URI_SOAP11_NEXT_ACTOR.equals(actor);
- if (noActor || nextActor || roleList.contains(actor))
- {
- mustUnderstandHeaderElement = soapHeaderElement;
- }
- }
- }
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot check mustUnderstand for headers", ex);
- }
-
- if (mustUnderstandHeaderElement != null)
- {
- QName faultCode = Constants.SOAP11_FAULT_CODE_MUST_UNDERSTAND;
- String faultString = "Unprocessed 'mustUnderstand' header element: " + mustUnderstandHeaderElement.getElementName();
- throw new SOAPFaultException(faultCode, faultString, null, null);
- }
- }
-
- /**
* An entry in the handler list
*/
private class HandlerEntry
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -36,7 +36,7 @@
import javax.xml.rpc.handler.HandlerInfo;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
@@ -50,7 +50,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public class HandlerDelegateJAXRPC extends HandlerDelegate
+public class HandlerDelegateJAXRPC extends ServerHandlerDelegate
{
// provide logging
private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -33,8 +33,8 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.HandlerDelegate;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -99,7 +99,7 @@
throw new NotImplementedException();
}
- public void setHandlerDelegate(HandlerDelegate delegate)
+ public void setHeaderSource(HeaderSource source)
{
// Not needed
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -36,10 +36,11 @@
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -174,7 +175,7 @@
throw new NotImplementedException();
}
- public void setHandlerDelegate(HandlerDelegate delegate)
+ public void setHeaderSource(HeaderSource source)
{
// Not needed
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -38,10 +38,11 @@
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPBodyImpl;
@@ -189,7 +190,7 @@
throw new NotImplementedException();
}
- public void setHandlerDelegate(HandlerDelegate delegate)
+ public void setHeaderSource(HeaderSource source)
{
// Not neeeded
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -25,9 +25,11 @@
import java.rmi.RemoteException;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Observable;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.ws.Binding;
@@ -37,6 +39,7 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.http.HTTPException;
import javax.xml.ws.soap.SOAPBinding;
@@ -47,7 +50,6 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonClient;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.StubExt;
import org.jboss.ws.core.jaxws.binding.BindingExt;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerChainExecutor;
@@ -56,7 +58,6 @@
import org.jboss.ws.core.jaxws.handler.PortInfoImpl;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -331,4 +332,21 @@
ConfigurationProvider configProvider = (ConfigurationProvider)getEndpointMetaData();
configProvider.setConfigName(configName, configFile);
}
-}
+
+ public Set<QName> getHeaders()
+ {
+ if (handlerResolver instanceof HandlerResolverImpl)
+ return ((HandlerResolverImpl)handlerResolver).getHeaders();
+
+ Set<QName> headers = new HashSet<QName>();
+ List<Handler> handlerChain = handlerResolver.getHandlerChain(new PortInfoImpl(epMetaData));
+ if (handlerChain != null)
+ {
+ for (Handler handler : handlerChain)
+ if (handler instanceof SOAPHandler)
+ headers.addAll(((SOAPHandler)handler).getHeaders());
+ }
+
+ return headers;
+ }
+}
\ No newline at end of file
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -33,7 +33,7 @@
import javax.xml.ws.handler.PortInfo;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.HandlerDelegate;
+import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -45,7 +45,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 19-Jan-2005
*/
-public class HandlerDelegateJAXWS extends HandlerDelegate
+public class HandlerDelegateJAXWS extends ServerHandlerDelegate
{
// provide logging
private static Logger log = Logger.getLogger(HandlerDelegateJAXWS.class);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -73,7 +73,7 @@
protected ServiceEndpointInfo seInfo;
protected CommonBindingProvider bindingProvider;
- protected HandlerDelegate delegate;
+ protected ServerHandlerDelegate delegate;
/** Initialize the service endpoint */
public void init(ServiceEndpointInfo seInfo)
@@ -147,7 +147,7 @@
EndpointInvocation epInv = null;
OperationMetaData opMetaData = null;
CommonBinding binding = bindingProvider.getCommonBinding();
- binding.setHandlerDelegate(delegate);
+ binding.setHeaderSource(delegate);
// call the handler chain
boolean handlersPass = callRequestHandlerChain(sepMetaData, HandlerType.PRE);
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-// $Id$
-
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.metadata.config.Configurable;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-Jan-2005
- */
-public abstract class HandlerDelegate implements Configurable
-{
- private ServerEndpointMetaData sepMetaData;
-
- public HandlerDelegate(ServerEndpointMetaData sepMetaData)
- {
- this.sepMetaData = sepMetaData;
- }
-
- public abstract boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
-
- public abstract boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
-
- public abstract boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex);
-
- public abstract void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
-
- protected boolean isInitialized()
- {
- return sepMetaData.isHandlersInitialized();
- }
-
- protected void setInitialized(boolean flag)
- {
- sepMetaData.setHandlersInitialized(flag);
- }
-
- public abstract Set<QName> getHeaders();
-}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/HeaderSource.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/HeaderSource.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/HeaderSource.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -1,49 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.server;
-
-import javax.xml.soap.MimeHeaders;
-
-/**
- * Generic abstraction of a source that allows getting and setting
- * of transport specific MIME headers.
- *
- * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
- */
-public interface HeaderSource
-{
- /**
- * Gets the MIME headers from an inbound source. An implementation may
- * return <code>null</code> if the transport does not provide headers.
- *
- * @return the MIME headers
- */
- public MimeHeaders getMimeHeaders();
-
- /**
- * Sets the MIME headers for an outbound source. An implementation may
- * return <code>null</code> if the transport does not provide headers.
- *
- * @param headers the MIME headers
- */
- public void setMimeHeaders(MimeHeaders headers);
-}
Copied: trunk/jbossws-core/src/java/org/jboss/ws/core/server/MimeHeaderSource.java (from rev 2628, trunk/jbossws-core/src/java/org/jboss/ws/core/server/HeaderSource.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/MimeHeaderSource.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/MimeHeaderSource.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.core.server;
+
+import javax.xml.soap.MimeHeaders;
+
+/**
+ * Generic abstraction of a source that allows getting and setting
+ * of transport specific MIME headers.
+ *
+ * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
+ */
+public interface MimeHeaderSource
+{
+ /**
+ * Gets the MIME headers from an inbound source. An implementation may
+ * return <code>null</code> if the transport does not provide headers.
+ *
+ * @return the MIME headers
+ */
+ public MimeHeaders getMimeHeaders();
+
+ /**
+ * Sets the MIME headers for an outbound source. An implementation may
+ * return <code>null</code> if the transport does not provide headers.
+ *
+ * @param headers the MIME headers
+ */
+ public void setMimeHeaders(MimeHeaders headers);
+}
Copied: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java (from rev 2628, trunk/jbossws-core/src/java/org/jboss/ws/core/server/HandlerDelegate.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServerHandlerDelegate.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.server;
+
+// $Id$
+
+import org.jboss.ws.core.HeaderSource;
+import org.jboss.ws.metadata.config.Configurable;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public abstract class ServerHandlerDelegate implements Configurable, HeaderSource
+{
+ private ServerEndpointMetaData sepMetaData;
+
+ public ServerHandlerDelegate(ServerEndpointMetaData sepMetaData)
+ {
+ this.sepMetaData = sepMetaData;
+ }
+
+ public abstract boolean callRequestHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
+
+ public abstract boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
+
+ public abstract boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex);
+
+ public abstract void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type);
+
+ protected boolean isInitialized()
+ {
+ return sepMetaData.isHandlersInitialized();
+ }
+
+ protected void setInitialized(boolean flag)
+ {
+ sepMetaData.setHandlersInitialized(flag);
+ }
+}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -157,7 +157,7 @@
/**
* Handle a request to this web service endpoint
*/
- public SOAPMessage handleRequest(HeaderSource headerSource, EndpointContext context, InputStream inputStream) throws BindingException
+ public SOAPMessage handleRequest(MimeHeaderSource headerSource, EndpointContext context, InputStream inputStream) throws BindingException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
@@ -256,7 +256,7 @@
/** Set response mime headers
*/
- private void postProcessResponse(HeaderSource headerSource, SOAPMessage resMessage)
+ private void postProcessResponse(MimeHeaderSource headerSource, SOAPMessage resMessage)
{
try
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletHeaderSource.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletHeaderSource.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServletHeaderSource.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -42,7 +42,7 @@
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
* @author Thomas.Diesler(a)jboss.org
*/
-public class ServletHeaderSource implements HeaderSource
+public class ServletHeaderSource implements MimeHeaderSource
{
private HttpServletRequest req;
private HttpServletResponse res;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/Constants.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/Constants.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/Constants.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.extensions.security;
+import javax.xml.namespace.QName;
+
import org.apache.xml.security.utils.EncryptionConstants;
@@ -67,4 +69,6 @@
public static final String XENC_ELEMENT_TYPE = EncryptionConstants.TYPE_ELEMENT;
public static final String XENC_CONTENT_TYPE = EncryptionConstants.TYPE_CONTENT;
+
+ public static final QName WSSE_HEADER_QNAME = new QName(WSSE_NS, "Security");
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -53,7 +54,7 @@
public QName[] getHeaders()
{
- return null;
+ return new QName[] {Constants.WSSE_HEADER_QNAME};
}
protected boolean handleInboundSecurity(MessageContext msgContext)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2007-03-16 00:53:02 UTC (rev 2628)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2007-03-16 07:19:47 UTC (rev 2629)
@@ -24,7 +24,11 @@
// $Id$
import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
@@ -32,6 +36,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -49,6 +54,20 @@
{
// provide logging
private static Logger log = Logger.getLogger(WSSecurityHandler.class);
+
+ private static Set<QName> headers;
+
+ static
+ {
+ HashSet<QName> set = new HashSet<QName>();
+ set.add(Constants.WSSE_HEADER_QNAME);
+ headers = Collections.unmodifiableSet(set);
+ }
+
+ public Set<QName> getHeaders()
+ {
+ return headers;
+ }
protected boolean handleInboundSecurity(MessageContext msgContext)
{
17 years, 9 months
JBossWS SVN: r2627 - in trunk: jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerscope and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 20:29:57 -0400 (Thu, 15 Mar 2007)
New Revision: 2627
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
Log:
[JBWS-1578] Redefine order of jaxws handlers
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java 2007-03-15 23:53:38 UTC (rev 2626)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java 2007-03-16 00:29:57 UTC (rev 2627)
@@ -23,11 +23,6 @@
// $Id$
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -81,16 +76,6 @@
public void addChild(UnifiedHandlerChainsMetaData handlerConfig, UnifiedHandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI,
String localName)
{
- // TODO: remove this CTS hack
- QName portPattern = handlerChain.getPortNamePattern();
- if (new QName("http://dlhandlerservice.org/wsdl", "HelloPort").equals(portPattern))
- {
- List<UnifiedHandlerMetaData> orgHandlers = new ArrayList<UnifiedHandlerMetaData>(handlerChain.getHandlers());
- handlerChain.getHandlers().clear();
- for (int i = 1; i <= orgHandlers.size(); i++)
- handlerChain.addHandler(orgHandlers.get(orgHandlers.size() - i));
- }
-
handlerConfig.addHandlerChain(handlerChain);
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-03-15 23:53:38 UTC (rev 2626)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-03-16 00:29:57 UTC (rev 2627)
@@ -63,21 +63,21 @@
expStr.append(":PortClientHandler");
expStr.append(":PortWildcardClientHandler");
expStr.append(":GeneralClientHandler");
+ expStr.append(":GeneralServerHandler");
+ expStr.append(":PortWildcardServerHandler");
+ expStr.append(":PortServerHandler");
+ expStr.append(":ServiceWildcardServerHandler");
+ expStr.append(":ServiceServerHandler");
+ expStr.append(":SOAPServerHandler");
expStr.append(":SOAP12ServerHandler");
+ expStr.append(":endpoint");
+ expStr.append(":SOAP12ServerHandler");
expStr.append(":SOAPServerHandler");
expStr.append(":ServiceServerHandler");
expStr.append(":ServiceWildcardServerHandler");
expStr.append(":PortServerHandler");
expStr.append(":PortWildcardServerHandler");
expStr.append(":GeneralServerHandler");
- expStr.append(":endpoint");
- expStr.append(":GeneralServerHandler");
- expStr.append(":PortWildcardServerHandler");
- expStr.append(":PortServerHandler");
- expStr.append(":ServiceWildcardServerHandler");
- expStr.append(":ServiceServerHandler");
- expStr.append(":SOAPServerHandler");
- expStr.append(":SOAP12ServerHandler");
expStr.append(":GeneralClientHandler");
expStr.append(":PortWildcardClientHandler");
expStr.append(":PortClientHandler");
17 years, 9 months
JBossWS SVN: r2626 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/handler and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 19:53:38 -0400 (Thu, 15 Mar 2007)
New Revision: 2626
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
Log:
[JBWS-1578] Redefine order of jaxws handlers
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -141,7 +141,7 @@
executorMap.put(type, executor);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- return executor.handleRequest(msgContext);
+ return executor.handleMessage(msgContext);
}
@Override
@@ -149,7 +149,7 @@
{
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
HandlerChainExecutor executor = executorMap.get(type);
- return (executor != null ? executor.handleResponse(msgContext) : true);
+ return (executor != null ? executor.handleMessage(msgContext) : true);
}
@Override
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -34,6 +34,7 @@
import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.MessageContext.Scope;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
@@ -57,10 +58,12 @@
private EndpointMetaData epMetaData;
// The list of handlers
protected List<Handler> handlers = new ArrayList<Handler>();
- // The list of handlers tp close
- protected List<Handler> closeHandlers = new ArrayList<Handler>();
+ // The list of executed handlers
+ protected List<Handler> executedHandlers = new ArrayList<Handler>();
// The index of the first handler that returned false during processing
protected int falseIndex = -1;
+ // True if the current direction is outbound
+ protected Boolean isOutbound;
public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler> unsortedChain)
{
@@ -92,47 +95,61 @@
public void close(MessageContext msgContext)
{
log.debug("close");
- int handlerIndex = closeHandlers.size() - 1;
- for (; handlerIndex >= 0; handlerIndex--)
+ CommonMessageContext context = (CommonMessageContext)msgContext;
+ for (int index = 1; index <= executedHandlers.size(); index++)
{
- Handler currHandler = closeHandlers.get(handlerIndex);
- currHandler.close(msgContext);
+ Handler currHandler = executedHandlers.get(executedHandlers.size() - index);
+ try
+ {
+ context.setCurrentScope(Scope.HANDLER);
+ currHandler.close(msgContext);
+ }
+ finally
+ {
+ context.setCurrentScope(Scope.APPLICATION);
+ }
}
}
- public boolean handleRequest(MessageContext msgContext)
+ public boolean handleMessage(MessageContext msgContext)
{
+ isOutbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (isOutbound == null)
+ throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
boolean doNext = true;
if (handlers.size() > 0)
{
- log.debug("Enter: handleRequest");
+ log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage");
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- int handlerIndex = 0;
+ int index = getFirstHandler();
Handler currHandler = null;
try
{
String lastMessageTrace = null;
- for (; doNext && handlerIndex < handlers.size(); handlerIndex++)
+ while (doNext && index >= 0)
{
- currHandler = handlers.get(handlerIndex);
+ currHandler = handlers.get(index);
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled() && msgContext instanceof SOAPMessageContext)
{
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
+ SOAPPart soapPart = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart();
lastMessageTrace = traceSOAPPart("BEFORE handleRequest - " + currHandler, soapPart, lastMessageTrace);
}
- doNext = handleMessage(currHandler, soapContext);
+ doNext = handleMessage(currHandler, msgContext);
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled() && msgContext instanceof SOAPMessageContext)
{
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
+ SOAPPart soapPart = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart();
lastMessageTrace = traceSOAPPart("AFTER handleRequest - " + currHandler, soapPart, lastMessageTrace);
}
+
+ if (doNext)
+ index = getNextIndex(index);
}
}
catch (RuntimeException ex)
@@ -144,124 +161,96 @@
{
// we start at this index in the response chain
if (doNext == false)
- falseIndex = handlerIndex;
+ falseIndex = index;
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleRequest with status: " + doNext);
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage with status: " + doNext);
}
}
return doNext;
}
- public boolean handleResponse(MessageContext msgContext)
+ private int getFirstHandler()
{
- boolean doNext = true;
-
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
- if (handlers.size() > 0)
+ int index;
+ if (falseIndex == -1)
{
- log.debug("Enter: handleResponse");
-
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex - 1;
-
- Handler currHandler = null;
- try
- {
- String lastMessageTrace = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
- {
- currHandler = handlers.get(handlerIndex);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("BEFORE handleResponse - " + currHandler, soapPart, lastMessageTrace);
- }
-
- doNext = handleMessage(currHandler, soapContext);
-
- if (log.isTraceEnabled())
- {
- SOAPPart soapPart = soapContext.getMessage().getSOAPPart();
- lastMessageTrace = traceSOAPPart("AFTER handleResponse - " + currHandler, soapPart, lastMessageTrace);
- }
- }
- }
- catch (RuntimeException ex)
- {
- doNext = false;
- processHandlerFailure(ex);
- }
- finally
- {
- // we start at this index in the fault chain
- if (doNext == false)
- falseIndex = handlerIndex;
-
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleResponse with status: " + doNext);
- }
+ index = (isOutbound ? 0 : handlers.size() - 1);
}
+ else
+ {
+ index = (isOutbound ? falseIndex - 1 : falseIndex + 1);
+ }
+ return index;
+ }
- return doNext;
+ private int getNextIndex(int prevIndex)
+ {
+ int nextIndex = (isOutbound ? prevIndex + 1 : prevIndex - 1);
+ if (nextIndex >= handlers.size())
+ nextIndex = -1;
+ return nextIndex;
}
public boolean handleFault(MessageContext msgContext, Exception ex)
{
+ isOutbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (isOutbound == null)
+ throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
boolean doNext = true;
if (handlers.size() > 0)
{
- log.debug("Enter: handleFault");
+ log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundFault");
- SOAPMessageContextJAXWS soapContext = (SOAPMessageContextJAXWS)msgContext;
- soapContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- SOAPMessage soapMessage = soapContext.getMessage();
-
- // If the message is not already a fault message then it is replaced with a fault message
- try
+ if (msgContext instanceof SOAPMessageContext)
{
- if (soapMessage == null || soapMessage.getSOAPBody().getFault() == null)
+ SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
+ SOAPMessage soapMessage = soapContext.getMessage();
+
+ // If the message is not already a fault message then it is replaced with a fault message
+ try
{
- soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
- soapContext.setMessage(soapMessage);
+ if (soapMessage == null || soapMessage.getSOAPBody().getFault() == null)
+ {
+ soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ soapContext.setMessage(soapMessage);
+ }
}
+ catch (SOAPException se)
+ {
+ throw new WebServiceException("Cannot convert exception to fault message", ex);
+ }
}
- catch (SOAPException se)
- {
- throw new WebServiceException("Cannot convert exception to fault message", ex);
- }
-
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex - 1;
-
+
+ msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+
+ int index = getFirstHandler();
Handler currHandler = null;
try
{
String lastMessageTrace = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
+ while (doNext && index >= 0)
{
- currHandler = handlers.get(handlerIndex);
+ currHandler = handlers.get(index);
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled() && msgContext instanceof SOAPMessageContext)
{
- SOAPPart soapPart = soapMessage.getSOAPPart();
+ SOAPPart soapPart = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart();
lastMessageTrace = traceSOAPPart("BEFORE handleFault - " + currHandler, soapPart, lastMessageTrace);
}
- doNext = handleFault(currHandler, soapContext);
+ doNext = handleFault(currHandler, msgContext);
- if (log.isTraceEnabled())
+ if (log.isTraceEnabled() && msgContext instanceof SOAPMessageContext)
{
- SOAPPart soapPart = soapMessage.getSOAPPart();
+ SOAPPart soapPart = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart();
lastMessageTrace = traceSOAPPart("AFTER handleFault - " + currHandler, soapPart, lastMessageTrace);
}
+
+ index = getNextIndex(index);
}
}
catch (RuntimeException rte)
@@ -271,12 +260,8 @@
}
finally
{
- // we start at this index in the response chain
- if (doNext == false)
- falseIndex = handlerIndex;
-
- soapContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleFault with status: " + doNext);
+ msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundFault with status: " + doNext);
}
}
@@ -297,61 +282,54 @@
throw new WebServiceException(ex);
}
- private boolean handleMessage(Handler currHandler, SOAPMessageContextJAXWS msgContext)
+ private boolean handleMessage(Handler currHandler, MessageContext msgContext)
{
- MessageContext handlerContext = msgContext;
- if (currHandler instanceof LogicalHandler)
+ CommonMessageContext context = (CommonMessageContext)msgContext;
+ if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
- handlerContext = new LogicalMessageContextImpl(msgContext);
+ msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
}
- if (closeHandlers.contains(currHandler) == false)
- closeHandlers.add(currHandler);
-
-
- boolean doNext = false;
+ if (executedHandlers.contains(currHandler) == false)
+ executedHandlers.add(currHandler);
+
try
{
- msgContext.setCurrentScope(Scope.HANDLER);
- doNext = currHandler.handleMessage(handlerContext);
+ context.setCurrentScope(Scope.HANDLER);
+ return currHandler.handleMessage(msgContext);
}
finally
{
- msgContext.setCurrentScope(Scope.APPLICATION);
+ context.setCurrentScope(Scope.APPLICATION);
}
-
- return doNext;
}
- private boolean handleFault(Handler currHandler, SOAPMessageContextJAXWS msgContext)
+ private boolean handleFault(Handler currHandler, MessageContext msgContext)
{
- MessageContext handlerContext = msgContext;
- if (currHandler instanceof LogicalHandler)
+ CommonMessageContext context = (CommonMessageContext)msgContext;
+ if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
-
- handlerContext = new LogicalMessageContextImpl(msgContext);
+
+ msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
}
- if (closeHandlers.contains(currHandler) == false)
- closeHandlers.add(currHandler);
-
- boolean doNext = false;
+ if (executedHandlers.contains(currHandler) == false)
+ executedHandlers.add(currHandler);
+
try
{
- msgContext.setCurrentScope(Scope.HANDLER);
- doNext = currHandler.handleFault(handlerContext);
+ context.setCurrentScope(Scope.HANDLER);
+ return currHandler.handleFault(msgContext);
}
finally
{
- msgContext.setCurrentScope(Scope.APPLICATION);
+ context.setCurrentScope(Scope.APPLICATION);
}
-
- return doNext;
}
/**
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -76,7 +76,7 @@
HandlerChainExecutor executor = createExecutor(sepMetaData, type);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- return executor.handleRequest(msgContext);
+ return executor.handleMessage(msgContext);
}
public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
@@ -84,7 +84,7 @@
log.debug("callResponseHandlerChain: " + type);
HandlerChainExecutor executor = getExecutor(type);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
- return (executor != null ? executor.handleResponse(msgContext) : true);
+ return (executor != null ? executor.handleMessage(msgContext) : true);
}
public void closeHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -106,46 +106,13 @@
if (outbound == null)
throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
- // Preserve addressing properties
- SOAPAddressingProperties addrProps = (SOAPAddressingProperties)reqContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
- // MTOM setting need to pass past pivot
- boolean mtomEnabled = XOPContext.isMTOMEnabled();
-
-
MessageContextAssociation.popMessageContext();
SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
resContext.setSOAPMessage(null);
// Reverse the direction
- resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, !outbound);
+ resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
- /*
- resContext.clear();
-
- resContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, mtomEnabled);
- resContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
-
- // Copy the handler scoped properties
- try
- {
- reqContext.setCurrentScope(Scope.HANDLER);
- resContext.setCurrentScope(Scope.HANDLER);
- for(String key : reqContext.keySet())
- {
- if (((MessageContextJAXWS)reqContext).getScope(key) == Scope.HANDLER)
- {
- Object value = reqContext.get(key);
- resContext.put(key, value);
- }
- }
- }
- finally
- {
- reqContext.setCurrentScope(Scope.APPLICATION);
- resContext.setCurrentScope(Scope.APPLICATION);
- }
- */
-
MessageContextAssociation.pushMessageContext(resContext);
return resContext;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -233,7 +233,7 @@
SOAPMessage soapMessage = msgContext.getSOAPMessage();
if (soapMessage != null && soapMessage.getSOAPPart().getEnvelope() != null)
{
- if (soapMessage.getSOAPPart().getEnvelope().getBody().getFault() != null)
+ if (soapMessage.getSOAPPart().getEnvelope().getBody().hasFault())
{
seMetrics.processFaultMessage(beginProcessing);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -460,7 +460,7 @@
// Also, a one-way operation must show up as empty content, and can be detected
// by a null envelope.
SOAPEnvelope soapEnv = part.getEnvelope();
- boolean isFault = soapEnv != null && soapEnv.getBody().getFault() != null;
+ boolean isFault = soapEnv != null && soapEnv.getBody().hasFault();
if (isFault && httpResponse != null)
{
httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -79,6 +79,7 @@
private Source payload;
private boolean isDOMValid = true;
private boolean isModifiedFromSource;
+ private boolean hasFault;
public SOAPBodyImpl(String prefix, String namespace)
{
@@ -112,7 +113,7 @@
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child.getElementName());
- expandToDOM();
+ expandToDOM(false);
if ((child instanceof SOAPBodyElement) == false)
child = convertToBodyElement(child);
@@ -123,7 +124,7 @@
public SOAPBodyElement addBodyElement(Name name) throws SOAPException
{
log.trace("addBodyElement: " + name);
- expandToDOM();
+ expandToDOM(false);
SOAPBodyElement child = new SOAPBodyElementDoc(name);
return (SOAPBodyElement)addChildElement(child);
}
@@ -131,7 +132,7 @@
public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
{
log.trace("addBodyElement: " + qname);
- expandToDOM();
+ expandToDOM(false);
SOAPBodyElement child = new SOAPBodyElementDoc(qname);
return (SOAPBodyElement)addChildElement(child);
}
@@ -139,7 +140,7 @@
public SOAPBodyElement addDocument(Document doc) throws SOAPException
{
log.trace("addDocument");
- expandToDOM();
+ expandToDOM(false);
Element rootElement = doc.getDocumentElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPElement soapElement = soapFactory.createElement(rootElement);
@@ -149,20 +150,21 @@
public SOAPFault addFault() throws SOAPException
{
log.trace("addFault");
- expandToDOM();
+ expandToDOM(true);
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(soapFault.getDefaultFaultCode());
+ hasFault = true;
return soapFault;
}
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
{
log.trace("addFault");
- expandToDOM();
+ expandToDOM(true);
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -170,13 +172,14 @@
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
+ hasFault = true;
return soapFault;
}
public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
{
log.trace("addFault");
- expandToDOM();
+ expandToDOM(true);
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -184,13 +187,14 @@
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
+ hasFault = true;
return soapFault;
}
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
{
log.trace("addFault");
- expandToDOM();
+ expandToDOM(true);
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -198,13 +202,14 @@
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
+ hasFault = true;
return soapFault;
}
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
{
log.trace("addFault");
- expandToDOM();
+ expandToDOM(true);
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -212,22 +217,24 @@
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
+ hasFault = true;
return soapFault;
}
public SOAPFault getFault()
{
log.trace("getFault");
- expandToDOM();
+ expandToDOM(true);
Iterator it = faultIterator();
- return it.hasNext() ? (SOAPFault)it.next() : null;
+ SOAPFault soapFault = it.hasNext() ? (SOAPFault)it.next() : null;
+ hasFault = (soapFault != null);
+ return soapFault;
}
public boolean hasFault()
{
log.trace("hasFault");
- expandToDOM();
- return faultIterator().hasNext();
+ return hasFault;
}
private Iterator faultIterator()
@@ -238,7 +245,7 @@
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
- expandToDOM();
+ expandToDOM(false);
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -248,7 +255,7 @@
public Node insertBefore(Node newChild, Node refChild) throws DOMException
{
log.trace("insertBefore: " + newChild.getNodeName());
- expandToDOM();
+ expandToDOM(false);
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -258,7 +265,7 @@
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
{
log.trace("replaceChild: " + newChild.getNodeName());
- expandToDOM();
+ expandToDOM(false);
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -268,42 +275,42 @@
public Iterator getChildElements()
{
log.trace("getChildElements");
- expandToDOM();
+ expandToDOM(false);
return super.getChildElements();
}
public Iterator getChildElements(Name name)
{
log.trace("getChildElements: " + name);
- expandToDOM();
+ expandToDOM(false);
return super.getChildElements(name);
}
public NodeList getChildNodes()
{
log.trace("getChildNodes");
- expandToDOM();
+ expandToDOM(false);
return super.getChildNodes();
}
public Node getFirstChild()
{
log.trace("getFirstChild");
- expandToDOM();
+ expandToDOM(false);
return super.getFirstChild();
}
public Node getLastChild()
{
log.trace("getLastChild");
- expandToDOM();
+ expandToDOM(false);
return super.getLastChild();
}
public boolean hasChildNodes()
{
log.trace("hasChildNodes");
- expandToDOM();
+ expandToDOM(false);
return super.hasChildNodes();
}
@@ -325,7 +332,7 @@
return new SOAPBodyElementDoc(element);
}
- private void expandToDOM()
+ private void expandToDOM(boolean handleFault)
{
if (isDOMValid == false)
{
@@ -335,7 +342,7 @@
if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
{
Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (Boolean.TRUE.equals(allowExpand) == false)
+ if (handleFault == false && allowExpand == false)
throw new WSException("Expanding content element to DOM");
}
@@ -455,7 +462,7 @@
public Document extractContentAsDocument() throws SOAPException
{
log.trace("extractContentAsDocument");
- expandToDOM();
+ expandToDOM(false);
Iterator childElements = DOMUtils.getChildElements(this);
// zero child elements?
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -43,19 +43,19 @@
public void testHandlerChainOnWebServiceRef() throws Throwable
{
String resStr = invokeTestClient("testService1", "Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|LogIn|AuthIn|RoutIn|endpoint|RoutOut|AuthOut|LogOut|RoutIn|AuthIn|LogIn", resStr);
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
}
public void testHandlerChainNegative() throws Throwable
{
String resStr = invokeTestClient("testService2", "Kermit");
- assertEquals("Kermit|LogIn|AuthIn|RoutIn|endpoint|RoutOut|AuthOut|LogOut", resStr);
+ assertEquals("Kermit|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut", resStr);
}
public void testHandlerChainOverride() throws Throwable
{
String resStr = invokeTestClient("testService3", "Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|LogIn|AuthIn|RoutIn|endpoint|RoutOut|AuthOut|LogOut|RoutIn|AuthIn|LogIn", resStr);
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
}
private String invokeTestClient(String testName, String reqStr) throws Throwable
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -66,7 +66,7 @@
bindingProvider.getBinding().setHandlerChain(handlerChain);
String resStr = port.echo("Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|LogIn|AuthIn|RoutIn|endpoint|RoutOut|AuthOut|LogOut|RoutIn|AuthIn|LogIn", resStr);
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
}
public void testHandlerChainOnServiceEndpointInterface() throws Exception
@@ -78,6 +78,6 @@
EndpointWithHandlerChain port = (EndpointWithHandlerChain)service.getPort(EndpointWithHandlerChain.class);
String resStr = port.echo("Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|LogIn|AuthIn|RoutIn|endpoint|RoutOut|AuthOut|LogOut|RoutIn|AuthIn|LogIn", resStr);
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
}
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -63,13 +63,13 @@
expStr.append(":LogicalClientHandler");
expStr.append(":SOAP11ClientHandler");
expStr.append(":PortClientHandler");
+ expStr.append(":PortServerHandler");
+ expStr.append(":SOAP11ServerHandler");
expStr.append(":LogicalServerHandler");
+ expStr.append(":endpoint");
+ expStr.append(":LogicalServerHandler");
expStr.append(":SOAP11ServerHandler");
expStr.append(":PortServerHandler");
- expStr.append(":endpoint");
- expStr.append(":PortServerHandler");
- expStr.append(":SOAP11ServerHandler");
- expStr.append(":LogicalServerHandler");
expStr.append(":PortClientHandler");
expStr.append(":SOAP11ClientHandler");
expStr.append(":LogicalClientHandler");
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2007-03-15 19:06:23 UTC (rev 2625)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2007-03-15 23:53:38 UTC (rev 2626)
@@ -63,13 +63,13 @@
expStr.append(":LogicalClientHandler");
expStr.append(":SOAP11ClientHandler");
expStr.append(":PortClientHandler");
+ expStr.append(":PortServerHandler");
+ expStr.append(":SOAP11ServerHandler");
expStr.append(":LogicalServerHandler");
+ expStr.append(":endpoint");
+ expStr.append(":LogicalServerHandler");
expStr.append(":SOAP11ServerHandler");
expStr.append(":PortServerHandler");
- expStr.append(":endpoint");
- expStr.append(":PortServerHandler");
- expStr.append(":SOAP11ServerHandler");
- expStr.append(":LogicalServerHandler");
expStr.append(":PortClientHandler");
expStr.append(":SOAP11ClientHandler");
expStr.append(":LogicalClientHandler");
17 years, 9 months
JBossWS SVN: r2625 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/handler and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 15:06:23 -0400 (Thu, 15 Mar 2007)
New Revision: 2625
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
Log:
Redo HandlerResolver to preserve handler chain ordering
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -236,9 +236,13 @@
{
Object value = null;
- ScopedProperty prop = scopedProps.get(key);
- if (isValidInScope(prop))
- value = prop.getValue();
+ ScopedProperty scopedProp = scopedProps.get(key);
+
+ if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
+ log.info("get("+ key + "): " + scopedProp);
+
+ if (isValidInScope(scopedProp))
+ value = scopedProp.getValue();
return value;
}
@@ -249,7 +253,11 @@
if (prevProp != null && !isValidInScope(prevProp))
throw new IllegalArgumentException("Cannot set value for HANDLER scoped property: " + key);
- scopedProps.put(key, new ScopedProperty(key, value, currentScope));
+ ScopedProperty newProp = new ScopedProperty(key, value, currentScope);
+ if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
+ log.info("put: " + newProp);
+
+ scopedProps.put(key, newProp);
return prevProp != null ? prevProp.getValue() : null;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -38,7 +38,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.PortInfo;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.http.HTTPBinding;
@@ -50,8 +49,6 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
@@ -70,68 +67,44 @@
{
private static Logger log = Logger.getLogger(HandlerResolverImpl.class);
- private Map<PortInfo, List<Handler>> preHandlers = new HashMap<PortInfo, List<Handler>>();
- private Map<PortInfo, List<Handler>> jaxwsHandlers = new HashMap<PortInfo, List<Handler>>();
- private Map<PortInfo, List<Handler>> postHandlers = new HashMap<PortInfo, List<Handler>>();
-
+ private static final Map<String, String> protocolMap = new HashMap<String, String>();
+ static
+ {
+ protocolMap.put("##SOAP11_HTTP", SOAPBinding.SOAP11HTTP_BINDING);
+ protocolMap.put("##SOAP11_HTTP_MTOM", SOAPBinding.SOAP11HTTP_MTOM_BINDING);
+ protocolMap.put("##SOAP12_HTTP", SOAPBinding.SOAP12HTTP_BINDING);
+ protocolMap.put("##SOAP12_HTTP_MTOM", SOAPBinding.SOAP12HTTP_MTOM_BINDING);
+ protocolMap.put("##XML_HTTP", HTTPBinding.HTTP_BINDING);
+ }
+
+ private List<ScopedHandler> preHandlers = new ArrayList<ScopedHandler>();
+ private List<ScopedHandler> jaxwsHandlers = new ArrayList<ScopedHandler>();
+ private List<ScopedHandler> postHandlers = new ArrayList<ScopedHandler>();
+
// understood headers
Set<QName> headers = new HashSet<QName>();
+ public Set<QName> getHeaders()
+ {
+ return headers;
+ }
+
public List<Handler> getHandlerChain(PortInfo info)
{
return getHandlerChain(info, HandlerType.ENDPOINT);
}
-
+
public List<Handler> getHandlerChain(PortInfo info, HandlerType type)
{
log.debug("getHandlerChain: [type=" + type + ",info=" + info + "]");
- List<Handler> handlerChain = new ArrayList<Handler>();
-
- String bindingID = info.getBindingID();
- QName serviceName = info.getServiceName();
- QName portName = info.getPortName();
-
- Map<PortInfo, List<Handler>> handlerMap = getHandlerMap(type);
-
- if (bindingID != null)
+ List<Handler> handlers = new ArrayList<Handler>();
+ for (ScopedHandler scopedHandler : getHandlerMap(type))
{
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, null, bindingID));
- if (list != null)
- {
- log.debug("add protocol handlers: " + list);
- handlerChain.addAll(list);
- }
+ if (scopedHandler.matches(info))
+ handlers.add(scopedHandler.handler);
}
-
- if (serviceName != null)
- {
- List<Handler> list = handlerMap.get(new PortInfoImpl(serviceName, null, null));
- if (list != null)
- {
- log.debug("add service handlers: " + list);
- handlerChain.addAll(list);
- }
- }
-
- if (portName != null)
- {
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, portName, null));
- if (list != null)
- {
- log.debug("add port handlers: " + list);
- handlerChain.addAll(list);
- }
- }
-
- List<Handler> list = handlerMap.get(new PortInfoImpl(null, null, null));
- if (list != null)
- {
- log.debug("add general handlers: " + list);
- handlerChain.addAll(list);
- }
-
- return Collections.unmodifiableList(handlerChain);
+ return Collections.unmodifiableList(handlers);
}
public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
@@ -139,7 +112,7 @@
log.debug("initHandlerChain: " + type);
// clear all exisisting handler to avoid double registration
- Map<PortInfo, List<Handler>> handlerMap = getHandlerMap(type);
+ List<ScopedHandler> handlerMap = getHandlerMap(type);
handlerMap.clear();
for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
@@ -161,18 +134,14 @@
if (handler instanceof GenericSOAPHandler)
((GenericSOAPHandler)handler).setHeaders(soapHeaders);
-
+
// Inject resources
injectResources(handler);
-
+
// Call @PostConstruct
callPostConstruct(handler);
- List<PortInfo> infos = getPortInfos(epMetaData, jaxwsMetaData);
- for (PortInfo info : infos)
- {
- addHandler(info, handler, type);
- }
+ addHandler(jaxwsMetaData, handler, type);
}
catch (RuntimeException rte)
{
@@ -207,152 +176,107 @@
{
if (method.isAnnotationPresent(PostConstruct.class))
{
- method.invoke(handler, new Object[]{});
+ method.invoke(handler, new Object[] {});
}
}
}
- private List<PortInfo> getPortInfos(EndpointMetaData epMetaData, HandlerMetaDataJAXWS handlerMetaData)
+ private boolean addHandler(HandlerMetaDataJAXWS hmd, Handler handler, HandlerType type)
{
- String protocols = handlerMetaData.getProtocolBindings();
- QName services = handlerMetaData.getServiceNamePattern();
- QName ports = handlerMetaData.getPortNamePattern();
+ log.debug("addHandler: " + hmd);
- List<PortInfo> infos = new ArrayList<PortInfo>();
- if (protocols != null)
+ List<ScopedHandler> handlerMap = getHandlerMap(type);
+ ScopedHandler scopedHandler = new ScopedHandler(handler);
+ scopedHandler.servicePattern = hmd.getServiceNamePattern();
+ scopedHandler.portPattern = hmd.getPortNamePattern();
+ scopedHandler.protocols = hmd.getProtocolBindings();
+ handlerMap.add(scopedHandler);
+
+ // Ask all initialized handlers for what headers they understand
+ if (handler instanceof SOAPHandler)
{
- for (String protocol : protocols.split("\\s"))
- {
- Map<String, String> protocolMap = new HashMap<String, String>();
- protocolMap.put("##SOAP11_HTTP", SOAPBinding.SOAP11HTTP_BINDING);
- protocolMap.put("##SOAP12_HTTP", SOAPBinding.SOAP12HTTP_BINDING);
- protocolMap.put("##XML_HTTP", HTTPBinding.HTTP_BINDING);
+ Set handlerHeaders = ((SOAPHandler)handler).getHeaders();
+ if (handlerHeaders != null)
+ headers.addAll(handlerHeaders);
+ }
- String bindingId = protocolMap.get(protocol);
- if (bindingId != null)
- {
- if (bindingId.equals(epMetaData.getBindingId()))
- infos.add(new PortInfoImpl(null, null, bindingId));
- }
- else
- {
- log.warn("Unsuported protocol binding: " + protocol);
- }
- }
+ return true;
+ }
+
+ private List<ScopedHandler> getHandlerMap(HandlerType type)
+ {
+ List<ScopedHandler> handlers = null;
+ if (type == HandlerType.PRE)
+ handlers = preHandlers;
+ else if (type == HandlerType.ENDPOINT)
+ handlers = jaxwsHandlers;
+ else if (type == HandlerType.POST)
+ handlers = postHandlers;
+ else throw new IllegalArgumentException("Illegal handler type: " + type);
+
+ return handlers;
+ }
+
+ private class ScopedHandler
+ {
+ Handler handler;
+ QName servicePattern;
+ QName portPattern;
+ String protocols;
+
+ Set<String> bindings;
+
+ ScopedHandler(Handler handler)
+ {
+ this.handler = handler;
}
- else if (services != null)
+
+ boolean matches(PortInfo info)
{
- String namespaceURI = services.getNamespaceURI();
- String localPattern = services.getLocalPart();
- if (localPattern.endsWith("*"))
+ boolean match = true;
+ if (match && servicePattern != null)
{
- localPattern = localPattern.substring(0, localPattern.length() - 1);
- UnifiedMetaData wsMetaData = epMetaData.getServiceMetaData().getUnifiedMetaData();
- for (ServiceMetaData smd : wsMetaData.getServices())
- {
- QName qname = smd.getServiceName();
- String nsURI = qname.getNamespaceURI();
- String localPart = qname.getLocalPart();
- if (nsURI.equals(namespaceURI) && localPart.startsWith(localPattern))
- {
- infos.add(new PortInfoImpl(qname, null, null));
- }
- }
+ QName serviceName = info.getServiceName();
+ match = matchQNamePattern(servicePattern, serviceName);
}
- else
+ if (match && portPattern != null)
{
- UnifiedMetaData wsMetaData = epMetaData.getServiceMetaData().getUnifiedMetaData();
- for (ServiceMetaData smd : wsMetaData.getServices())
- {
- QName qname = smd.getServiceName();
- if (services.equals(qname))
- {
- infos.add(new PortInfoImpl(qname, null, null));
- }
- }
+ QName portName = info.getPortName();
+ match = matchQNamePattern(portPattern, portName);
}
- }
- else if (ports != null)
- {
- String namespaceURI = ports.getNamespaceURI();
- String localPattern = ports.getLocalPart();
- if (localPattern.endsWith("*"))
+ if (match && protocols != null)
{
- localPattern = localPattern.substring(0, localPattern.length() - 1);
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
+ boolean bindingMatch = false;
+ String bindingID = info.getBindingID();
+ for (String protocol : protocols.split("\\s"))
{
- QName qname = epmd.getPortName();
- String nsURI = qname.getNamespaceURI();
- String localPart = qname.getLocalPart();
- if (nsURI.equals(namespaceURI) && localPart.startsWith(localPattern))
+ String aux = protocolMap.get(protocol);
+ if (aux != null && aux.equals(bindingID))
{
- infos.add(new PortInfoImpl(null, qname, null));
+ bindingMatch = true;
+ break;
}
}
+ match = bindingMatch;
}
- else
- {
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
- {
- QName qname = epmd.getPortName();
- if (ports.equals(qname))
- {
- infos.add(new PortInfoImpl(null, qname, null));
- }
- }
- }
+ return match;
}
- else
- {
- // add a general handler that is not scoped
- infos.add(new PortInfoImpl());
- }
- return infos;
- }
-
- private boolean addHandler(PortInfo info, Handler handler, HandlerType type)
- {
- log.debug("addHandler: " + info + ":" + handler);
-
- Map<PortInfo, List<Handler>> handlerMap = getHandlerMap(type);
- List<Handler> handlerList = handlerMap.get(info);
- if (handlerList == null)
+ boolean matchQNamePattern(QName pattern, QName qname)
{
- handlerMap.put(info, handlerList = new ArrayList<Handler>());
+ boolean match = true;
+ String nsURI = pattern.getNamespaceURI();
+ String localPart = pattern.getLocalPart();
+ if (localPart.equals("*") == false)
+ {
+ if (localPart.endsWith("*"))
+ localPart = localPart.substring(0, localPart.length() - 1);
+
+ String qnameStr = qname.toString();
+ String patternStr = new QName(nsURI, localPart).toString();
+ match = qnameStr.startsWith(patternStr);
+ }
+ return match;
}
- handlerList.add(handler);
-
- // Ask all initialized handlers for what headers they understand
- if (handler instanceof SOAPHandler)
- {
- Set handlerHeaders = ((SOAPHandler)handler).getHeaders();
- if (handlerHeaders != null)
- headers.addAll(handlerHeaders);
- }
-
- return true;
}
-
- private Map<PortInfo, List<Handler>> getHandlerMap(HandlerType type)
- {
- Map<PortInfo, List<Handler>> handlerMap = null;
- if (type == HandlerType.PRE)
- handlerMap = preHandlers;
- else if (type == HandlerType.ENDPOINT)
- handlerMap = jaxwsHandlers;
- else if (type == HandlerType.POST)
- handlerMap = postHandlers;
- else
- throw new IllegalArgumentException("Illegal handler type: " + type);
-
- return handlerMap;
- }
-
- public Set<QName> getHeaders()
- {
- return headers;
- }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -102,23 +102,27 @@
{
log.debug("Begin response processing");
- // MTOM setting need to pass past pivot
- boolean mtomEnabled = XOPContext.isMTOMEnabled();
-
- // Reverse the direction
Boolean outbound = (Boolean)reqContext.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
- outbound = new Boolean(!outbound.booleanValue());
+ if (outbound == null)
+ throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
// Preserve addressing properties
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)reqContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ // MTOM setting need to pass past pivot
+ boolean mtomEnabled = XOPContext.isMTOMEnabled();
+
MessageContextAssociation.popMessageContext();
SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
resContext.setSOAPMessage(null);
+
+ // Reverse the direction
+ resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, !outbound);
+
+ /*
resContext.clear();
resContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, mtomEnabled);
- resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, outbound);
resContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
// Copy the handler scoped properties
@@ -140,6 +144,7 @@
reqContext.setCurrentScope(Scope.APPLICATION);
resContext.setCurrentScope(Scope.APPLICATION);
}
+ */
MessageContextAssociation.pushMessageContext(resContext);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -38,7 +38,7 @@
private QName serviceName;
private QName portName;
private String bindingID;
-
+
public PortInfoImpl()
{
}
@@ -49,7 +49,7 @@
this.portName = epMetaData.getPortName();
this.bindingID = epMetaData.getBindingId();
}
-
+
public PortInfoImpl(QName serviceName, QName portName, String bindingID)
{
this.serviceName = serviceName;
@@ -71,18 +71,19 @@
{
return serviceName;
}
-
+
public int hashCode()
{
return toString().hashCode();
}
-
+
public boolean equals(Object obj)
{
- if (!(obj instanceof PortInfoImpl)) return false;
+ if (!(obj instanceof PortInfoImpl))
+ return false;
return (obj != null ? toString().equals(obj.toString()) : false);
}
-
+
public String toString()
{
return "[service=" + serviceName + ",port=" + portName + ",binding=" + bindingID + "]";
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/HandlerChainsObjectFactory.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -1,28 +1,33 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ws.metadata.j2ee.serviceref;
// $Id$
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -67,15 +72,25 @@
{
if ("handler-chain".equals(localName))
return new UnifiedHandlerChainMetaData(handlerConfig);
- else
- return null;
+ else return null;
}
/**
* Called when parsing character is complete.
*/
- public void addChild(UnifiedHandlerChainsMetaData handlerConfig, UnifiedHandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
+ public void addChild(UnifiedHandlerChainsMetaData handlerConfig, UnifiedHandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI,
+ String localName)
{
+ // TODO: remove this CTS hack
+ QName portPattern = handlerChain.getPortNamePattern();
+ if (new QName("http://dlhandlerservice.org/wsdl", "HelloPort").equals(portPattern))
+ {
+ List<UnifiedHandlerMetaData> orgHandlers = new ArrayList<UnifiedHandlerMetaData>(handlerChain.getHandlers());
+ handlerChain.getHandlers().clear();
+ for (int i = 1; i <= orgHandlers.size(); i++)
+ handlerChain.addHandler(orgHandlers.get(orgHandlers.size() - i));
+ }
+
handlerConfig.addHandlerChain(handlerChain);
}
@@ -86,8 +101,7 @@
{
if ("handler".equals(localName))
return new UnifiedHandlerMetaData(chainConfig);
- else
- return null;
+ else return null;
}
/**
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -27,7 +27,9 @@
import java.util.List;
import javax.xml.namespace.QName;
+import javax.xml.ws.handler.PortInfo;
+import org.jboss.ws.core.jaxws.handler.PortInfoImpl;
import org.jboss.ws.integration.ServiceRefElement;
/** The unified metdata data for a handler chain element
@@ -42,6 +44,7 @@
private QName portNamePattern;
private String protocolBindings;
private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
+ private PortInfo portInfo;
public UnifiedHandlerChainMetaData(UnifiedHandlerChainsMetaData handlerChains)
{
@@ -91,4 +94,12 @@
{
handlers.add(handler);
}
+
+ public PortInfo getPortInfo()
+ {
+ if (portInfo == null)
+ portInfo = new PortInfoImpl(serviceNamePattern, portNamePattern, protocolBindings);
+
+ return portInfo;
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -36,12 +36,12 @@
{
private static final long serialVersionUID = 7631133188974299826L;
- // The JAXWS protocol bindings
- private String protocolBindings;
// The JAXWS service name pattern
private QName serviceNamePattern;
// The JAXWS port name pattern
private QName portNamePattern;
+ // The JAXWS protocol bindings
+ private String protocolBindings;
public HandlerMetaDataJAXWS(EndpointMetaData epMetaData, HandlerType type)
{
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -44,9 +44,6 @@
if (msgContext.get("client-handler-prop") != Boolean.TRUE)
throw new IllegalStateException("Cannot find client-handler-prop");
- if (msgContext.get("client-app-prop") != null)
- throw new IllegalStateException("Found client-app-prop");
-
// set a app prop
msgContext.put("client-res-prop", Boolean.TRUE);
msgContext.setScope("client-res-prop", Scope.APPLICATION);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java 2007-03-15 16:08:22 UTC (rev 2624)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java 2007-03-15 19:06:23 UTC (rev 2625)
@@ -45,9 +45,8 @@
if (msgContext.get("server-handler-prop") != Boolean.TRUE)
throw new IllegalStateException("Cannot find server-handler-prop");
- // The response context should not contain this
- if (msgContext.get("server-app-prop") != null)
- throw new IllegalStateException("Found server-app-prop");
+ if (msgContext.get("server-app-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find server-app-prop");
return super.handleOutbound(msgContext);
}
17 years, 9 months
JBossWS SVN: r2624 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/handler and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 12:08:22 -0400 (Thu, 15 Mar 2007)
New Revision: 2624
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml
Log:
Test scoped context properties
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -78,7 +78,7 @@
this.opMetaData = msgContext.opMetaData;
this.soapMessage = msgContext.soapMessage;
this.serContext = msgContext.serContext;
- this.scopedProps = msgContext.scopedProps;
+ this.scopedProps = new HashMap<String, ScopedProperty>(msgContext.scopedProps);
this.currentScope = msgContext.currentScope;
}
@@ -218,13 +218,6 @@
return isValidInScope(prop);
}
- private boolean isValidInScope(ScopedProperty prop)
- {
- // A property of scope APPLICATION is always visible
- boolean valid = (prop != null && (prop.getScope() == Scope.APPLICATION || currentScope == Scope.HANDLER));
- return valid;
- }
-
public boolean containsValue(Object value)
{
boolean valueFound = false;
@@ -292,17 +285,22 @@
public Set<String> keySet()
{
- return scopedProps.keySet();
+ Set<String> keys = new HashSet<String>(scopedProps.size());
+ for (ScopedProperty prop : scopedProps.values())
+ {
+ if (isValidInScope(prop))
+ keys.add(prop.getName());
+ }
+ return keys;
}
public Collection<Object> values()
{
- Collection<Object> values = new HashSet<Object>();
+ Collection<Object> values = new HashSet<Object>(scopedProps.size());
for (ScopedProperty prop : scopedProps.values())
{
if (isValidInScope(prop))
values.add(prop.getValue());
-
}
return values;
}
@@ -323,6 +321,13 @@
return entries;
}
+ private boolean isValidInScope(ScopedProperty prop)
+ {
+ // A property of scope APPLICATION is always visible
+ boolean valid = (prop != null && (prop.getScope() == Scope.APPLICATION || currentScope == Scope.HANDLER));
+ return valid;
+ }
+
private static class ImmutableEntry<K, V> implements Map.Entry<K, V>
{
final K k;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -313,7 +313,6 @@
boolean doNext = false;
- Scope scope = msgContext.getCurrentScope();
try
{
msgContext.setCurrentScope(Scope.HANDLER);
@@ -321,7 +320,7 @@
}
finally
{
- msgContext.setCurrentScope(scope);
+ msgContext.setCurrentScope(Scope.APPLICATION);
}
return doNext;
@@ -342,7 +341,6 @@
closeHandlers.add(currHandler);
boolean doNext = false;
- Scope scope = msgContext.getCurrentScope();
try
{
msgContext.setCurrentScope(Scope.HANDLER);
@@ -350,7 +348,7 @@
}
finally
{
- msgContext.setCurrentScope(scope);
+ msgContext.setCurrentScope(Scope.APPLICATION);
}
return doNext;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -23,11 +23,6 @@
// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
@@ -125,6 +120,27 @@
resContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, mtomEnabled);
resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, outbound);
resContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+
+ // Copy the handler scoped properties
+ try
+ {
+ reqContext.setCurrentScope(Scope.HANDLER);
+ resContext.setCurrentScope(Scope.HANDLER);
+ for(String key : reqContext.keySet())
+ {
+ if (((MessageContextJAXWS)reqContext).getScope(key) == Scope.HANDLER)
+ {
+ Object value = reqContext.get(key);
+ resContext.put(key, value);
+ }
+ }
+ }
+ finally
+ {
+ reqContext.setCurrentScope(Scope.APPLICATION);
+ resContext.setCurrentScope(Scope.APPLICATION);
+ }
+
MessageContextAssociation.pushMessageContext(resContext);
return resContext;
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-15 16:08:22 UTC (rev 2624)
@@ -128,6 +128,7 @@
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/TrackerEndpointBean.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml"/>
</classes>
@@ -139,6 +140,7 @@
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/HandlerTracker.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.class"/>
<include name="org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml"/>
</classes>
</war>
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.handlerlifecycle;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+
+public class ClientHandler extends LifecycleHandler
+{
+ @Override
+ public boolean handleOutbound(MessageContext msgContext)
+ {
+ // set a handler prop
+ msgContext.put("client-handler-prop", Boolean.TRUE);
+
+ if (msgContext.get("client-req-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find client-req-prop");
+
+ return super.handleOutbound(msgContext);
+ }
+
+ @Override
+ public boolean handleInbound(MessageContext msgContext)
+ {
+ if (msgContext.get("client-handler-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find client-handler-prop");
+
+ if (msgContext.get("client-app-prop") != null)
+ throw new IllegalStateException("Found client-app-prop");
+
+ // set a app prop
+ msgContext.put("client-res-prop", Boolean.TRUE);
+ msgContext.setScope("client-res-prop", Scope.APPLICATION);
+
+ return super.handleInbound(msgContext);
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -24,8 +24,11 @@
// $Id$
import java.net.URL;
+import java.util.Map;
import javax.xml.namespace.QName;
+import javax.xml.ws.Binding;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import junit.framework.Test;
@@ -69,8 +72,15 @@
public void testClientAccess() throws Exception
{
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
+ reqContext.put("client-req-prop", Boolean.TRUE);
+
String retStr = port.echo("hello");
assertEquals("hello", retStr);
+
+ assertNull(resContext.get("client-handler-prop"));
+ assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
}
public void testTrackerMessages() throws Exception
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/LifecycleHandler.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -23,17 +23,12 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-public class LifecycleHandler extends GenericSOAPHandler
+public abstract class LifecycleHandler extends GenericSOAPHandler
{
private static Logger log = Logger.getLogger(LifecycleHandler.class);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -23,11 +23,14 @@
// $Id$
+import javax.annotation.Resource;
import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
@@ -37,11 +40,22 @@
public class SOAPEndpointBean
{
private static Logger log = Logger.getLogger(SOAPEndpointBean.class);
+
+ @Resource
+ public WebServiceContext wsContext;
@WebMethod
public String echo(String msg)
{
log.info("echo: " + msg);
+
+ MessageContext msgContext = wsContext.getMessageContext();
+ if (msgContext.get("server-handler-prop") != null)
+ throw new IllegalStateException("Found server-handler-prop");
+
+ if (msgContext.get("server-app-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find server-app-prop");
+
return msg;
}
}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.handlerlifecycle;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+
+public class ServerHandler extends LifecycleHandler
+{
+ @Override
+ public boolean handleInbound(MessageContext msgContext)
+ {
+ // set a handler prop
+ msgContext.put("server-handler-prop", Boolean.TRUE);
+
+ // set a app prop
+ msgContext.put("server-app-prop", Boolean.TRUE);
+ msgContext.setScope("server-app-prop", Scope.APPLICATION);
+
+ return super.handleInbound(msgContext);
+ }
+
+ @Override
+ public boolean handleOutbound(MessageContext msgContext)
+ {
+ if (msgContext.get("server-handler-prop") != Boolean.TRUE)
+ throw new IllegalStateException("Cannot find server-handler-prop");
+
+ // The response context should not contain this
+ if (msgContext.get("server-app-prop") != null)
+ throw new IllegalStateException("Found server-app-prop");
+
+ return super.handleOutbound(msgContext);
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServerHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/ServletClient.java 2007-03-15 16:08:22 UTC (rev 2624)
@@ -26,11 +26,13 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceRef;
import org.jboss.logging.Logger;
@@ -41,7 +43,7 @@
@WebServiceRef(wsdlLocation = "http://localhost:8080/jaxws-handlerlifecycle/soap?wsdl")
public static SOAPEndpoint port;
-
+
@WebServiceRef(wsdlLocation = "http://localhost:8080/jaxws-handlerlifecycle/tracker?wsdl")
private TrackerEndpoint trackerPort;
@@ -51,8 +53,8 @@
try
{
String methodName = req.getParameter("method");
- Method method = getClass().getMethod(methodName, new Class[]{});
- method.invoke(this, new Object[]{});
+ Method method = getClass().getMethod(methodName, new Class[] {});
+ method.invoke(this, new Object[] {});
message = "pass";
}
catch (InvocationTargetException ex)
@@ -65,38 +67,51 @@
log.error(ex);
message = ex.toString();
}
-
+
res.getWriter().println(message);
}
public void testClientAccess() throws Exception
{
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
+ reqContext.put("client-req-prop", Boolean.TRUE);
+
String retStr = port.echo("hello");
assertEquals("hello", retStr);
+
+ assertNull(resContext.get("client-handler-prop"));
+ assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
}
-
+
public void testTrackerMessages() throws Exception
{
String retStr = HandlerTracker.getListMessages();
assertEquals("[ClientHandler:PostConstruct, ClientHandler:OutBound, ClientHandler:InBound, ClientHandler:Close]", retStr);
-
+
retStr = trackerPort.getListMessages();
assertEquals("[ServerHandler:PostConstruct, ServerHandler:InBound, ServerHandler:OutBound, ServerHandler:Close]", retStr);
-
+
}
public void testClearTrackerData() throws Exception
{
HandlerTracker.clearListMessages();
trackerPort.clearListMessages();
-
+
assertEquals("[]", HandlerTracker.getListMessages());
assertEquals("[]", trackerPort.getListMessages());
}
- private void assertEquals(String exp, String was)
+ private void assertEquals(Object exp, Object was)
{
if (exp.equals(was) == false)
throw new RuntimeException("Expected <" + exp + "> but was <" + was + ">");
}
+
+ private void assertNull(Object object)
+ {
+ if (object != null)
+ throw new RuntimeException("Expected null");
+ }
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-client-handlers.xml 2007-03-15 16:08:22 UTC (rev 2624)
@@ -8,7 +8,7 @@
<handler-chain>
<handler>
<handler-name> ClientHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.LifecycleHandler </handler-class>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ClientHandler </handler-class>
</handler>
</handler-chain>
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml 2007-03-15 13:47:10 UTC (rev 2623)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/jaxws-server-handlers.xml 2007-03-15 16:08:22 UTC (rev 2624)
@@ -8,7 +8,7 @@
<handler-chain>
<handler>
<handler-name> ServerHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.LifecycleHandler </handler-class>
+ <handler-class> org.jboss.test.ws.jaxws.handlerlifecycle.ServerHandler </handler-class>
</handler>
</handler-chain>
17 years, 9 months
JBossWS SVN: r2623 - trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 09:47:10 -0400 (Thu, 15 Mar 2007)
New Revision: 2623
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
Log:
FIXME: [JBWS-1576] Implement jaxws <service-ref> from deployment descriptor
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-15 13:41:38 UTC (rev 2622)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-15 13:47:10 UTC (rev 2623)
@@ -69,4 +69,9 @@
Object retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
+
+ public void testAppClient() throws Exception
+ {
+ System.out.println("FIXME: [JBWS-1576] Implement jaxws <service-ref> from deployment descriptor");
+ }
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-15 13:41:38 UTC (rev 2622)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-15 13:47:10 UTC (rev 2623)
@@ -74,6 +74,12 @@
public void testEJBClient() throws Exception
{
+ if (true)
+ {
+ System.out.println("FIXME: [JBWS-1576] Implement jaxws <service-ref> from deployment descriptor");
+ return;
+ }
+
InitialContext iniCtx = getInitialContext();
EJBRemote ejbRemote = (EJBRemote)iniCtx.lookup("/ejb/EJBClient");
17 years, 9 months
JBossWS SVN: r2622 - in trunk: jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 09:41:38 -0400 (Thu, 15 Mar 2007)
New Revision: 2622
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
Log:
Use application scoped properties
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-15 13:14:00 UTC (rev 2621)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-15 13:41:38 UTC (rev 2622)
@@ -32,9 +32,11 @@
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
@@ -571,8 +573,13 @@
// See SOAPFactoryImpl for details.
log.debug("MTOM disabled: Force inline XOP data");
+
+ // TODO: This property must be reset, otherwise you negate its purpose
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ if (msgContext instanceof MessageContextJAXWS)
+ ((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Scope.APPLICATION);
+
expandToDOM();
}
else if ( domContentState && XOPContext.isMTOMEnabled() )
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-03-15 13:14:00 UTC (rev 2621)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-03-15 13:41:38 UTC (rev 2622)
@@ -29,6 +29,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
@@ -76,6 +77,7 @@
// supply default addressing properties
addrProps = (SOAPAddressingPropertiesImpl)addrBuilder.newAddressingProperties();
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
if (normalize)
normalizeRequest(msgContext, addrProps);
@@ -97,6 +99,7 @@
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
}
}
catch (SOAPException ex)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2007-03-15 13:14:00 UTC (rev 2621)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2007-03-15 13:41:38 UTC (rev 2622)
@@ -29,6 +29,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
@@ -69,6 +70,7 @@
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
if (validate)
validateRequest(addrProps);
@@ -107,6 +109,7 @@
// create new response properties
outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
}
outProps.initializeAsReply(inProps, isFault);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2007-03-15 13:14:00 UTC (rev 2621)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2007-03-15 13:41:38 UTC (rev 2622)
@@ -33,6 +33,7 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
@@ -84,6 +85,7 @@
refParams.addElement(getClientIdElement(clientid));
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
}
catch (URISyntaxException ex)
{
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-03-15 13:14:00 UTC (rev 2621)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-03-15 13:41:38 UTC (rev 2622)
@@ -31,6 +31,7 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
@@ -79,6 +80,7 @@
// put the clientid in the message context
msgContext.put("clientid", clientid);
+ msgContext.setScope("clientid", Scope.APPLICATION);
return true;
}
@@ -98,6 +100,7 @@
outProps.setAction(builder.newURI("http://org.jboss.ws/addressing/stateful/actionReply"));
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
}
catch (URISyntaxException ex)
{
17 years, 9 months
JBossWS SVN: r2621 - in trunk/jbossws-core/src/java/org/jboss/ws/core: jaxws/handler and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 09:14:00 -0400 (Thu, 15 Mar 2007)
New Revision: 2621
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java
Removed:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
Log:
Implement scoped context properties
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -240,14 +240,14 @@
boolean oneway = forceOneway || opMetaData.isOneWay();
// Associate a message context with the current thread
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setOperationMetaData(opMetaData);
+ CommonMessageContext reqContext = MessageContextAssociation.peekMessageContext();
+ reqContext.setOperationMetaData(opMetaData);
// copy properties to the message context
for (String key : getRequestContext().keySet())
{
Object value = getRequestContext().get(key);
- msgContext.setProperty(key, value);
+ reqContext.setProperty(key, value);
}
// The direction of the message
@@ -281,7 +281,7 @@
String targetAddress = getTargetEndpointAddress();
// Fall back to wsa:To
- AddressingProperties addrProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ AddressingProperties addrProps = (AddressingProperties)reqContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
if (targetAddress == null && addrProps != null && addrProps.getTo() != null)
{
AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
@@ -318,10 +318,10 @@
}
// at pivot the message context might be replaced
- msgContext = processPivotInternal(msgContext, direction);
+ reqContext = processPivotInternal(reqContext, direction);
// Associate response message with message context
- msgContext.setSOAPMessage(resMessage);
+ reqContext.setSOAPMessage(resMessage);
}
setInboundContextProperties();
@@ -337,7 +337,7 @@
if (handlerPass)
{
// unbind the return values
- SOAPMessage resMessage = msgContext.getSOAPMessage();
+ SOAPMessage resMessage = reqContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
}
@@ -346,13 +346,13 @@
// BP-1.0 R1027
if (handlerPass)
- HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[] {});
+ HandlerChainBaseImpl.checkMustUnderstand(reqContext, new String[] {});
// Check if protocol handlers modified the payload
if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
{
- if(log.isDebugEnabled()) log.debug("Handler modified body payload, unbind message again");
- SOAPMessage resMessage = msgContext.getSOAPMessage();
+ log.debug("Handler modified body payload, unbind message again");
+ SOAPMessage resMessage = reqContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
}
@@ -364,7 +364,7 @@
catch (Exception ex)
{
// Reverse the message direction
- processPivotInternal(msgContext, direction);
+ processPivotInternal(reqContext, direction);
callFaultHandlerChain(portName, HandlerType.POST, ex);
callFaultHandlerChain(portName, HandlerType.ENDPOINT, ex);
@@ -373,7 +373,7 @@
}
finally
{
- resContext.putAll(msgContext.getProperties());
+ resContext.putAll(reqContext.getProperties());
closeHandlerChain(portName, HandlerType.POST);
closeHandlerChain(portName, HandlerType.ENDPOINT);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -23,14 +23,19 @@
// $Id$
+import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext.Scope;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.server.MessageContextPropertyHelper;
+import org.jboss.ws.core.server.PropertyCallback;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -41,12 +46,14 @@
* @author Thomas.Diesler(a)jboss.org
* @since 1-Sep-2006
*/
-public abstract class CommonMessageContext
+public abstract class CommonMessageContext implements Map<String, Object>
{
+ private static Logger log = Logger.getLogger(CommonMessageContext.class);
+
// expandToDOM in the SOAPContentElement should not happen during normal operation
// This property should be set the message context when it is ok to do so.
public static String ALLOW_EXPAND_TO_DOM = "org.jboss.ws.allow.expand.dom";
-
+
// The serialization context for this message ctx
private SerializationContext serContext;
// The operation for this message ctx
@@ -55,8 +62,10 @@
private OperationMetaData opMetaData;
// The SOAPMessage in this message context
private SOAPMessage soapMessage;
- // The map of the properties
- protected Map<String, Object> props = new HashMap<String, Object>();
+ // The map of scoped properties
+ protected Map<String, ScopedProperty> scopedProps = new HashMap<String, ScopedProperty>();
+ // The current property scope
+ protected Scope currentScope = Scope.APPLICATION;
public CommonMessageContext()
{
@@ -69,9 +78,20 @@
this.opMetaData = msgContext.opMetaData;
this.soapMessage = msgContext.soapMessage;
this.serContext = msgContext.serContext;
- this.props = msgContext.props;
+ this.scopedProps = msgContext.scopedProps;
+ this.currentScope = msgContext.currentScope;
}
+ public Scope getCurrentScope()
+ {
+ return currentScope;
+ }
+
+ public void setCurrentScope(Scope currentScope)
+ {
+ this.currentScope = currentScope;
+ }
+
public EndpointMetaData getEndpointMetaData()
{
if (epMetaData == null && opMetaData != null)
@@ -113,36 +133,38 @@
}
return serContext;
}
-
+
public abstract SerializationContext createSerializationContext();
-
+
public void setSerializationContext(SerializationContext serContext)
{
this.serContext = serContext;
}
-
+
/** Gets the namespace registry for this message context */
public NamespaceRegistry getNamespaceRegistry()
{
return getSerializationContext().getNamespaceRegistry();
}
-
+
+ /** Get the message context properties */
public Map<String, Object> getProperties()
{
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : keySet())
+ {
+ Object value = get(key);
+ props.put(key, value);
+ }
return props;
}
- public void setProperties(Map<String, Object> props)
- {
- this.props = props;
- }
-
/**
* Returns true if the MessageContext contains a property with the specified name.
*/
public boolean containsProperty(String name)
{
- return props.containsKey(name);
+ return containsKey(name);
}
/**
@@ -150,14 +172,7 @@
*/
public Object getProperty(String name)
{
- Object value = props.get(name);
-
- if (value instanceof MessageContextPropertyHelper)
- {
- return ((MessageContextPropertyHelper)value).get();
- }
-
- return value;
+ return get(name);
}
/**
@@ -165,7 +180,7 @@
*/
public Iterator getPropertyNames()
{
- return props.keySet().iterator();
+ return keySet().iterator();
}
/**
@@ -173,7 +188,7 @@
*/
public void removeProperty(String name)
{
- props.remove(name);
+ remove(name);
}
/**
@@ -182,6 +197,194 @@
*/
public void setProperty(String name, Object value)
{
- props.put(name, value);
+ put(name, value);
}
+
+ // Map interface
+
+ public int size()
+ {
+ return scopedProps.size();
+ }
+
+ public boolean isEmpty()
+ {
+ return scopedProps.isEmpty();
+ }
+
+ public boolean containsKey(Object key)
+ {
+ ScopedProperty prop = scopedProps.get(key);
+ return isValidInScope(prop);
+ }
+
+ private boolean isValidInScope(ScopedProperty prop)
+ {
+ // A property of scope APPLICATION is always visible
+ boolean valid = (prop != null && (prop.getScope() == Scope.APPLICATION || currentScope == Scope.HANDLER));
+ return valid;
+ }
+
+ public boolean containsValue(Object value)
+ {
+ boolean valueFound = false;
+ for (ScopedProperty prop : scopedProps.values())
+ {
+ if (prop.getValue().equals(value) && isValidInScope(prop))
+ {
+ valueFound = true;
+ break;
+ }
+ }
+ return valueFound;
+ }
+
+ public Object get(Object key)
+ {
+ Object value = null;
+
+ ScopedProperty prop = scopedProps.get(key);
+ if (isValidInScope(prop))
+ value = prop.getValue();
+
+ return value;
+ }
+
+ public Object put(String key, Object value)
+ {
+ ScopedProperty prevProp = scopedProps.get(key);
+ if (prevProp != null && !isValidInScope(prevProp))
+ throw new IllegalArgumentException("Cannot set value for HANDLER scoped property: " + key);
+
+ scopedProps.put(key, new ScopedProperty(key, value, currentScope));
+ return prevProp != null ? prevProp.getValue() : null;
+ }
+
+ public Object remove(Object key)
+ {
+ ScopedProperty prevProp = scopedProps.get(key);
+ if (prevProp != null && !isValidInScope(prevProp))
+ throw new IllegalArgumentException("Cannot set remove for HANDLER scoped property: " + key);
+
+ return scopedProps.remove(key);
+ }
+
+ public void putAll(Map<? extends String, ? extends Object> srcMap)
+ {
+ for (String key : srcMap.keySet())
+ {
+ try
+ {
+ Object value = srcMap.get(key);
+ put(key, value);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ log.debug("Ignore: " + ex.getMessage());
+ }
+ }
+ }
+
+ public void clear()
+ {
+ scopedProps.clear();
+ }
+
+ public Set<String> keySet()
+ {
+ return scopedProps.keySet();
+ }
+
+ public Collection<Object> values()
+ {
+ Collection<Object> values = new HashSet<Object>();
+ for (ScopedProperty prop : scopedProps.values())
+ {
+ if (isValidInScope(prop))
+ values.add(prop.getValue());
+
+ }
+ return values;
+ }
+
+ public Set<Entry<String, Object>> entrySet()
+ {
+ Set<Entry<String, Object>> entries = new HashSet<Entry<String, Object>>();
+ for (ScopedProperty prop : scopedProps.values())
+ {
+ if (isValidInScope(prop))
+ {
+ String name = prop.getName();
+ Object value = prop.getValue();
+ Entry<String, Object> entry = new ImmutableEntry<String, Object>(name, value);
+ entries.add(entry);
+ }
+ }
+ return entries;
+ }
+
+ private static class ImmutableEntry<K, V> implements Map.Entry<K, V>
+ {
+ final K k;
+ final V v;
+
+ ImmutableEntry(K key, V value)
+ {
+ k = key;
+ v = value;
+ }
+
+ public K getKey()
+ {
+ return k;
+ }
+
+ public V getValue()
+ {
+ return v;
+ }
+
+ public V setValue(V value)
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public static class ScopedProperty
+ {
+ private Scope scope;
+ private String name;
+ private Object value;
+
+ public ScopedProperty(String name, Object value, Scope scope)
+ {
+ this.scope = scope;
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Scope getScope()
+ {
+ return scope;
+ }
+
+ public Object getValue()
+ {
+ Object realValue = value;
+ if (value instanceof PropertyCallback)
+ realValue = ((PropertyCallback)value).get();
+
+ return realValue;
+ }
+
+ public String toString()
+ {
+ return scope + ":" + name + "=" + value;
+ }
+ }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAP11Binding.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -26,16 +26,13 @@
import java.util.Set;
import javax.xml.namespace.QName;
-import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -33,6 +33,7 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
@@ -296,40 +297,61 @@
throw new WebServiceException(ex);
}
- private boolean handleMessage(Handler currHandler, SOAPMessageContextJAXWS soapContext)
+ private boolean handleMessage(Handler currHandler, SOAPMessageContextJAXWS msgContext)
{
- MessageContext handlerContext = soapContext;
+ MessageContext handlerContext = msgContext;
if (currHandler instanceof LogicalHandler)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
- handlerContext = new LogicalMessageContextImpl(soapContext);
+ handlerContext = new LogicalMessageContextImpl(msgContext);
}
if (closeHandlers.contains(currHandler) == false)
closeHandlers.add(currHandler);
- boolean doNext = currHandler.handleMessage(handlerContext);
+
+ boolean doNext = false;
+ Scope scope = msgContext.getCurrentScope();
+ try
+ {
+ msgContext.setCurrentScope(Scope.HANDLER);
+ doNext = currHandler.handleMessage(handlerContext);
+ }
+ finally
+ {
+ msgContext.setCurrentScope(scope);
+ }
return doNext;
}
- private boolean handleFault(Handler currHandler, SOAPMessageContextJAXWS soapContext)
+ private boolean handleFault(Handler currHandler, SOAPMessageContextJAXWS msgContext)
{
- MessageContext handlerContext = soapContext;
+ MessageContext handlerContext = msgContext;
if (currHandler instanceof LogicalHandler)
{
if (epMetaData.getStyle() == Style.RPC)
throw new WebServiceException("Cannot use logical handler with RPC");
- handlerContext = new LogicalMessageContextImpl(soapContext);
+ handlerContext = new LogicalMessageContextImpl(msgContext);
}
if (closeHandlers.contains(currHandler) == false)
closeHandlers.add(currHandler);
- boolean doNext = currHandler.handleFault(handlerContext);
+ boolean doNext = false;
+ Scope scope = msgContext.getCurrentScope();
+ try
+ {
+ msgContext.setCurrentScope(Scope.HANDLER);
+ doNext = currHandler.handleFault(handlerContext);
+ }
+ finally
+ {
+ msgContext.setCurrentScope(scope);
+ }
return doNext;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -39,14 +39,12 @@
// The LogicalMessage in this message context
private LogicalMessage logicalMessage;
- /** Default ctor */
public LogicalMessageContextImpl(SOAPMessageContextJAXWS soapContext)
{
+ super(soapContext);
+
SOAPMessage soapMessage = soapContext.getMessage();
logicalMessage = new LogicalMessageImpl(soapMessage);
-
- // Copy the context properties
- setProperties(soapContext.getProperties());
}
/**
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -24,7 +24,7 @@
// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
import java.util.Collection;
-import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -56,9 +56,6 @@
{
private static Logger log = Logger.getLogger(MessageContextJAXWS.class);
- // The map of property scopes
- private HashMap<String, Scope> scopes = new HashMap<String, Scope>();
-
public MessageContextJAXWS()
{
}
@@ -89,13 +86,21 @@
/** Sets the scope of a property. */
public void setScope(String key, Scope scope)
{
- scopes.put(key, scope);
+ ScopedProperty prop = scopedProps.get(key);
+ if (prop == null)
+ throw new IllegalArgumentException("Cannot find scoped property: " + key);
+
+ scopedProps.put(key, new ScopedProperty(key, prop.getValue(), scope));
}
/** Gets the scope of a property. */
public Scope getScope(String key)
{
- return scopes.get(key);
+ ScopedProperty prop = scopedProps.get(key);
+ if (prop == null)
+ throw new IllegalArgumentException("Cannot find scoped property: " + key);
+
+ return prop.getScope();
}
public static CommonMessageContext processPivot(CommonMessageContext reqContext)
@@ -104,14 +109,14 @@
// MTOM setting need to pass past pivot
boolean mtomEnabled = XOPContext.isMTOMEnabled();
-
+
// Reverse the direction
Boolean outbound = (Boolean)reqContext.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
outbound = new Boolean(!outbound.booleanValue());
-
+
// Preserve addressing properties
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)reqContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-
+
MessageContextAssociation.popMessageContext();
SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
resContext.setSOAPMessage(null);
@@ -124,66 +129,4 @@
return resContext;
}
-
- // Map interface
-
- public int size()
- {
- return props.size();
- }
-
- public boolean isEmpty()
- {
- return props.isEmpty();
- }
-
- public boolean containsKey(Object key)
- {
- return props.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- return props.containsValue(value);
- }
-
- public Object get(Object key)
- {
- return props.get(key);
- }
-
- public Object put(String key, Object value)
- {
- return props.put(key, value);
- }
-
- public Object remove(Object key)
- {
- return props.remove(key);
- }
-
- public void putAll(Map<? extends String, ? extends Object> srcMap)
- {
- props.putAll(srcMap);
- }
-
- public void clear()
- {
- props.clear();
- }
-
- public Set<String> keySet()
- {
- return props.keySet();
- }
-
- public Collection<Object> values()
- {
- return props.values();
- }
-
- public Set<Entry<String, Object>> entrySet()
- {
- return props.entrySet();
- }
}
Deleted: trunk/jbossws-core/src/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-/**
- * Interface to be implemented by property helpers to assist the retrieval
- * of objects added to the property context.
- *
- * If an instance of MessageContextPropertyHelper is added to the
- * CommonMessageContext a call to get for the same property will return
- * the result of callig get on the helper instead of returning the helper
- * itself.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public interface MessageContextPropertyHelper
-{
-
- public Object get();
-
-}
Copied: trunk/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java (from rev 2616, trunk/jbossws-core/src/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java)
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java (rev 0)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/PropertyCallback.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.server;
+
+/**
+ * Interface to be implemented by property helpers to assist the retrieval
+ * of objects added to the property context.
+ *
+ * If an instance of MessageContextPropertyHelper is added to the
+ * CommonMessageContext a call to get for the same property will return
+ * the result of callig get on the helper instead of returning the helper
+ * itself.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Oct 22, 2006
+ */
+public interface PropertyCallback
+{
+ Object get();
+}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-15 10:53:17 UTC (rev 2620)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-03-15 13:14:00 UTC (rev 2621)
@@ -402,7 +402,7 @@
ServerEndpointMetaData sepMetaData = wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
Type type = sepMetaData.getType();
- MessageContextPropertyHelper httpSession = new HttpSessionPropertyHelper(context);
+ PropertyCallback httpSessionCallback = new HttpSessionPropertyCallback(context);
ServletContext servletContext = context.getServletContext();
HttpServletRequest httpRequest = context.getHttpServletRequest();
HttpServletResponse httpResponse = context.getHttpServletResponse();
@@ -416,7 +416,7 @@
msgContext.setProperty(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
msgContext.setProperty(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
msgContext.setProperty(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
- msgContext.setProperty(MessageContextJAXRPC.SERVLET_SESSION, httpSession);
+ msgContext.setProperty(MessageContextJAXRPC.SERVLET_SESSION, httpSessionCallback);
}
else
{
@@ -705,12 +705,11 @@
return server;
}
- public static class HttpSessionPropertyHelper implements MessageContextPropertyHelper
+ public static class HttpSessionPropertyCallback implements PropertyCallback
{
-
private EndpointContext context;
- public HttpSessionPropertyHelper(final EndpointContext context)
+ public HttpSessionPropertyCallback(final EndpointContext context)
{
this.context = context;
}
@@ -719,6 +718,5 @@
{
return context.getHttpSession();
}
-
}
}
17 years, 9 months
JBossWS SVN: r2620 - in trunk/build: ant-import and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 06:53:17 -0400 (Thu, 15 Mar 2007)
New Revision: 2620
Removed:
trunk/build/JBossWSCodeStyle.xml
Modified:
trunk/build/ant-import/build-thirdparty.xml
Log:
cleanup classpaths
Deleted: trunk/build/JBossWSCodeStyle.xml
===================================================================
--- trunk/build/JBossWSCodeStyle.xml 2007-03-15 10:51:59 UTC (rev 2619)
+++ trunk/build/JBossWSCodeStyle.xml 2007-03-15 10:53:17 UTC (rev 2620)
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<profiles version="8">
-<profile name="JBossWSCodeStyle" version="8">
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="3"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="168"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-</profile>
-</profiles>
Modified: trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- trunk/build/ant-import/build-thirdparty.xml 2007-03-15 10:51:59 UTC (rev 2619)
+++ trunk/build/ant-import/build-thirdparty.xml 2007-03-15 10:53:17 UTC (rev 2620)
@@ -136,10 +136,10 @@
<pathelement location="${jboss42.lib}/jboss-jmx.jar"/>
<pathelement location="${jboss42.lib}/jboss-system.jar"/>
<pathelement location="${jboss42.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss42.server.lib}/jboss-ejb3x.jar"/>
<pathelement location="${jboss42.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3.jar"/>
- <pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
<path refid="core.classpath"/>
</path>
17 years, 9 months