You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2008/04/18 17:52:41 UTC

Re: Removing definitions

On Mon, Mar 31, 2008 at 1:13 PM, Venkata Krishnan <fo...@gmail.com>
wrote:

> Hi Ramkumar,
>
> Welcome to Tuscany!  Yes, this is a good simple start.  Please go ahead
> and
> create a JIRA for this.  Also would like to see you discuss the
> alternatives
> you have in mind for this.
>
> Thanks
>
> - Venkat
>
>
> On Mon, Mar 31, 2008 at 3:58 PM, Ramkumar R <ra...@gmail.com> wrote:
>
> > On 3/27/08, Greg Dritschler <gr...@gmail.com> wrote:
> > >
> > > >
> > > > I'm not sure I'm getting the multi-threading thing, could you say a
> > bit
> > > > more about it?
> > > >
> > > > --
> > > > Jean-Sebastien
> > > >  <tu...@ws.apache.org>
> > > >
> > >
> > > Thread 1 and thread 2 call ContributionService.contribute.  Each
> > > contribution contains a defintions.xml file so both threads try to add
> > > policy sets etc.  Since SCADefinitions uses unsynchronized ArrayLists
> > this
> > > is exposed to failure.  SCADefinitionsUtil also has some code that
> isn't
> > > thread safe.
> > >
> > > Greg
> > >
> >
> > Hi, I am new to Tuscany Community and trying to catch up.  Right now
> > am going through the code to get a feel of it and this threading issue
> > seems
> > to something simple that I can fix to try a hand with Tuscany.  Can I
> > create
> > a JIRA for the threading issue alone and attach a patch ?
> >
> > --
> > Thanks & Regards,
> > Ramkumar Ramalingam
> >
>

I want to comment again on the original subject that started this thread and
which is recorded in the associated JIRA (
https://issues.apache.org/jira/browse/TUSCANY-2172), i.e. removing
definitions when contributions are removed. Two approaches for managing
contributions in a domain come to mind.

1. Keep a cache of contributions up to date w.r.t additions and deletions
and create a stream of events to modify the live runtimes as the cache
changes in terms of available composites, definitions etc.
2. Keep a cache of contributions up to date w.r.t additions and deletions
and restart the live runtimes when anything in the cache changes.
Calculating from scratch all the policies, reference/service relationships
etc.

While we did think about contribution removal operations in the old
domain/node implementation they didn't really get bottomed out as it started
to get complicated (approach 1) this was replaced with the workspace
(approach 2) so we aren't really dealing with the case where things get
removed. We simply treat the resulting domain as if it were a new domain and
recalculate everything.

Does this help at all?

Regards

Simon