[ 
https://issues.apache.org/jira/browse/MUSE-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Twiner resolved MUSE-254.
-------------------------------

    Resolution: Fixed

marking as resolved, asked Vinh to verify the fixes in head match his latest 
patches.

> ServiceGroup can't reference other ServiceGroups
> ------------------------------------------------
>
>                 Key: MUSE-254
>                 URL: https://issues.apache.org/jira/browse/MUSE-254
>             Project: Muse
>          Issue Type: Bug
>         Environment: Muse 2.2.0, Eclipse 3.2.1
>            Reporter: Vinh Nguyen
>            Assignee: Chris Twiner
>             Fix For: 2.2.1
>
>         Attachments: ServiceGroup.java
>
>
> SimpleServiceGroup has a bug. It doesn't allow a ServiceGroup to add 
> references to other ServiceGroups.  But I think this should be allowed.
> The current limitation/flaw is in resourceAdded() and createEntry().  In the 
> current logic, it creates and initializes at the same time.  So even before 
> it can be added to the ServiceGroup mappings, the ResourceManager invokes the 
> resourceAdded() listener method...which is why it currently can't allow 
> adding SGs because it will go into an endless loop.
> The fix:
> 1) Remove filter logic at top of resourceAdded() which filters ServiceGroups. 
> Still need to filter Entry resources though.
> 2) In createEntry(), remove the code chunk at the end which:
>    a) calls resource.initialize()
>    b) adds the resource to ResourceManager
>    c) sets termination time on the resource
> 3) Move the above code to a new initializeEntry(WsResource,Date) method.
> 4) In resourceAdded(), remove code block which gets termination time of the 
> parent resource.
>    It's not needed because the new Entry resource doesn't need a termination 
> time.
>    It'll automatically be removed in resourceRemoved().  See Muse-253.
> 5) In addEntry(), replace with this logic:
>         WsResource entry = createEntry(epr, null, null);
>         addEntry(epr, entry);
>         try
>         {
>             initializeEntry(entry, null);
>         }
>         catch (Exception exc)
>         {
>             removeEntry(entry);
>             throw new AddRefusedFault(exc);
>         }
> Basically, the logic flow is more streamlined.
> Create the entry but DON'T initialize it yet.
> Add the Entry, then initialize it.
> If initialization fails, then remove it.
> So now, a ServiceGroup is able to reference other ServiceGroups:)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to