eclipselabs / passerelle

Passerelle, an actor-based process engine based on Ptolemy II
5 stars 3 forks source link

Extract configurable multi-input/multi-output support from actor base class. #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The goal is to be able to add "configurable multiport support" to an actor 
implementation through composition, i.o. through inheritance.

Original issue reported on code.google.com by erwin...@gmail.com on 18 Nov 2011 at 1:02

GoogleCodeExporter commented 9 years ago
- remark : not yet 100% certain about feasibility!

- use an extension-through-attribute : define interface for the desired 
extension behaviour, and implement it as subclass of ptolemy Attribute.
  this way it can be added either in code of an actor implementation, or just by configuring it in a MOML property of that actor

- define basic support for "configuration-extenders" through an interface and 
the relevant interactions in the passerelle actor base class
-- attributeChanged() should invoke the extender
-- the extender must be able to do stuff on the actor

- implement this for configurable multi-ports :
-- extender must be able to add the corresponding parameter(s) to the 
containing actor to define input/output port names
-- when receiving port names changes, it must adjust the ports on the 
containing actor
-- this should be feasible by just moving the logic that's currently inside 
DynamicNamedInputPortsActor & DynamicNamedOutputPortsActor into extenders

Original comment by erwin...@gmail.com on 18 Nov 2011 at 1:33

GoogleCodeExporter commented 9 years ago
- multi-output done and committed.
- i.o. via attributeChanged() impact on the containing actor, the 
com.isencia.passerelle.actor.dynaport.OutputPortConfigurationExtender registers 
itself as a ValueListener on the outputPortNamesParameter.
- tested via a trial implementation of a new abstract actor 
"com.isencia.passerelle.actor.eip.MessageRouter"

- multi-input done and committed, cfr 
"com.isencia.passerelle.actor.dynaport.InputPortConfigurationExtender"

Original comment by erwin...@gmail.com on 18 Nov 2011 at 6:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Created a variation on the port configuration extenders that does not work 
through the addition of an actor parameter, but with a plain setter to enforce 
the list of required input/output ports.

Use In/OutputPortSetterBuilder for such a use case.
For 'automated' port mgmt, use In/OutputPortConfigurationExtender.

Original comment by erwin...@gmail.com on 24 Nov 2011 at 1:31