diff options
Diffstat (limited to 'tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache')
5 files changed, 0 insertions, 182 deletions
diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java deleted file mode 100644 index d023b3023b..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tuscany.samples.helloworldmc; - -public interface GreetingPortionProvider { - - public String getGreetingPortion(); -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java deleted file mode 100644 index a881a17dae..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Service; - -@Service(GreetingPortionProvider.class) -public class GreetingPortionProviderImpl implements GreetingPortionProvider { - - @Property - public String greetingPortion; - - public String getGreetingPortion() { - return greetingPortion; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java deleted file mode 100644 index 36d7e3eb03..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -/** - * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component - * and invoke it. - */ -public class HelloWorldClient { - - public static final void main(String[] args) throws Exception { - - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings(); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java deleted file mode 100644 index 3d455aca68..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tuscany.samples.helloworldmc; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - public String getGreetings(); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java deleted file mode 100644 index 664c6343d3..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -public class HelloWorldServiceComponentImpl implements HelloWorldService { - - @Property - public String greetingMiddle; - - @Reference - public GreetingPortionProvider greetingPrefix; - - @Reference - public GreetingPortionProvider greetingSuffix; - - /** - * @return - */ - public String getGreetings() { - String middle; - if (greetingMiddle == null) - middle = ""; - else - middle = greetingMiddle; - - return greetingPrefix.getGreetingPortion() + " " + middle + " " + greetingSuffix.getGreetingPortion(); - } - -} |