HelloWorld Synchronous
Conceptually what will happen in this synchronous example is
HelloWorldProvider will provide the service (ie. "hello world"
messages) and the HelloWorldUser
will register itself as a user of the service. The steps
we will use to do this are:
- Define the service interface -
HelloWorldServiceSynchronous.java
- Create an implementation of the service interface -
HelloWorldProvider.java
- get a reference to the component
- distribute the object
- provide the distributed object
- Create a client to use the service -
HelloWorldSimpleUser.java or
HelloWorldUser.java
- get a reference to a component
- register as a listener for the service
- implement serviceProvided
1. HelloWorldServiceSynchronous
Source code:
HelloWorldServiceSynchronous.java
The HelloWorldServiceSynchronous is
- the service interface that has been defined
The notion of how a synchronous interface works is provided by
the HelloWorldServiceSynchronous interface. Here, the interface
is very simple:
String helloWorld() throws RemoteException
On the next page we'll see how this interface is implemented.
The nuts and bolts of how HelloWorldServiceSynchronous is implemented
as a synchronous service is provided by the way we design our
software, generate, and build components in Openwings. We discuss
component builds in the Compilation
and Connector Generation
sections of this tutorial. For now, observe that this simple interface
provides one method, helloWorld(). This method is
implemented by another class, HelloWorldProvider.
Next: HelloWorldProvider