The Tuscany hello world multi-component sample shows using the Tuscany SCA runtime in a J2SE environment loading a component that implements the classic introductory hello world example. This sample shows the wiring of multiple components in a single SCA module.
The sample when run should simply display to the standard
output:
Hello SCA World
main |
sca.module | Defines the SCA module and the HelloWorldServiceComponent, GreetingPrefixComponent and GreetingSuffixComponent components Wires the HelloWorldServiceComponent to reference the GreetingPrefixComponent and GreetingSuffixComponent. Customizes the GreetingPrefixComponent and GreetingSuffixComponent components with the greetings. |
GreetingPortionProvider.java | Defines the Java interface implemented by the component. GreetingPrefixComponent and GreetingSuffixComponent |
GreetingPortionProviderImpl.java | Implements the SCA components GreetingPrefixComponent
and GreetingSuffixComponent
. Uses the SCA service
annotation tag on the class to show what SCA interface is being
implemented. Uses the SCA defined Property
Java annotation on the greetingPortion Java
field to customize the component in the sca.module file. |
HelloWorldService.java | Defines the Java interface implemented by the component. HelloWorldServiceComponent. |
HelloWorldServiceComponentImpl.java |
Implements the HelloWorldServiceComponent component. Shows two Java fields being used to reference the and GreetingPrefixComponentGreetingSuffixComponent components. |