diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-25 21:26:44 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-25 21:26:44 +0000 |
commit | c5e65ac5831e5318385640e6a8e4e5bcec430a2a (patch) | |
tree | a3269d598ab1d5978ceee4b39427d47933fdd889 /sca-java-2.x/trunk/samples/helloworld-scaclient | |
parent | 61fe29b688ffd6097149126dfcb8101f470d9dc5 (diff) |
Update scaclient sample to work with default input
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@937883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/samples/helloworld-scaclient')
-rw-r--r-- | sca-java-2.x/trunk/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java b/sca-java-2.x/trunk/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java index 8160e09797..c2c9c4e44e 100644 --- a/sca-java-2.x/trunk/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java +++ b/sca-java-2.x/trunk/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java @@ -28,14 +28,19 @@ public class HelloworldSCAClient { public static void main(String[] args) throws NoSuchDomainException, NoSuchServiceException {
- if (args.length != 2) {
- System.out.println("Missing args");
- System.out.println("HelloworldSCAClient <domain URI> <name>");
- System.exit(1);
+ String domainURI = "default";
+ String name = "world";
+
+ if (args.length == 2) {
+ domainURI= args[0];
+ name = args[1];
+ } else if (args.length == 1) {
+ domainURI= args[0];
}
- String domainURI= args[0];
- String name = args[1];
+ System.out.println("using domain uri: " + domainURI);
+ System.out.println("using name: " + name);
+
SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI));
Helloworld service = factory.getService(Helloworld.class, "HelloworldComponent");
|