Next: , Up: Components   [Contents][Index]


10.5.1 Ports

A port is an instance of an interface. A component has ports through which it interacts with other components. As such a port is one of the two end-points connecting two components.

port      ::= ("provides" interface-type identifier ";")
              | ("requires" qualifier? interface-type identifier ";")
qualifier ::= "blocking" | "external" | "injected";

The keyword provides indicates that a component implements all of the interface behavior.

The keyword requires indicates that a component relies on some or all of the interface behavior in its implementation.

For example:

provides ihello p;
provides blocking ihello p;      // (1)
requires ihello r;
requires blocking ihello r;      // (2)
requires external itimer t;  // (3)
requires injected ilogger l; // (4)

1) provides port which may potentially block. The blocking qualifier must be used on a provides port when blocking is used in the component’s behavior, or when the blocking qualifier is used on a requires port.

2) requires port which may potentially block. The blocking qualifier must be used on a requires port when the port it is bound to has a blocking qualifier.

3) port to a component with a potential delay in its communication (see external)

4) port to a shared resource (see Systems)

Furthermore a component receives its triggers from its surroundings through its ports. Note that a component trigger is either a provides-in or a requires-out event. If the component emits events over its ports they are referred to as actions. An action is either a provides-out or a requires-in event.


Next: Component Behavior, Up: Components   [Contents][Index]