From c5e65ac5831e5318385640e6a8e4e5bcec430a2a Mon Sep 17 00:00:00 2001 From: antelder Date: Sun, 25 Apr 2010 21:26:44 +0000 Subject: 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 --- .../src/main/java/sample/HelloworldSCAClient.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sca-java-2.x') 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 "); - 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"); -- cgit v1.2.3