We have two options here:

1) Call all types of PolicyBuilder to populate the default values into the model 2) Call all types of PolicyProviderFactory to give them the opportunity to enforce the default behavior (The current code supports this flavor).

Option 1 is interesting to explore. If it happens, the builders will add the default values to the in-memory assembly model when the intents/policySets are absent in the SCDL. PolicyProviderFactory can then be registered by the policy types. Tuscany runtime will look them up from the ProviderFactoryExtensionPoint by the type and call them to configure the invocation chain.

Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <[email protected]>
Sent: Thursday, January 21, 2010 2:10 PM
To: "tuscany-dev" <[email protected]>
Subject: default policy behaviour

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