You've seen an example of a synchronous connection in the HelloWorldServiceSynchronous,
HelloWorldProvider and HelloWorldUser components. And you've also
seen an example of an asynchronous connection in HelloWorldSubscriber,
HelloWorldPublisher and HelloWorldServiceAsynchronous, but you've
never really seen how connectors work. The good news is that you
don't need to understand the connector API of Openwings. Component
Services does that for you. All you need to know now is how to
generate and bundle connectors with your applications. We'll show
you how to do this with the Hello World example we've been using.
To generate and bundle your connectors you will use Ant. Navigate
to the HelloWorld directory in which you'd like to generate your
connector. For example: <net.openwings.home>/<componentName>/src/com/gd/openwings/demo/helloworld/<folder
name>
where the <folder name> is:
- provider for HelloWorldProvider
- service_async for HelloWorldServiceAsynchronous
- etc.
How
Do I Generate Connectors?
To generate connectors, open a DOS or Unix shell window
and navigate to the directory of the appropriate build.xml.
Then execute the command:
ant connector
-or-
ant build
|
The connector target generates all connectors associated
with this component. The build target will build the componentthis
includes compiling the component code, generating policies, jar-ing
the main classes, and generating connectors. If you have trouble
running Ant, make sure your ANT_HOME environment variable is set
correctly (see Openwings installation
instructions).
To learn more about connector generation, go to the
Connector Generation section of the Developing Components
tutorial. There you'll gain an improved understanding of the different
connectors that are available and how to generate and bundle connectors
with your own applications.