You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2008/03/06 01:41:28 UTC

[DISCUSS] Validate applicable policySets for a given policy set attachpoint

Hi,

I'm looking into the policy framework code. I found it very strange that we 
have some code in the ContributionServiceImpl to modify the composite file 
and attach tuscany attributes to the XML document to keep the applicable 
policy sets for a given PolicySetAttachPoint. The later is calculated by 
applying the PolicySet.getAppliesTo() XPath. The following shows the altered 
XML:

<component name="MyComponent" tuscany:applicablePolicySets="..." 
tuscany:policySets="..." ...>
</component>

IMO, the ContributionService should be independent of any artifact types. 
Why do we need to transform the SCA composite file for the policy validation 
purpose in the contribution service?

I understand it's a bit difficult to apply XPath for StAX streams. Can we do 
the following instead?

1) Use the StAXArtifactProcessor.write() method to produce a DOM 
representation of the PolicySetAttachPoint so that we can apply the XPath 
given by PolicySet.getAppliesTo().

2) Remove the getApplicablePolicySets() in the PolicySetAttachPoint model. 
The validation should be handled when we configure/build the composite. 
There is no need to pre-calculate the applicable policy sets.

Thanks,
Raymond 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [DISCUSS] Validate applicable policySets for a given policy set attachpoint

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi,

Right but this brings in a circular dependency isn't it ?

Thanks.

- Venkat

On Thu, Mar 6, 2008 at 10:27 PM, Raymond Feng <en...@gmail.com> wrote:

> Hi,
>
> It should be fairly simple to make StAXArtifactProcessorExtensionPoint
> available to CompositeBuilderImpl. With that, we can find the
> corresponding
> StAXArtifactProcessor for a given PolicySetAttachPoint. For example, if
> you
> try to match a component service with an XPath, you can do:
>
> StAXArtifactProcessor p =
> staxArtifactProcessorExtensionPoint.getProcessor(ComponentService.class);
> p.write(componentReference, staxWriter);
>
> Then you can build a DOM from the staxWriter to apply XPath.
>
> Am I missing something?
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Venkata Krishnan" <fo...@gmail.com>
> Sent: Thursday, March 06, 2008 2:52 AM
> To: <tu...@ws.apache.org>
> Subject: Re: [DISCUSS] Validate applicable policySets for a given policy
> set
> attachpoint
>
> > Hi Raymond,
> >
> > I did start with the write option but ended up with trouble trying to
> > access
> > the write methods from the Builders where the PolicySets get matched.  I
> > brought this up for discussion in
> > http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg27768.html
> > where
> > Sebastien suggested that we move this to a 'preprocessing' phase and
> that
> > how
> >
> > I do understand your concerns about the dependence this brings into
> > ContributionServiceImpl which is something I anyways planned to clean up
> > by
> > moving all of it to CompositeProcessor.
> >
> > Thanks
> >
> > - Venkat
> >
> > On Thu, Mar 6, 2008 at 6:11 AM, Raymond Feng <en...@gmail.com>
> wrote:
> >
> >> Hi,
> >>
> >> I'm looking into the policy framework code. I found it very strange
> that
> >> we
> >> have some code in the ContributionServiceImpl to modify the composite
> >> file
> >> and attach tuscany attributes to the XML document to keep the
> applicable
> >> policy sets for a given PolicySetAttachPoint. The later is calculated
> by
> >> applying the PolicySet.getAppliesTo() XPath. The following shows the
> >> altered
> >> XML:
> >>
> >> <component name="MyComponent" tuscany:applicablePolicySets="..."
> >> tuscany:policySets="..." ...>
> >> </component>
> >>
> >> IMO, the ContributionService should be independent of any artifact
> types.
> >> Why do we need to transform the SCA composite file for the policy
> >> validation
> >> purpose in the contribution service?
> >>
> >> I understand it's a bit difficult to apply XPath for StAX streams. Can
> we
> >> do
> >> the following instead?
> >>
> >> 1) Use the StAXArtifactProcessor.write() method to produce a DOM
> >> representation of the PolicySetAttachPoint so that we can apply the
> XPath
> >> given by PolicySet.getAppliesTo().
> >>
> >> 2) Remove the getApplicablePolicySets() in the PolicySetAttachPoint
> >> model.
> >> The validation should be handled when we configure/build the composite.
> >> There is no need to pre-calculate the applicable policy sets.
> >>
> >> Thanks,
> >> Raymond
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: [DISCUSS] Validate applicable policySets for a given policy set attachpoint

Posted by Raymond Feng <en...@gmail.com>.
Hi,

