anuragraghavan / franca

Automatically exported from code.google.com/p/franca
0 stars 0 forks source link

Deployment does not handle client references to service instances #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the attached deployment specification "CommonAPI-language-binding.fdepl" it 
is possible to define providers and instances and their CommonAPI addresses 
using deployment property "CommonApiAddress". See "depltest_dbus.fdepl" for 
example, which tries to define a InternalMediaPlayer component registering 3 
service instances together with its CommonAPI addresses.

In the example InternalMediaPlayer shall be a client to CeDeviceMediaPlayer 
interface instances (just example - don´t care for use case here please), 
which are defined by
ClientInstanceReferences = { "local:a.b.c:x2", "local:a.b.c:x3" }

Proposing to introduce interface instances as deployment model data type, to 
allow validated references of instance usages. This includes to provide a 
name/id for instance definitions.

In the deployment specification this could look like:
ClientInstanceReferences: Instance[] (optional);

In the definition it could look like:
define org.genivi.commonapi.dbus.deployment.deployment
    for provider InternalMediaPlayer
    {
        ComponentName = "player.driver"
        ClientInstanceReferences = { Player2, Player3 }
    }
define org.genivi.commonapi.dbus.deployment.deployment
    for provider CeDeviceMediaPlayer
    {
        ComponentName = "player.CE_Device0"

        instance org.example.AuxInPlayer named Player2 {
            CommonApiAddress = "local:a.b.c:x2"
        }

Original issue reported on code.google.com by manfred....@bmw.de on 23 Jul 2014 at 12:24

Attachments:

GoogleCodeExporter commented 9 years ago
Open question: how to handle usage references cross different language 
bindings/deployment definitions.

Original comment by manfred....@bmw.de on 23 Jul 2014 at 12:26

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 29 Jul 2014 at 9:38

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 10 Nov 2014 at 1:15

GoogleCodeExporter commented 9 years ago
Implemented by commit 3316711 on develop.

The final syntax is as follows. In the deployment specification, the property 
has to be declared with the new 'Instance' type:

   ClientInstanceReferences:  Instance[];

In the deployment definition of the provider, the instance which we want to 
refer to has to be labeled using the new 'as' syntax:

   instance org.example.AuxInPlayer as Player2 { ... }

Finally, in the deployment definition which refers to the interface instance 
the property can be set by:

   ClientInstanceReferences = { CeDeviceMediaPlayer.Player2, ... others ... }

In the example above, the property is an array of Instance elements. Obviously, 
properties may also have a single Instance element as its value. Note that the 
fully qualified name must be used when referring to an interface instance, as 
the instance will usually be defined in a different provider definition than 
the definition where the instance is defined.

Original comment by klaus.birken@gmail.com on 12 Nov 2014 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 19 Dec 2014 at 2:35