In most cases policy based behaviour is only enabled when explicit
policy is attached to the assembly model (there are exceptions to this
of course when the policy is provided by default, by a binding for
example).. The specs leave default behaviour up to the runtime, for
example,

1654 9.2 Common Transaction Patterns
1655 In the absence of any transaction policies there is no explicit
transactional behavior defined for the SCA
1656 service component or the interactions in which it is involved and
the transactional behavior is
1657 environment-specific. An SCA runtime provider can choose to
define an out of band default transactional
1658 behavior that applies in the absence of any transaction policies.

I'd like to see a pluggable way to specify default policy behviour in
Tuscany if that's what you need to do.  Is there already a way to do
this?

If not I think the ideal candidate for this is the policy builder but
we'd need to adjust to have all policy builders called for all
endpoints, endpoint references and implementation. At the moment they
only get called if there is a policy set of the builders policy type
present. Maybe we we could add extra methods to the SPI to deal with
the default case, i.e. the case where the particular policy type isn't
present. The build can then decide it it needs to add a policy set.

The other alternative is to rely on the existing wire processor SPI.
This could work if we were desperate but it requires too much
knowledge of the runtime just to add default interceptors.

Thoughts?

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to