Author: rfeng
Date: Mon Oct 16 16:58:58 2006
New Revision: 464749
URL: http://svn.apache.org/viewvc?view=rev&rev=464749
Log:
Fix the client main class
Modified:
incubator/tuscany/java/samples/sca/greeterwsclient-oneway/pom.xml
incubator/tuscany/java/samples/sca/greeterwsclient-oneway/src/main/java/greeter/GreeterClient.java
incubator/tuscany/java/samples/sca/helloworldwsclient-async/src/main/java/helloworld/HelloWorldClient.java
Modified: incubator/tuscany/java/samples/sca/greeterwsclient-oneway/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/greeterwsclient-oneway/pom.xml?view=diff&rev=464749&r1=464748&r2=464749
==============================================================================
--- incubator/tuscany/java/samples/sca/greeterwsclient-oneway/pom.xml (original)
+++ incubator/tuscany/java/samples/sca/greeterwsclient-oneway/pom.xml Mon Oct
16 16:58:58 2006
@@ -96,7 +96,7 @@
<configuration>
<archive>
<manifest>
- <mainClass>helloworld.HelloWorldClient</mainClass>
+ <mainClass>greeter.GreeterClient</mainClass>
</manifest>
</archive>
</configuration>
Modified:
incubator/tuscany/java/samples/sca/greeterwsclient-oneway/src/main/java/greeter/GreeterClient.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/greeterwsclient-oneway/src/main/java/greeter/GreeterClient.java?view=diff&rev=464749&r1=464748&r2=464749
==============================================================================
---
incubator/tuscany/java/samples/sca/greeterwsclient-oneway/src/main/java/greeter/GreeterClient.java
(original)
+++
incubator/tuscany/java/samples/sca/greeterwsclient-oneway/src/main/java/greeter/GreeterClient.java
Mon Oct 16 16:58:58 2006
@@ -26,8 +26,11 @@
public final static void main(String[] args) throws Exception {
CompositeContext compositeContext =
CurrentCompositeContext.getContext();
- GreeterService greeterService =
- compositeContext.locateService(GreeterService.class,
"GreeterServiceComponent");
- greeterService.greet("there");
+ GreeterLocal greeterLocal =
+ compositeContext.locateService(GreeterLocal.class,
"GreeterServiceComponent");
+ greeterLocal.greet("John");
+ System.out.println("Sleeping for 5 seconds ...");
+ Thread.sleep(5000);
+ System.out.println("Done ...");
}
}
Modified:
incubator/tuscany/java/samples/sca/helloworldwsclient-async/src/main/java/helloworld/HelloWorldClient.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldwsclient-async/src/main/java/helloworld/HelloWorldClient.java?view=diff&rev=464749&r1=464748&r2=464749
==============================================================================
---
incubator/tuscany/java/samples/sca/helloworldwsclient-async/src/main/java/helloworld/HelloWorldClient.java
(original)
+++
incubator/tuscany/java/samples/sca/helloworldwsclient-async/src/main/java/helloworld/HelloWorldClient.java
Mon Oct 16 16:58:58 2006
@@ -21,56 +21,20 @@
import org.osoa.sca.CompositeContext;
import org.osoa.sca.CurrentCompositeContext;
-
-
-//import org.osoa.sca.CurrentModuleContext;
-//import org.osoa.sca.ModuleContext;
-//
-//import org.apache.tuscany.core.client.TuscanyRuntime;
-//import org.apache.tuscany.common.monitor.MonitorFactory;
-//import org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory;
-
/**
- * This client program shows how to create an SCA runtime, start it,
- * locate the HelloWorld service and invoke it.
+ * This client program shows how to invoke a web service asynchronously with a
callback
*/
-
-
public class HelloWorldClient {
-
- public final static void main(String[] args) throws Exception {
-
- // Setup Tuscany monitoring to use java.util.logging
-//
LogManager.getLogManager().readConfiguration(HelloWorldClient.class.getResourceAsStream("/logging.properties"));
-// Properties levels = new Properties();
-// MonitorFactory monitorFactory = new
JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");
+ public final static void main(String[] args) throws Exception {
- // Create a Tuscany runtime for the sample module component
-// TuscanyRuntime tuscany = new
TuscanyRuntime("HelloWorldModuleComponent", "http://helloworld",
monitorFactory);
-
- // Start the Tuscany runtime and associate it with this thread
-// tuscany.start();
-
- // Get the SCA module context.
-// ModuleContext moduleContext = CurrentModuleContext.getContext();
-
- // Locate the HelloWorld service
-// HelloWorldService helloworldService = (HelloWorldService)
moduleContext.locateService("HelloWorldService");
-
- // Invoke the HelloWorld service
CompositeContext compositeContext =
CurrentCompositeContext.getContext();
- HelloWorldService helloWorldService=
compositeContext.locateService(HelloWorldService.class,
"HelloWorldServiceComponent");
- String value = helloWorldService.getGreetings("World");
-
- System.out.println(value);
- System.out.flush();
-
- // Disassociate the runtime from this thread
-// tuscany.stop();
+ HelloWorldLocal helloWorldLocal =
+ compositeContext.locateService(HelloWorldLocal.class,
"HelloWorldServiceComponent");
+ helloWorldLocal.getGreetings("John");
- // Shut down the runtime
-// tuscany.shutdown();
+ // Sleep for 5 seconds to wait the callback to happen
+ Thread.sleep(5000);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]