previous next trail start tutorial home feedback openwings.org

Defining Service Contracts

The language of the contract is a Java interface.  The syntax of the interface is defined by the Java interface and the semantics are defined by the comments.  Service contracts should have meaningful names, be well document, and be short / simple.

There are two types of service contracts developers can define:

1. Asynchronous Service Contracts

Used for non-blocking one-way communication. 

  • Each method must throw RemoteException.
  • Have none, primitive, or object parameters that are serializable or remote object references.
  • Have no return values.

A example is the HelloWorldServiceAsyn interface we viewed in the Getting Started trail:

2. Synchronous Service Contracts

Synchronous interfaces are used for blocking two-way communication.

  • Each method must throw RemoteException
  • Have none, primitive, or object parameters that are serializable or remote object references.
  • Return none, primitive, or object parameters that are serializable or remote object references.

A example is the HelloWorldServiceSyn interface we viewed in the Getting Started trail:

The user may want to define attributes associated with their services.  Attributes are objects that have all public objects.  This allows matching to be done by filling in the parameters. We discuss attributes in more detail in the ComponentComplex Interface discussion of this trail. For now, understand there can exist an association between services and their attributes. This is how we can specify a desired behavior.

To establish multiple connections between components, distributed objectes are typically passed in the context of another connection. This is the technique used to establish bi-directional synchronous and asynchronous communications in Openwings.

Next: Defining Components

back to top

Copyright 2002, General Dynamics Decision Systems. All rights reserved.

previous next trail start tutorial home feedback openwings.org