It should be fairly simple to make StAXArtifactProcessorExtensionPoint 
available to CompositeBuilderImpl. With that, we can find the corresponding 
StAXArtifactProcessor for a given PolicySetAttachPoint. For example, if you 
try to match a component service with an XPath, you can do:

StAXArtifactProcessor p = 
staxArtifactProcessorExtensionPoint.getProcessor(ComponentService.class);
p.write(componentReference, staxWriter);

Then you can build a DOM from the staxWriter to apply XPath.

Am I missing something?

Thanks,
Raymond
--------------------------------------------------
From: "Venkata Krishnan" <fo...@gmail.com>
Sent: Thursday, March 06, 2008 2:52 AM
To: <tu...@ws.apache.org>
Subject: Re: [DISCUSS] Validate applicable policySets for a given policy set 
attachpoint

> Hi Raymond,
>
> I did start with the write option but ended up with trouble trying to 
> access
> the write methods from the Builders where the PolicySets get matched.  I
> brought this up for discussion in
> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg27768.html 
> where
> Sebastien suggested that we move this to a 'preprocessing' phase and that
> how
>
> I do understand your concerns about the dependence this brings into
> ContributionServiceImpl which is something I anyways planned to clean up 
> by
> moving all of it to CompositeProcessor.
>
> Thanks
>
> - Venkat
>
> On Thu, Mar 6, 2008 at 6:11 AM, Raymond Feng <en...@gmail.com> wrote:
>
>> Hi,
>>
>> I'm looking into the policy framework code. I found it very strange that
>> we
>> have some code in the ContributionServiceImpl to modify the composite 
>> file
>> and attach tuscany attributes to the XML document to keep the applicable
>> policy sets for a given PolicySetAttachPoint. The later is calculated by
>> applying the PolicySet.getAppliesTo() XPath. The following shows the
>> altered
>> XML:
>>
>> <component name="MyComponent" tuscany:applicablePolicySets="..."
>> tuscany:policySets="..." ...>
>> </component>
>>
>> IMO, the ContributionService should be independent of any artifact types.
>> Why do we need to transform the SCA composite file for the policy
>> validation
>> purpose in the contribution service?
>>
>> I understand it's a bit difficult to apply XPath for StAX streams. Can we
>> do
>> the following instead?
>>
>> 1) Use the StAXArtifactProcessor.write() method to produce a DOM
>> representation of the PolicySetAttachPoint so that we can apply the XPath
>> given by PolicySet.getAppliesTo().
>>
>> 2) Remove the getApplicablePolicySets() in the PolicySetAttachPoint 
>> model.
>> The validation should be handled when we configure/build the composite.
>> There is no need to pre-calculate the applicable policy sets.
>>
>> Thanks,
>> Raymond
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [DISCUSS] Validate applicable policySets for a given policy set attachpoint

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi Raymond,

I did start with the write option but ended up with trouble trying to access
the write methods from the Builders where the PolicySets get matched.  I
brought this up for discussion in
http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg27768.html where
Sebastien suggested that we move this to a 'preprocessing' phase and that
how

I do understand your concerns about the dependence this brings into
ContributionServiceImpl which is something I anyways planned to clean up by
moving all of it to CompositeProcessor.

Thanks

- Venkat

On Thu, Mar 6, 2008 at 6:11 AM, Raymond Feng <en...@gmail.com> wrote:

> Hi,
>
> I'm looking into the policy framework code. I found it very strange that
> we
> have some code in the ContributionServiceImpl to modify the composite file
> and attach tuscany attributes to the XML document to keep the applicable
> policy sets for a given PolicySetAttachPoint. The later is calculated by
> applying the PolicySet.getAppliesTo() XPath. The following shows the
> altered
> XML:
>
> <component name="MyComponent" tuscany:applicablePolicySets="..."
> tuscany:policySets="..." ...>
> </component>
>
> IMO, the ContributionService should be independent of any artifact types.
> Why do we need to transform the SCA composite file for the policy
> validation
> purpose in the contribution service?
>
> I understand it's a bit difficult to apply XPath for StAX streams. Can we
> do
> the following instead?
>
> 1) Use the StAXArtifactProcessor.write() method to produce a DOM
> representation of the PolicySetAttachPoint so that we can apply the XPath
> given by PolicySet.getAppliesTo().
>
> 2) Remove the getApplicablePolicySets() in the PolicySetAttachPoint model.
> The validation should be handled when we configure/build the composite.
> There is no need to pre-calculate the applicable policy sets.
>
> Thanks,
> Raymond
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>