Author: hiranya
Date: Tue Oct 5 17:32:37 2010
New Revision: 1004731
URL: http://svn.apache.org/viewvc?rev=1004731&view=rev
Log:
Refactoring
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/mediators/BinaryExtractMediator.java
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/EventSender.java
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/LoadbalanceFailoverClient.java
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
synapse/branches/2.0/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/mediators/BinaryExtractMediator.java
URL:
http://svn.apache.org/viewvc/synapse/branches/2.0/modules/samples/src/main/java/samples/mediators/BinaryExtractMediator.java?rev=1004731&r1=1004730&r2=1004731&view=diff
==============================================================================
---
synapse/branches/2.0/modules/samples/src/main/java/samples/mediators/BinaryExtractMediator.java
(original)
+++
synapse/branches/2.0/modules/samples/src/main/java/samples/mediators/BinaryExtractMediator.java
Tue Oct 5 17:32:37 2010
@@ -65,7 +65,7 @@ public class BinaryExtractMediator exten
DataHandler dataHandler =(DataHandler) binaryNode.getDataHandler();
InputStream inputStream = dataHandler.getInputStream();
byte[] searchByte = new byte[length];
- inputStream.skip(offset-1);
+ inputStream.skip(offset - 1);
int readBytes = inputStream.read(searchByte,0,length);
String outString = new String(searchByte,binaryEncoding);
msgCtx.setProperty(variableName,outString);
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/EventSender.java
URL:
http://svn.apache.org/viewvc/synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/EventSender.java?rev=1004731&r1=1004730&r2=1004731&view=diff
==============================================================================
---
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/EventSender.java
(original)
+++
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/EventSender.java
Tue Oct 5 17:32:37 2010
@@ -23,7 +23,7 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.om.util.AXIOMUtil;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
@@ -59,8 +59,6 @@ public class EventSender {
ConfigurationContext configContext = null;
String addUrl = getProperty("addurl",
"http://localhost:8280/services/EventingProxy");
- String trpUrl = getProperty("trpurl", null);
- String prxUrl = getProperty("prxurl", null);
String repo = getProperty("repository", "client_repo");
String symbol = getProperty("symbol", "GOOG");
String price = getProperty("price", "10.10");
@@ -105,15 +103,11 @@ public class EventSender {
"</m:placeOrder>");
System.out.println("Sending Event : \n" + payload.toString());
- try {
- serviceClient.fireAndForget(payload);
- System.out.println("Event sent to topic " + topic);
- Thread.sleep(1000);
- if (configContext != null) {
- configContext.terminate();
- }
- } catch (Exception ignore) {
+ serviceClient.fireAndForget(payload);
+ System.out.println("Event sent to topic " + topic);
+ Thread.sleep(1000);
+ if (configContext != null) {
+ configContext.terminate();
}
-
}
}
\ No newline at end of file
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/LoadbalanceFailoverClient.java
URL:
http://svn.apache.org/viewvc/synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/LoadbalanceFailoverClient.java?rev=1004731&r1=1004730&r2=1004731&view=diff
==============================================================================
---
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/LoadbalanceFailoverClient.java
(original)
+++
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/LoadbalanceFailoverClient.java
Tue Oct 5 17:32:37 2010
@@ -185,7 +185,7 @@ public class LoadbalanceFailoverClient {
i++;
System.out.println("Request: " + i + " ==> " + response);
- testString += (":" + i + ">" + response + ":");
+ testString = testString.concat(":" + i + ">" + response + ":");
}
return testString;
@@ -290,10 +290,10 @@ public class LoadbalanceFailoverClient {
client.setOptions(options);
int i = 0;
- int sessionNumber = 0;
+ int sessionNumber;
String[] cookies = new String[3];
boolean httpSession = session != null && "http".equals(session);
- int cookieNumber = 0;
+ int cookieNumber;
while (i < iterations || infinite) {
i++;
@@ -399,15 +399,8 @@ public class LoadbalanceFailoverClient {
}
private SOAPEnvelope buildSoapEnvelope(String clientID, String value) {
-
- String targetEPR = "http://localhost:9000/soap/Service1";
- String opration = "sampleOperation";
-
SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
- OMNamespace wsaNamespace = soapFactory.
- createOMNamespace("http://www.w3.org/2005/08/addressing",
"wsa");
-
SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
SOAPHeader header = soapFactory.createSOAPHeader();
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
URL:
http://svn.apache.org/viewvc/synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java?rev=1004731&r1=1004730&r2=1004731&view=diff
==============================================================================
---
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
(original)
+++
synapse/branches/2.0/modules/samples/src/main/java/samples/userguide/StockQuoteCallback.java
Tue Oct 5 17:32:37 2010
@@ -19,7 +19,8 @@ public class StockQuoteCallback implemen
}
public void onFault(org.apache.axis2.context.MessageContext
messageContext) {
- System.out.println("Fault received to the callback : " +
messageContext.getEnvelope().getBody().getFault());
+ System.out.println("Fault received to the callback : " +
messageContext.getEnvelope().
+ getBody().getFault());
}
public void onError(Exception e) {
Modified:
synapse/branches/2.0/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java
URL:
http://svn.apache.org/viewvc/synapse/branches/2.0/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java?rev=1004731&r1=1004730&r2=1004731&view=diff
==============================================================================
---
synapse/branches/2.0/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java
(original)
+++
synapse/branches/2.0/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java
Tue Oct 5 17:32:37 2010
@@ -26,7 +26,6 @@ import org.apache.axis2.util.CommandLine
import org.apache.axis2.util.CommandLineOptionParser;
import org.apache.axis2.util.OptionsValidator;
import org.apache.axis2.clustering.ClusterManager;
-//import org.apache.axis2.clustering.ClusteringAgent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -118,24 +117,20 @@ public class SampleAxis2ServerManager {
}
public void stop() throws Exception {
- try {
- if (listenerManager != null) {
- listenerManager.stop();
- listenerManager.destroy();
- }
- //we need to call this method to clean the team fils we created.
- if (configctx != null) {
- configctx.terminate();
- }
- } catch (Exception ignored) {
+ if (listenerManager != null) {
+ listenerManager.stop();
+ listenerManager.destroy();
+ }
+ //we need to call this method to clean the team fils we created.
+ if (configctx != null) {
+ configctx.terminate();
}
}
private void configurePort(ConfigurationContext configCtx) {
- TransportInDescription trsIn = (TransportInDescription)
- configCtx.getAxisConfiguration().getTransportsIn().get("http");
+ TransportInDescription trsIn =
configCtx.getAxisConfiguration().getTransportsIn().get("http");
if (trsIn != null) {
String port = System.getProperty("http_port");
@@ -152,8 +147,8 @@ public class SampleAxis2ServerManager {
}
}
- TransportInDescription httpsTrsIn = (TransportInDescription)
- configCtx.getAxisConfiguration().getTransportsIn().get("https");
+ TransportInDescription httpsTrsIn = configCtx.getAxisConfiguration().
+ getTransportsIn().get("https");
if (httpsTrsIn != null) {
String port = System.getProperty("https_port");