Author: asankha
Date: Sat Oct 28 03:31:21 2006
New Revision: 468671
URL: http://svn.apache.org/viewvc?view=rev&rev=468671
Log:
merge from trunk
Added:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/RestMediatorFactory.java
- copied unchanged from r468302,
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/RestMediatorFactory.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/mediators/builtin/RestMediator.java
- copied unchanged from r468302,
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/mediators/builtin/RestMediator.java
Removed:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/DynamicProperty.java
Modified:
incubator/synapse/branches/NIO/bin/synapse.bat
incubator/synapse/branches/NIO/modules/core/ (props changed)
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/Endpoint.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointFactory.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointSerializer.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/MediatorFactoryFinder.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/SendMediatorFactory.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/DynamicAxisOperation.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMessageReceiver.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/metrics/GlobalRequestCountHandler.java
incubator/synapse/branches/NIO/modules/extensions/ (props changed)
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/JavaScriptMediator.java
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/RhinoScriptInstance.java
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/json/SynapseJsonSender.java
incubator/synapse/branches/NIO/modules/nhttp/ (props changed)
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPListener.java
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPSender.java
incubator/synapse/branches/NIO/modules/niohttp/src/org/apache/axis2/transport/niohttp/NHttpSender.java
incubator/synapse/branches/NIO/modules/samples/ (props changed)
incubator/synapse/branches/NIO/project.properties
incubator/synapse/branches/NIO/project.xml
incubator/synapse/branches/NIO/xdocs/Synapse_Configuration_Language.html
Modified: incubator/synapse/branches/NIO/bin/synapse.bat
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/bin/synapse.bat?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
--- incubator/synapse/branches/NIO/bin/synapse.bat (original)
+++ incubator/synapse/branches/NIO/bin/synapse.bat Sat Oct 28 03:31:21 2006
@@ -52,7 +52,7 @@
:synapseSample
shift
-set
_SYNAPSE_XML=-Dsynapse.xml=%SYNAPSE_HOME%\synapse_repository\conf\sample\synapse_sample_%1.xml
+set
_SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\synapse_repository\conf\sample\synapse_sample_%1.xml"
shift
goto setupArgs
@@ -76,7 +76,7 @@
goto runSynapse
:defaultParams
-set SYNAPSE_CMD_LINE_ARGS=-p8080 %SYNAPSE_HOME%\synapse_repository
+set SYNAPSE_CMD_LINE_ARGS=-p8080 "%SYNAPSE_HOME%\synapse_repository"
goto runSynapse
:noJavaHome
@@ -85,18 +85,18 @@
:runSynapse
rem set the classes by looping through the libs
setlocal EnableDelayedExpansion
-set SYNAPSE_CLASS_PATH=%SYNAPSE_HOME%
-FOR %%C in (%SYNAPSE_HOME%\lib\*.jar) DO set
SYNAPSE_CLASS_PATH=!SYNAPSE_CLASS_PATH!;%%~fC
-set SYNAPSE_CLASS_PATH=%SYNAPSE_HOME%\conf;%SYNAPSE_CLASS_PATH%
+set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%"
+FOR %%C in ("%SYNAPSE_HOME%\lib\*.jar") DO set
SYNAPSE_CLASS_PATH=!SYNAPSE_CLASS_PATH!;"%%~fC"
+set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%\conf";%SYNAPSE_CLASS_PATH%
rem if a sample configuration is not specified, use default
-if "%_SYNAPSE_XML%" == "" set
_SYNAPSE_XML=-Dsynapse.xml=%SYNAPSE_HOME%\synapse_repository\conf\synapse.xml
+if "%_SYNAPSE_XML%" == "" set
_SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\synapse_repository\conf\synapse.xml"
-set
SYNAPSE_ENDORSED=%SYNAPSE_HOME%\lib\endorsed;%JAVA_ENDORSED_DIRS%;%JAVA_HOME%\lib\endorsed
+set
SYNAPSE_ENDORSED="%SYNAPSE_HOME%\lib\endorsed";"%JAVA_ENDORSED_DIRS%";"%JAVA_HOME%\lib\endorsed"
@echo on
cd %SYNAPSE_HOME%
-"%_JAVACMD%" %_SYNAPSE_XML%
-Daxis2.xml=%SYNAPSE_HOME%\synapse_repository\conf\axis2.xml
-Djava.endorsed.dirs=%SYNAPSE_ENDORSED% -cp %SYNAPSE_CLASS_PATH%
org.apache.synapse.SynapseHTTPServer %SYNAPSE_CMD_LINE_ARGS%
+"%_JAVACMD%" %_SYNAPSE_XML%
-Daxis2.xml="%SYNAPSE_HOME%\synapse_repository\conf\axis2.xml"
-Djava.endorsed.dirs=%SYNAPSE_ENDORSED% -cp %SYNAPSE_CLASS_PATH%
org.apache.synapse.SynapseHTTPServer %SYNAPSE_CMD_LINE_ARGS%
goto end
:end
Propchange: incubator/synapse/branches/NIO/modules/core/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Oct 28 03:31:21 2006
@@ -0,0 +1,5 @@
+target
+logs
+.classpath
+.project
+text.xml
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/Endpoint.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/Endpoint.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/Endpoint.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/Endpoint.java
Sat Oct 28 03:31:21 2006
@@ -16,7 +16,6 @@
package org.apache.synapse.config;
-import java.net.URL;
/**
* An endpoint can be used to give a logical name to an endpoint address, and
possibly reused.
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointFactory.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointFactory.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointFactory.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointFactory.java
Sat Oct 28 03:31:21 2006
@@ -26,7 +26,7 @@
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
-import java.net.URL;
+
/**
* Creates an Endpoint instance using the XML fragment specification
@@ -60,12 +60,7 @@
OMAttribute address = elem.getAttribute(new
QName(Constants.NULL_NAMESPACE, "address"));
if (address != null) {
- try {
- endpoint.setAddress(new URL(address.getAttributeValue()));
- } catch (MalformedURLException e) {
- handleException("Invalid URL specified for 'address' : " +
- address.getAttributeValue(), e);
- }
+ endpoint.setAddress(address.getAttributeValue());
} else {
// right now an address is *required*
handleException("The 'address' attribute is required for an
endpoint");
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointSerializer.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointSerializer.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointSerializer.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/EndpointSerializer.java
Sat Oct 28 03:31:21 2006
@@ -59,7 +59,7 @@
OMElement endpoint = fac.createOMElement("endpoint", synNS);
if (endpt.getAddress() != null) {
endpoint.addAttribute(fac.createOMAttribute(
- "address", nullNS, endpt.getAddress().toString()));
+ "address", nullNS, endpt.getAddress()));
} else {
handleException("Invalid Endpoint. Address is required");
}
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/MediatorFactoryFinder.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/MediatorFactoryFinder.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/MediatorFactoryFinder.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/MediatorFactoryFinder.java
Sat Oct 28 03:31:21 2006
@@ -46,6 +46,7 @@
SequenceMediatorFactory.class,
LogMediatorFactory.class,
SendMediatorFactory.class,
+ //RestMediatorFactory.class,
FilterMediatorFactory.class,
SynapseMediatorFactory.class,
DropMediatorFactory.class,
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
Sat Oct 28 03:31:21 2006
@@ -119,7 +119,7 @@
OMElement prop = (OMElement) o;
OMAttribute pname = prop.getAttribute(new
QName(Constants.NULL_NAMESPACE, "name"));
OMAttribute value = prop.getAttribute(new
QName(Constants.NULL_NAMESPACE, "value"));
- if (name != null && value != null) {
+ if (pname != null && value != null) {
proxy.addProperty(pname.getAttributeValue(),
value.getAttributeValue());
} else {
handleException("Invalid property specified for proxy
service : " + name);
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/SendMediatorFactory.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/SendMediatorFactory.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/SendMediatorFactory.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/config/xml/SendMediatorFactory.java
Sat Oct 28 03:31:21 2006
@@ -98,13 +98,9 @@
if (ref != null) {
endpt.setRef(ref.getAttributeValue());
} else if (address != null) {
- try {
- endpt.setAddress(new URL(address.getAttributeValue()));
- } catch (MalformedURLException e) {
- String msg = "Invalid endpoint address : " +
address.getAttributeValue();
- log.error(msg, e);
- throw new SynapseException(msg, e);
- }
+
+ endpt.setAddress(address.getAttributeValue());
+
} else {
String msg = "An endpoint used within a send mediator
definition must contain a " +
"'ref' (reference) or 'address' (absolute URL) attribute";
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
Sat Oct 28 03:31:21 2006
@@ -140,9 +140,39 @@
serviceCtx, clientOptions);
mepClient.addMessageContext(axisOutMsgCtx);
- mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
- mepClient.execute(false);
- return null;
+ if (clientOptions.isUseSeparateListener()) {
+ mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
+ axisOutMsgCtx.getOperationContext().setProperty(
+ org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
+ mepClient.execute(false);
+ return null;
+
+ } else {
+
+ mepClient.execute(true);
+
+ MessageContext response = mepClient.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+
+ // set properties on response
+ response.setServerSide(true);
+ response.setProperty(Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
+ response.setProperty(MessageContext.TRANSPORT_OUT,
+ axisOutMsgCtx.getProperty(MessageContext.TRANSPORT_OUT));
+ response.setProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO,
+
axisOutMsgCtx.getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO));
+ response.setProperty(
+ org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND,
+ axisOutMsgCtx.getProperty(
+
org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND));
+ response.setTransportIn(axisOutMsgCtx.getTransportIn());
+ response.setTransportOut(savedTransportOut);
+
+ // If request is REST assume that the response is REST too
+ response.setDoingREST(axisOutMsgCtx.isDoingREST());
+
+ return response;
+ }
}
/**
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/DynamicAxisOperation.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/DynamicAxisOperation.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/DynamicAxisOperation.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/DynamicAxisOperation.java
Sat Oct 28 03:31:21 2006
@@ -18,6 +18,7 @@
import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
import org.apache.axis2.transport.TransportUtils;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.util.UUIDGenerator;
@@ -225,11 +226,16 @@
}
addReferenceParameters(mc);
if (options.isUseSeparateListener()) {
+
+ //options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+ options.setTransportIn(mc.getConfigurationContext()
+ .getAxisConfiguration().getTransportIn(new
QName(Constants.TRANSPORT_HTTP)));
+
SynapseCallbackReceiver callbackReceiver =
(SynapseCallbackReceiver) axisOp.getMessageReceiver();
callbackReceiver.addCallback(mc.getMessageID(), callback);
EndpointReference replyToFromTransport =
mc.getConfigurationContext().getListenerManager().
getEPRforService(sc.getAxisService().getName(),
axisOp.getName().getLocalPart(), mc
- .getTransportIn().getName()
+ .getTransportOut().getName()
.getLocalPart());
if (mc.getReplyTo() == null) {
@@ -247,17 +253,7 @@
// Options object reused so soapAction needs to be removed so
// that soapAction+wsa:Action on response don't conflict
options.setAction("");
-
} else {
-
- SynapseCallbackReceiver callbackReceiver =
(SynapseCallbackReceiver) axisOp.getMessageReceiver();
- callbackReceiver.addCallback(mc.getMessageID(), callback);
- AxisEngine engine = new AxisEngine(cc);
-
mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc);
- engine.send(mc);
-
- }
- /*} else {
if (block) {
// Send the SOAP Message and receive a response
MessageContext response = send(mc);
@@ -277,7 +273,7 @@
sc.getConfigurationContext().getThreadPool().execute(
new NonBlockingInvocationWorker(callback, mc));
}
- }*/
+ }
}
private void addReferenceParameters(MessageContext msgctx) {
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
Sat Oct 28 03:31:21 2006
@@ -109,9 +109,11 @@
handleException("Unknown WSDL format.. not WSDL 1.1 or
WSDL 2.0");
}
- assert wsdlToAxisServiceBuilder != null;
+ if (wsdlToAxisServiceBuilder == null) {
+ throw new SynapseException("Could not get the WSDL to
Axis Service Builder");
+ }
proxyService = wsdlToAxisServiceBuilder.populateService();
- proxyService.setWsdlfound(true);
+ proxyService.setWsdlFound(true);
} else {
handleException("Unknown WSDL format.. not WSDL 1.1 or
WSDL 2.0");
@@ -135,7 +137,9 @@
// Set the name and description. Currently Axis2 uses the name as the
// default Service destination
- assert proxyService != null;
+ if (proxyService == null) {
+ throw new SynapseException("Could not create a proxy service");
+ }
proxyService.setName(name);
if (description != null) {
proxyService.setServiceDescription(description);
@@ -160,19 +164,16 @@
while (iter.hasNext()) {
String name = (String) iter.next();
String value = (String) properties.get(name);
- if (JMSConstants.CONFAC_PARAM.equals(name) ||
- JMSConstants.DEST_PARAM.equals(name)) {
- Parameter p = new Parameter();
- p.setName(name);
- p.setValue(value);
-
- try {
- proxyService.addParameter(p);
- } catch (AxisFault af) {
- handleException("Error setting property : " + name + "" +
- "to proxy service as a Parameter", af);
- }
+ Parameter p = new Parameter();
+ p.setName(name);
+ p.setValue(value);
+
+ try {
+ proxyService.addParameter(p);
+ } catch (AxisFault af) {
+ handleException("Error setting property : " + name + "" +
+ "to proxy service as a Parameter", af);
}
}
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
Sat Oct 28 03:31:21 2006
@@ -21,13 +21,10 @@
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.addressing.RelatesTo;
import org.apache.axis2.AxisFault;
-import org.apache.synapse.Constants;
-import org.apache.axiom.soap.SOAPFault;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
-import java.util.Iterator;
public class SynapseCallbackReceiver implements MessageReceiver {
@@ -49,15 +46,7 @@
if (callback != null) {
callbackStore.remove(messageID);
- if (messageCtx.getEnvelope().getBody().hasFault()) {
- SOAPFault fault =
messageCtx.getEnvelope().getBody().getFault();
- AxisFault axisFault = new AxisFault(fault.getCode(),
fault.getReason(),
- fault.getNode(), fault.getRole(), fault.getDetail());
- callback.onError(axisFault);
- } else {
- callback.onComplete(new AsyncResult(messageCtx));
- }
- callback.setComplete(true);
+ callback.onComplete(new AsyncResult(messageCtx));
}
}
}
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMessageReceiver.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMessageReceiver.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMessageReceiver.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMessageReceiver.java
Sat Oct 28 03:31:21 2006
@@ -42,5 +42,18 @@
MessageContext synCtx =
Axis2MessageContextFinder.getSynapseMessageContext(mc);
synCtx.getEnvironment().injectMessage(synCtx);
+
+ // Response handling mechanism for 200/202 and 5XX
+ // if smc.isResponse = true then the response will be handled with 200
OK
+ // else, response will be 202 OK without an http body
+ // if smc.isFaultRespose = true then the response is a fault with 500
Internal Server Error
+
+ if (synCtx.isResponse()) {
+ mc.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN,
Constants.VALUE_TRUE);
+ }
+ if (synCtx.isFaultResponse()) {
+ // todo: is there a better way to inject faultSoapEnv to the Axis2
Transport
+ throw new AxisFault("Synapse Encountered an Error - See Log for
More Details");
+ }
}
}
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/core/axis2/SynapseMustUnderstandHandler.java
Sat Oct 28 03:31:21 2006
@@ -28,22 +28,22 @@
public class SynapseMustUnderstandHandler extends AbstractHandler {
- public void invoke(MessageContext msgContext) throws AxisFault {
+ public InvocationResponse invoke(MessageContext msgContext) throws
AxisFault {
Object obj = msgContext.getProperty(
org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND);
if (obj != null && ((Boolean) obj).booleanValue()) {
// second phase so return
- return;
+ return InvocationResponse.CONTINUE;
}
msgContext.setProperty(
org.apache.synapse.Constants.PROCESSED_MUST_UNDERSTAND,
Boolean.TRUE);
if (!msgContext.isHeaderPresent()) {
- return;
+ return InvocationResponse.CONTINUE;
}
SOAPEnvelope envelope = msgContext.getEnvelope();
if (envelope.getHeader() == null) {
- return;
+ return InvocationResponse.CONTINUE;
}
Iterator headerBlocks = envelope.getHeader().examineAllHeaderBlocks();
while (headerBlocks.hasNext()) {
@@ -56,6 +56,6 @@
headerBlock.setProcessed();
}
-
+ return InvocationResponse.CONTINUE;
}
}
Modified:
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/metrics/GlobalRequestCountHandler.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/metrics/GlobalRequestCountHandler.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/metrics/GlobalRequestCountHandler.java
(original)
+++
incubator/synapse/branches/NIO/modules/core/src/org/apache/synapse/metrics/GlobalRequestCountHandler.java
Sat Oct 28 03:31:21 2006
@@ -26,11 +26,12 @@
public class GlobalRequestCountHandler extends AbstractHandler {
- public void invoke(MessageContext msgContext) throws AxisFault {
+ public InvocationResponse invoke(MessageContext msgContext) throws
AxisFault {
msgContext
.setProperty(Constants.REQUEST_RECEIVED_TIME, new
Long(System.currentTimeMillis()));
// global increment
((Counter)
msgContext.getParameter(Constants.GLOBAL_REQUEST_COUNTER).getValue())
.increment();
+ return InvocationResponse.CONTINUE;
}
}
Propchange: incubator/synapse/branches/NIO/modules/extensions/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Oct 28 03:31:21 2006
@@ -0,0 +1,4 @@
+logs
+target
+.classpath
+.project
Modified:
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/JavaScriptMediator.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/JavaScriptMediator.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/JavaScriptMediator.java
(original)
+++
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/JavaScriptMediator.java
Sat Oct 28 03:31:21 2006
@@ -17,6 +17,7 @@
import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;
+import org.mozilla.javascript.Scriptable;
/**
* A Synapse mediator using a JavaScript function.
@@ -30,9 +31,10 @@
private RhinoFunctionInvoker mediateFunction;
private String script;
+ private Scriptable scope;
public boolean mediate(MessageContext synCtx) {
- Boolean b = (Boolean) mediateFunction.invoke(new Object[] { synCtx });
+ Boolean b = (Boolean) mediateFunction.invoke(new Object[] { new
E4XMessageContext(synCtx, scope) });
return b == null ? true : b.booleanValue(); // default response to true
}
@@ -42,6 +44,7 @@
rhinoScript.setResponseClass("mediate", Boolean.class);
RhinoScriptInstance scriptInstance =
rhinoScript.createRhinoScriptInstance();
this.mediateFunction =
scriptInstance.createRhinoFunctionInvoker("mediate");
+ this.scope = scriptInstance.getScope();
}
public String getScript() {
Modified:
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/RhinoScriptInstance.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/RhinoScriptInstance.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/RhinoScriptInstance.java
(original)
+++
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/javascript/RhinoScriptInstance.java
Sat Oct 28 03:31:21 2006
@@ -98,5 +98,9 @@
return (Function) handleObj;
}
+
+ public Scriptable getScope() {
+ return instanceScope;
+ }
}
Modified:
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/json/SynapseJsonSender.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/json/SynapseJsonSender.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/json/SynapseJsonSender.java
(original)
+++
incubator/synapse/branches/NIO/modules/extensions/src/org/apache/synapse/mediators/json/SynapseJsonSender.java
Sat Oct 28 03:31:21 2006
@@ -45,7 +45,7 @@
private static final Log log = LogFactory.getLog(SynapseJsonSender.class);
- public void invoke(MessageContext msgContext) throws AxisFault {
+ public InvocationResponse invoke(MessageContext msgContext) throws
AxisFault {
//Fix Me For Sending Only
// Trasnport URL can be different from the WSA-To. So processing
// that now.
@@ -119,7 +119,7 @@
throw new AxisFault(e);
}
-
+ return InvocationResponse.CONTINUE;
}
public void cleanup(MessageContext msgContext) throws AxisFault {
Propchange: incubator/synapse/branches/NIO/modules/nhttp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Oct 28 03:31:21 2006
@@ -0,0 +1,3 @@
+target
+.classpath
+.project
Modified:
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPListener.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPListener.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPListener.java
(original)
+++
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPListener.java
Sat Oct 28 03:31:21 2006
@@ -129,7 +129,7 @@
public EndpointReference[] getEPRsForService(String serviceName, String
ip) throws AxisFault {
EndpointReference[] endpointReferences = new EndpointReference[1];
endpointReferences[0] = new EndpointReference(
- "http://" + hostAddress + ":" + port + serviceContextPath +
"/" + serviceName);
+ "http://" + hostAddress + ":" + port + "/" +
serviceContextPath + "/" + serviceName);
return endpointReferences;
}
}
Modified:
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPSender.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPSender.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPSender.java
(original)
+++
incubator/synapse/branches/NIO/modules/nhttp/src/org/apache/axis2/transport/nhttp/AsyncHTTPSender.java
Sat Oct 28 03:31:21 2006
@@ -44,7 +44,7 @@
*/
public class AsyncHTTPSender extends AbstractHandler implements
TransportSender {
- public void invoke(MessageContext msgContext) throws AxisFault {
+ public InvocationResponse invoke(MessageContext msgContext) throws
AxisFault {
OMOutputFormat format = new OMOutputFormat();
String charSetEnc = (String) msgContext.getProperty(
@@ -130,6 +130,8 @@
.setProperty(Constants.RESPONSE_WRITTEN,
Constants.VALUE_TRUE);
}
+
+ return InvocationResponse.CONTINUE;
}
private void sendAsyncResponse(MessageContext msgContext, OMOutputFormat
format, OMElement dataOut) throws AxisFault {
Modified:
incubator/synapse/branches/NIO/modules/niohttp/src/org/apache/axis2/transport/niohttp/NHttpSender.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/modules/niohttp/src/org/apache/axis2/transport/niohttp/NHttpSender.java?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
---
incubator/synapse/branches/NIO/modules/niohttp/src/org/apache/axis2/transport/niohttp/NHttpSender.java
(original)
+++
incubator/synapse/branches/NIO/modules/niohttp/src/org/apache/axis2/transport/niohttp/NHttpSender.java
Sat Oct 28 03:31:21 2006
@@ -39,7 +39,7 @@
public class NHttpSender extends AbstractHandler implements TransportSender {
- public void invoke(MessageContext msgContext) throws AxisFault {
+ public InvocationResponse invoke(MessageContext msgContext) throws
AxisFault {
OMOutputFormat format = getOMOutputFormat(msgContext);
@@ -108,6 +108,7 @@
" is Null, Do not know where to send");
}
}
+ return InvocationResponse.CONTINUE;
}
private OMOutputFormat getOMOutputFormat(MessageContext msgContext) {
Propchange: incubator/synapse/branches/NIO/modules/samples/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Oct 28 03:31:21 2006
@@ -0,0 +1,3 @@
+.project
+.classpath
+target
Propchange: incubator/synapse/branches/NIO/modules/samples/
------------------------------------------------------------------------------
--- svn:ignores (added)
+++ svn:ignores Sat Oct 28 03:31:21 2006
@@ -0,0 +1,7 @@
+target
+.project
+.classpath
+maven.log
+.settings
+logs
+
Modified: incubator/synapse/branches/NIO/project.properties
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/project.properties?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
--- incubator/synapse/branches/NIO/project.properties (original)
+++ incubator/synapse/branches/NIO/project.properties Sat Oct 28 03:31:21 2006
@@ -49,7 +49,7 @@
wss4j.version=SNAPSHOT
xmlsec.version=1.3.0
wsdl4j.version=1.5.2
-axis2.version=SNAPSHOT
+axis2.version=1.1-SNAPSHOT
woden.version=SNAPSHOT
axiom.version=SNAPSHOT
Modified: incubator/synapse/branches/NIO/project.xml
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/project.xml?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
--- incubator/synapse/branches/NIO/project.xml (original)
+++ incubator/synapse/branches/NIO/project.xml Sat Oct 28 03:31:21 2006
@@ -52,35 +52,34 @@
<dependencies>
<dependency>
- <groupId>axis2</groupId>
+ <groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
- <groupId>ws-commons</groupId>
+ <groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>${axiom.version}</version>
</dependency>
<dependency>
- <groupId>ws-commons</groupId>
+ <groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<version>${axiom.version}</version>
</dependency>
-
<dependency>
- <groupId>ws-commons</groupId>
+ <groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-dom</artifactId>
<version>${axiom.version}</version>
</dependency>
<dependency>
- <groupId>axis2</groupId>
+ <groupId>org.apache.axis2</groupId>
<artifactId>axis2-rahas</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.ws.commons</groupId>
+ <groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
<version>${XmlSchema.version}</version>
<properties>
@@ -89,7 +88,7 @@
</dependency>
<dependency>
- <groupId>ws-commons</groupId>
+ <groupId>org.apache.ws.commons.neethi</groupId>
<artifactId>neethi</artifactId>
<version>${neethi.version}</version>
<properties>
@@ -107,7 +106,7 @@
</dependency>
<dependency>
- <groupId>axis2</groupId>
+ <groupId>org.apache.axis2</groupId>
<artifactId>axis2-secpolicy</artifactId>
<version>${axis2.version}</version>
<properties>
@@ -116,7 +115,7 @@
</dependency>
<dependency>
- <groupId>axis2</groupId>
+ <groupId>org.apache.axis2</groupId>
<artifactId>axis2-security</artifactId>
<version>${axis2.version}</version>
<properties>
Modified:
incubator/synapse/branches/NIO/xdocs/Synapse_Configuration_Language.html
URL:
http://svn.apache.org/viewvc/incubator/synapse/branches/NIO/xdocs/Synapse_Configuration_Language.html?view=diff&rev=468671&r1=468670&r2=468671
==============================================================================
--- incubator/synapse/branches/NIO/xdocs/Synapse_Configuration_Language.html
(original)
+++ incubator/synapse/branches/NIO/xdocs/Synapse_Configuration_Language.html
Sat Oct 28 03:31:21 2006
@@ -28,8 +28,7 @@
<rules [key="string"]>
mediator*
</rules>
- </synapse>
-</pre>
+ </synapse></pre>
<h3>Registries</h3>
@@ -57,8 +56,7 @@
follows:</p>
<pre> <set-property name="string" [value="string"] [src="url"]
[key="string"]>
<inline-xml/>?
- <set-property/>
-</pre>
+ <set-property/></pre>
<p>These properties are top level properties which are set globally for the
entire system. Values of these properties can be retrieved via the extension
@@ -88,7 +86,7 @@
<p>If an optional error handler sequence name is specified through the
attribute 'onError', an exception on this sequence will invoke the sequence
-specified by this name. </p>
+specified by this name.</p>
<p>A Dynamic Sequence may be defined by specifying a Dynamic Property as its
definition. As the dynamic property changes, the sequence will dynamically be
@@ -101,18 +99,10 @@
simple URL, then extensibility elements may be used to indicate the address
(i.e. to compute the address at runtime).</p>
<pre> <endpoint name="string" [address="url"] [key="string"]>
- <parameter name="OutflowSecurity">
- ...
- </parameter>?
- <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"..
- xmlns:wsrm="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
- ...
- </Policy>?
- <enableRM/>?
+ <enableRM [policy="key"]/>?
<enableSec/>?
.. extensibility ..
- </endpoint>
-</pre>
+ </endpoint></pre>
<p>An Axis2 Parameter element within an endpoint definition with the name "
OutflowSecurity" describes the Apache Rampart security configuration to be
@@ -148,13 +138,13 @@
<pre> <proxy name="string" [description="string"] [transports="(http |https
|jms )+|all"]>
<target sequence="name" | endpoint="name"/>? // defaults to the
synapse main sequence
<wsdl key="string">?
- <schema key="string">* // not yet used
- <policy key="string">*
- <property name="string" value="string"/>*
<enableRM/>?
<enableSec/>?
- </proxy>
-</pre>
+ <policy key="string">* // optional service
level policies
+ // (e.g. WS-Security and/or
WS-RM policies)
+ <property name="string" value="string"/>* // optional service
parameters
+ // (e.g.
transport.jms.ConnectionFactory)
+ </proxy></pre>
<p>A proxy service is created and exposed on the specified transports through
the underlying Axis2 instance, exposing service EPR's as per the standard
@@ -201,23 +191,19 @@
<p>In the simplest case, the place to send the message to is implicit in the
message (via a property of the message itself)- that is indicated by the
following:</p>
-<pre> <send/>
-</pre>
+<pre> <send/></pre>
<p>If the message is to be sent to one or more endpoints, then the following
is used:</p>
<pre> <send>
(endpointref | endpoint)+
- </send>
-</pre>
+ </send></pre>
<p>where the endpointref token refers to the following:</p>
-<pre> <endpoint ref="name"/>
-</pre>
+<pre> <endpoint ref="name"/></pre>
<p>and the endpoint token refers to an anonymous endpoint defined inline:</p>
-<pre> <endpoint address="url"/>
-</pre>
+<pre> <endpoint address="url"/></pre>
<p>If the message is to be sent to an endpoint selected by load balancing
across a set of endpoints, then it is indicated by the following:</p>
@@ -225,8 +211,7 @@
<load-balance algorithm="uri">
(endpointref | endpoint)+
</load-balance>
- </send>
-</pre>
+ </send></pre>
<p>Similarly, if the message is to be sent to an endpoint with failover
semantics, then it is indicated by the following:</p>
@@ -234,8 +219,7 @@
<failover>
(endpointref | endpoint)+
</failover>
- </send>
-</pre>
+ </send></pre>
<p>Once the <send> mediator executes, further processing of the current
message stops.</p>
@@ -247,8 +231,7 @@
<p>The drop token refers to a <drop> element which is used to drop a
message:</p>
-<pre> <drop/>
-</pre>
+<pre> <drop/></pre>
<p>Once the <drop> mediator executes, further processing of the current
message stops.</p>
@@ -259,13 +242,12 @@
messages being mediated:</p>
<pre> <log [level="string"] [separator="string"]>
<property name="string" (value="literal" | expression="xpath")/>*
- </log>
-</pre>
+ </log></pre>
<p>The optional level attribute selects a pre-defined subset of properties to
be logged.</p>
-<p>e.g. </p>
+<p>e.g.</p>
<ul>
<li>simple = To, From, WSAction, SOAPAction, ReplyTo, MessageID and any
properties</li>
@@ -287,8 +269,7 @@
<node>?
<role>?
<detail>?
- </makefault>
-</pre>
+ </makefault></pre>
<p>The <makefault> mediator transforms the current message into a fault
message, but does NOT send it. The <send> mediator needs to be invoked
@@ -300,8 +281,7 @@
<h5>XSLT</h5>
<pre> <xslt key="string" [source="xpath"]>
<property name="string" (value="literal" | expression="xpath")/>*
- </transform>
-</pre>
+ </transform></pre>
<p>The <xslt> mediator applies the specified XSLT transformation to the
given element. If the source element is not specified, it defaults to the
@@ -310,8 +290,7 @@
<h5>Headers</h5>
<pre> <header name="qname" (value="literal" | expression="xpath")
[action="set"]/>
- <header name="qname" action="remove"/>
-</pre>
+ <header name="qname" action="remove"/></pre>
<p>The <header> mediator sets or removes a specified header from the
current soap message. Currently the set header only supports simple valued
@@ -325,8 +304,7 @@
<h5>Filters</h5>
<pre> <filter (source="xpath" regex="string") | xpath="xpath">
mediator+
- </filter>
-</pre>
+ </filter></pre>
<p>The <filter> mediator either test the given xpath expression as a
boolean expression, or match the evaluation result of a source xpath
@@ -341,8 +319,7 @@
<default>
mediator+
</default>?
- </switch>
-</pre>
+ </switch></pre>
<p>The <switch> mediator will evaluate the given source xpath
expression into its string value, and match it against the given regular
@@ -354,8 +331,7 @@
<on-fail>
mediator+
</on-fail>
- </validate>
-</pre>
+ </validate></pre>
<p>The <validate> mediator validates the result of the evaluation of
the source xpath expression, against the schema specified. If the source
@@ -368,8 +344,7 @@
will remain simple and lightweight.</p>
<h4>Properties</h4>
-<pre> <set-property name="string" (value="literal" |
expression="xpath")/>
-</pre>
+<pre> <set-property name="string" (value="literal" |
expression="xpath")/></pre>
<p>The setproperty token refers to a <set-property> element which is a
mediator that has no direct impact on the message but rather on the message
@@ -380,8 +355,7 @@
<h4>Class Mediators</h4>
<pre> <class name="class-name">
<property name="string" (value="literal" | expression="xpath")/>*
- </class>
-</pre>
+ </class> </pre>
<p>The class mediator creates an instance of the specified class and sets it
as a mediator. The class must implement the org.apache.synapse.api.Mediator
@@ -390,8 +364,7 @@
properties.</p>
<h4>Reusing Sequences</h4>
-<pre> <sequence ref="name"/>
-</pre>
+<pre> <sequence ref="name"/></pre>
<p>A sequenceref token refers to a <sequence> element which is used to
invoke a named sequence of mediators.</p>
@@ -417,8 +390,7 @@
src, key or inlined XML references to the Spring configuration</p>
<h4>Spring mediator</h4>
-<pre> <spring:spring bean="exampleBean1" key="string"/>
-</pre>
+<pre> <spring:spring bean="exampleBean1" key="string"/></pre>
<p>The <spring> element creates an instance of a mediator, which is
managed by Spring. This Spring bean must implement the Mediator interface for
@@ -502,8 +474,7 @@
<switch>
</rules>
-</synapse>
-</pre>
+</synapse> </pre>
<h3>Example 0.</h3>
<pre><synapse xmlns="http://ws.apache.org/ns/synapse">
@@ -545,8 +516,7 @@
<send/>
</rules>
-</synapse>
-</pre>
+</synapse> </pre>
<p>The above configuration is available with the Synapse distribution and
illustrates the usual Stock quote examples. The client code for these are
@@ -805,7 +775,6 @@
<spring:spring bean="springtest" key="springconfig1"/>
<spring:spring bean="springtest" key="springconfig2"/>
</rules>
-</synapse>
-</pre>
+</synapse> </pre>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]